Skip to content

Commit 234211b

Browse files
keithbuschChristoph Hellwig
authored andcommitted
nvme: fix nvme_setup_command metadata trace event
The metadata address is set after the trace event, so the trace is not capturing anything useful. Rather than logging the memory address, it's useful to know if the command carries a metadata payload, so change the trace event to log that true/false state instead. Signed-off-by: Keith Busch <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 5396fda commit 234211b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/nvme/host/trace.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TRACE_EVENT(nvme_setup_cmd,
5656
__field(u8, fctype)
5757
__field(u16, cid)
5858
__field(u32, nsid)
59-
__field(u64, metadata)
59+
__field(bool, metadata)
6060
__array(u8, cdw10, 24)
6161
),
6262
TP_fast_assign(
@@ -66,13 +66,13 @@ TRACE_EVENT(nvme_setup_cmd,
6666
__entry->flags = cmd->common.flags;
6767
__entry->cid = cmd->common.command_id;
6868
__entry->nsid = le32_to_cpu(cmd->common.nsid);
69-
__entry->metadata = le64_to_cpu(cmd->common.metadata);
69+
__entry->metadata = !!blk_integrity_rq(req);
7070
__entry->fctype = cmd->fabrics.fctype;
7171
__assign_disk_name(__entry->disk, req->rq_disk);
7272
memcpy(__entry->cdw10, &cmd->common.cdw10,
7373
sizeof(__entry->cdw10));
7474
),
75-
TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)",
75+
TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%x, cmd=(%s %s)",
7676
__entry->ctrl_id, __print_disk_name(__entry->disk),
7777
__entry->qid, __entry->cid, __entry->nsid,
7878
__entry->flags, __entry->metadata,

0 commit comments

Comments
 (0)