Linux CXL
 help / color / mirror / Atom feed
* [PATCH 1/2] cxl: Move command enumeration from dev_dbg() to traceevent
@ 2023-09-15 20:13 Dave Jiang
  2023-09-15 20:13 ` [PATCH 2/2] cxl: Move opcode reporting " Dave Jiang
  2023-09-15 22:11 ` [PATCH 1/2] cxl: Move command enumeration " Ira Weiny
  0 siblings, 2 replies; 8+ messages in thread
From: Dave Jiang @ 2023-09-15 20:13 UTC (permalink / raw)
  To: linux-cxl
  Cc: dave, jonathan.cameron, alison.schofield, vishal.l.verma,
	ira.weiny, dan.j.williams

Given that event logs outputs are all emitted to traceevent, move the
enumeration of log types to traceevent as well in order to keep all the
outputs at the same location.

Suggested-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/cxl/core/mbox.c  |    3 +--
 drivers/cxl/core/trace.h |   31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index ca60bb8114f2..ab6b6c4d7a48 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -787,7 +787,6 @@ static const uuid_t log_uuid[] = {
 int cxl_enumerate_cmds(struct cxl_memdev_state *mds)
 {
 	struct cxl_mbox_get_supported_logs *gsl;
-	struct device *dev = mds->cxlds.dev;
 	struct cxl_mem_command *cmd;
 	int i, rc;
 
@@ -801,7 +800,7 @@ int cxl_enumerate_cmds(struct cxl_memdev_state *mds)
 		uuid_t uuid = gsl->entry[i].uuid;
 		u8 *log;
 
-		dev_dbg(dev, "Found LOG type %pU of size %d", &uuid, size);
+		trace_cxl_log_type(mds->cxlds.cxlmd, &uuid, size);
 
 		if (!uuid_equal(&uuid, &log_uuid[CEL_UUID]))
 			continue;
diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h
index a0b5819bc70b..817c5377eca2 100644
--- a/drivers/cxl/core/trace.h
+++ b/drivers/cxl/core/trace.h
@@ -703,6 +703,37 @@ TRACE_EVENT(cxl_poison,
 	)
 );
 
+TRACE_EVENT(cxl_log_type,
+
+	TP_PROTO(const struct cxl_memdev *cxlmd, uuid_t *uuid, int size),
+
+	TP_ARGS(cxlmd, uuid, size),
+
+	TP_STRUCT__entry(
+		__string(memdev, dev_name(&cxlmd->dev))
+		__string(host, dev_name(cxlmd->dev.parent))
+		__array(char, uuid, 16)
+		__field(u64, serial)
+		__field(int, size)
+	),
+
+	TP_fast_assign(
+		__assign_str(memdev, dev_name(&cxlmd->dev));
+		__assign_str(host, dev_name(cxlmd->dev.parent));
+		__entry->serial = cxlmd->cxlds->serial;
+		memcpy(__entry->uuid, uuid, 16);
+		__entry->size = size;
+	),
+
+	TP_printk("memdev=%s host=%s serial=%lld log_type=%pU size=%d",
+		  __get_str(memdev),
+		  __get_str(host),
+		  __entry->serial,
+		  __entry->uuid,
+		  __entry->size
+	)
+);
+
 #endif /* _CXL_EVENTS_H */
 
 #define TRACE_INCLUDE_FILE trace



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

end of thread, other threads:[~2023-09-18 21:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-15 20:13 [PATCH 1/2] cxl: Move command enumeration from dev_dbg() to traceevent Dave Jiang
2023-09-15 20:13 ` [PATCH 2/2] cxl: Move opcode reporting " Dave Jiang
2023-09-18 16:51   ` Alison Schofield
2023-09-18 21:25     ` Ira Weiny
2023-09-15 22:11 ` [PATCH 1/2] cxl: Move command enumeration " Ira Weiny
2023-09-15 22:49   ` Dave Jiang
2023-09-18 17:49     ` Ira Weiny
2023-09-18 18:21       ` Dave Jiang

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