Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Keith Busch and committed by
Christoph Hellwig
234211b8 5396fdac

+3 -3
+3 -3
drivers/nvme/host/trace.h
··· 56 56 __field(u8, fctype) 57 57 __field(u16, cid) 58 58 __field(u32, nsid) 59 - __field(u64, metadata) 59 + __field(bool, metadata) 60 60 __array(u8, cdw10, 24) 61 61 ), 62 62 TP_fast_assign( ··· 66 66 __entry->flags = cmd->common.flags; 67 67 __entry->cid = cmd->common.command_id; 68 68 __entry->nsid = le32_to_cpu(cmd->common.nsid); 69 - __entry->metadata = le64_to_cpu(cmd->common.metadata); 69 + __entry->metadata = !!blk_integrity_rq(req); 70 70 __entry->fctype = cmd->fabrics.fctype; 71 71 __assign_disk_name(__entry->disk, req->rq_disk); 72 72 memcpy(__entry->cdw10, &cmd->common.cdw10, 73 73 sizeof(__entry->cdw10)); 74 74 ), 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)", 76 76 __entry->ctrl_id, __print_disk_name(__entry->disk), 77 77 __entry->qid, __entry->cid, __entry->nsid, 78 78 __entry->flags, __entry->metadata,