[PATCH 2/3] nvme: parse dsm command detailly when tracing

Guixin Liu kanie at linux.alibaba.com
Tue Jan 30 03:34:04 PST 2024


Add detailed parse of dsm command to make the trace log more
consistent and human-readable.

Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>
---
 drivers/nvme/host/trace.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/trace.c b/drivers/nvme/host/trace.c
index 95572c85b22a..b383d51c1a0c 100644
--- a/drivers/nvme/host/trace.c
+++ b/drivers/nvme/host/trace.c
@@ -153,10 +153,12 @@ static const char *nvme_trace_read_write(struct trace_seq *p, u8 *cdw10)
 static const char *nvme_trace_dsm(struct trace_seq *p, u8 *cdw10)
 {
 	const char *ret = trace_seq_buffer_ptr(p);
+	u8 nr = cdw10[0];
+	u8 idr = cdw10[4] & 0x1;
+	u8 idw = (cdw10[4] >> 1) & 0x1;
+	u8 ad = (cdw10[4] >> 2) & 0x1;
 
-	trace_seq_printf(p, "nr=%u, attributes=%u",
-			 get_unaligned_le32(cdw10),
-			 get_unaligned_le32(cdw10 + 4));
+	trace_seq_printf(p, "nr=%u, idr=%u, idw=%u, ad=%u", nr, idr, idw, ad);
 	trace_seq_putc(p, 0);
 
 	return ret;
-- 
2.43.0




More information about the Linux-nvme mailing list