Linux CXL
 help / color / mirror / Atom feed
* [PATCH] cxl/trace: Initialize cxl_poison region name to NULL
@ 2024-03-14  4:43 alison.schofield
  2024-03-14 13:53 ` Ira Weiny
  0 siblings, 1 reply; 10+ messages in thread
From: alison.schofield @ 2024-03-14  4:43 UTC (permalink / raw)
  To: Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Vishal Verma,
	Ira Weiny, Dan Williams
  Cc: Alison Schofield, linux-cxl

From: Alison Schofield <alison.schofield@intel.com>

The TP_STRUCT__entry that gets assigned the region name, or an
empty string if no region is present, is erroneously initialized
to the cxl_region pointer. It needs to be initialized to NULL
otherwise its length is wrong and garbage chars can appear in
the kernel trace output: /sys/kernel/tracing/trace

Impact is that tooling depending on that trace data can miss
picking up a valid event when searching by region name. The
TP_printk() output, if enabled, does emit the correct region
names in the dmesg log.

This was found during testing of the cxl-list option to report
media-errors for a region.

Fixes: ddf49d57b841 ("cxl/trace: Add TRACE support for CXL media-error records")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
---
 drivers/cxl/core/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h
index bdf117a33744..bc5ca4d530d1 100644
--- a/drivers/cxl/core/trace.h
+++ b/drivers/cxl/core/trace.h
@@ -657,7 +657,7 @@ TRACE_EVENT(cxl_poison,
 		__string(host, dev_name(cxlmd->dev.parent))
 		__field(u64, serial)
 		__field(u8, trace_type)
-		__string(region, region)
+		__string(region, NULL)
 		__field(u64, overflow_ts)
 		__field(u64, hpa)
 		__field(u64, dpa)

base-commit: e8f897f4afef0031fe618a8e94127a0934896aba
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-03-14 20:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-14  4:43 [PATCH] cxl/trace: Initialize cxl_poison region name to NULL alison.schofield
2024-03-14 13:53 ` Ira Weiny
2024-03-14 17:04   ` Alison Schofield
2024-03-14 17:25     ` Ira Weiny
2024-03-14 18:44     ` Steven Rostedt
2024-03-14 18:47       ` Steven Rostedt
2024-03-14 20:08       ` Alison Schofield
2024-03-14 20:34         ` Steven Rostedt
2024-03-14 20:49       ` Ira Weiny
2024-03-14 17:24   ` Ira Weiny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox