All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: fix nvme_setup_command metadata trace event
@ 2021-07-19 16:44 Keith Busch
  2021-07-20  2:48 ` Hou Pu
  2021-07-21  7:55 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Keith Busch @ 2021-07-19 16:44 UTC (permalink / raw)
  To: linux-nvme, sagi, hch; +Cc: Keith Busch

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>
---
 drivers/nvme/host/trace.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/trace.h b/drivers/nvme/host/trace.h
index daaf700eae79..35bac7a25422 100644
--- a/drivers/nvme/host/trace.h
+++ b/drivers/nvme/host/trace.h
@@ -56,7 +56,7 @@ TRACE_EVENT(nvme_setup_cmd,
 		__field(u8, fctype)
 		__field(u16, cid)
 		__field(u32, nsid)
-		__field(u64, metadata)
+		__field(bool, metadata)
 		__array(u8, cdw10, 24)
 	    ),
 	    TP_fast_assign(
@@ -66,13 +66,13 @@ TRACE_EVENT(nvme_setup_cmd,
 		__entry->flags = cmd->common.flags;
 		__entry->cid = cmd->common.command_id;
 		__entry->nsid = le32_to_cpu(cmd->common.nsid);
-		__entry->metadata = le64_to_cpu(cmd->common.metadata);
+		__entry->metadata = !!blk_integrity_rq(req);
 		__entry->fctype = cmd->fabrics.fctype;
 		__assign_disk_name(__entry->disk, req->rq_disk);
 		memcpy(__entry->cdw10, &cmd->common.cdw10,
 			sizeof(__entry->cdw10));
 	    ),
-	    TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)",
+	    TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%x, cmd=(%s %s)",
 		      __entry->ctrl_id, __print_disk_name(__entry->disk),
 		      __entry->qid, __entry->cid, __entry->nsid,
 		      __entry->flags, __entry->metadata,
-- 
2.25.4


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH] nvme: fix nvme_setup_command metadata trace event
  2021-07-19 16:44 [PATCH] nvme: fix nvme_setup_command metadata trace event Keith Busch
@ 2021-07-20  2:48 ` Hou Pu
  2021-07-20 15:09   ` Keith Busch
  2021-07-21  7:55 ` Christoph Hellwig
  1 sibling, 1 reply; 4+ messages in thread
From: Hou Pu @ 2021-07-20  2:48 UTC (permalink / raw)
  To: kbusch; +Cc: hch, linux-nvme, sagi, houpu.main

On Mon, 19 Jul 2021 09:44:39 -0700, Keith Busch wrote:
> @@ -66,13 +66,13 @@ TRACE_EVENT(nvme_setup_cmd,
>  		__entry->flags = cmd->common.flags;
>  		__entry->cid = cmd->common.command_id;
>  		__entry->nsid = le32_to_cpu(cmd->common.nsid);
> -		__entry->metadata = le64_to_cpu(cmd->common.metadata);
> +		__entry->metadata = !!blk_integrity_rq(req);
>  		__entry->fctype = cmd->fabrics.fctype;
>  		__assign_disk_name(__entry->disk, req->rq_disk);
>  		memcpy(__entry->cdw10, &cmd->common.cdw10,
>  			sizeof(__entry->cdw10));
>  	    ),
> -	    TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)",
> +	    TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%x, cmd=(%s %s)",

Can we also change "cmd=(%s %s)" to "cmd(%s, %s)" like the target side.

Current host side trace:
kworker/3:1H-120     [003] ....   115.253610: nvme_setup_cmd: nvme0: qid=0, cmdid=17, nsid=0, flags=0x0, meta=0x0, cmd=(nvme_admin_identify cns=2, ctrlid=0)
kworker/3:1H-120     [003] ....   115.264971: nvme_setup_cmd: nvme0: qid=0, cmdid=18, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_admin_identify cns=3, ctrlid=0)
kworker/3:1H-120     [003] ....   115.279639: nvme_setup_cmd: nvme0: qid=0, cmdid=19, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_admin_identify cns=0, ctrlid=0)

Current target side trace:
kworker/0:1H-56      [000] .... 50793.382363: nvmet_req_init: nvmet1: qid=0, cmdid=17, nsid=0, flags=0x40, meta=0x0, cmd=(nvme_admin_identify, cns=2, ctrlid=0)
kworker/0:1H-56      [000] .... 50793.391998: nvmet_req_init: nvmet1: qid=0, cmdid=18, nsid=1, flags=0x40, meta=0x0, cmd=(nvme_admin_identify, cns=3, ctrlid=0)
kworker/0:1H-56      [000] .... 50793.406733: nvmet_req_init: nvmet1: qid=0, cmdid=19, nsid=1, flags=0x40, meta=0x0, cmd=(nvme_admin_identify, cns=0, ctrlid=0)

Thanks,
Hou

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH] nvme: fix nvme_setup_command metadata trace event
  2021-07-20  2:48 ` Hou Pu
@ 2021-07-20 15:09   ` Keith Busch
  0 siblings, 0 replies; 4+ messages in thread
From: Keith Busch @ 2021-07-20 15:09 UTC (permalink / raw)
  To: Hou Pu; +Cc: hch, linux-nvme, sagi

On Tue, Jul 20, 2021 at 10:48:47AM +0800, Hou Pu wrote:
> On Mon, 19 Jul 2021 09:44:39 -0700, Keith Busch wrote:
> > @@ -66,13 +66,13 @@ TRACE_EVENT(nvme_setup_cmd,
> >  		__entry->flags = cmd->common.flags;
> >  		__entry->cid = cmd->common.command_id;
> >  		__entry->nsid = le32_to_cpu(cmd->common.nsid);
> > -		__entry->metadata = le64_to_cpu(cmd->common.metadata);
> > +		__entry->metadata = !!blk_integrity_rq(req);
> >  		__entry->fctype = cmd->fabrics.fctype;
> >  		__assign_disk_name(__entry->disk, req->rq_disk);
> >  		memcpy(__entry->cdw10, &cmd->common.cdw10,
> >  			sizeof(__entry->cdw10));
> >  	    ),
> > -	    TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)",
> > +	    TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%x, cmd=(%s %s)",
> 
> Can we also change "cmd=(%s %s)" to "cmd(%s, %s)" like the target side.

That would have to be a different patch, and you can send it if you
would like to see this change.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH] nvme: fix nvme_setup_command metadata trace event
  2021-07-19 16:44 [PATCH] nvme: fix nvme_setup_command metadata trace event Keith Busch
  2021-07-20  2:48 ` Hou Pu
@ 2021-07-21  7:55 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2021-07-21  7:55 UTC (permalink / raw)
  To: Keith Busch; +Cc: linux-nvme, sagi, hch

Thanks,

applied to nvme-5.14.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, other threads:[~2021-07-21  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 16:44 [PATCH] nvme: fix nvme_setup_command metadata trace event Keith Busch
2021-07-20  2:48 ` Hou Pu
2021-07-20 15:09   ` Keith Busch
2021-07-21  7:55 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.