Skip to content

Commit dbea519

Browse files
weiny2ardbiesheuvel
authored andcommitted
cxl/trace: Remove unnecessary memcpy's
CPER events don't have UUIDs. Therefore UUIDs were removed from the records passed to trace events and replaced with hard coded values. As pointed out by Jonathan, the new defines for the UUIDs present a more efficient way to assign UUID in trace records.[1] Replace memcpy's with the use of static data. [1] https://lore.kernel.org/all/20240108132325.00000e9c@Huawei.com/ Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent 54ce192 commit dbea519

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/cxl/core/trace.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ TRACE_EVENT(cxl_general_media,
338338

339339
TP_fast_assign(
340340
CXL_EVT_TP_fast_assign(cxlmd, log, rec->hdr);
341-
memcpy(&__entry->hdr_uuid, &CXL_EVENT_GEN_MEDIA_UUID, sizeof(uuid_t));
341+
__entry->hdr_uuid = CXL_EVENT_GEN_MEDIA_UUID;
342342

343343
/* General Media */
344344
__entry->dpa = le64_to_cpu(rec->phys_addr);
@@ -425,7 +425,7 @@ TRACE_EVENT(cxl_dram,
425425

426426
TP_fast_assign(
427427
CXL_EVT_TP_fast_assign(cxlmd, log, rec->hdr);
428-
memcpy(&__entry->hdr_uuid, &CXL_EVENT_DRAM_UUID, sizeof(uuid_t));
428+
__entry->hdr_uuid = CXL_EVENT_DRAM_UUID;
429429

430430
/* DRAM */
431431
__entry->dpa = le64_to_cpu(rec->phys_addr);
@@ -573,7 +573,7 @@ TRACE_EVENT(cxl_memory_module,
573573

574574
TP_fast_assign(
575575
CXL_EVT_TP_fast_assign(cxlmd, log, rec->hdr);
576-
memcpy(&__entry->hdr_uuid, &CXL_EVENT_MEM_MODULE_UUID, sizeof(uuid_t));
576+
__entry->hdr_uuid = CXL_EVENT_MEM_MODULE_UUID;
577577

578578
/* Memory Module Event */
579579
__entry->event_type = rec->event_type;

0 commit comments

Comments
 (0)