mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>,
	Keith Busch <keith.busch@intel.com>,
	Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>,
	Hannes Reinecke <hare@suse.de>,
	Linux NVMe Mailinglist <linux-nvme@lists.infradead.org>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH 2/2] nvme: add tracepoint for nvme_complete_rq
Date: Tue, 16 Jan 2018 11:34:01 +0100	[thread overview]
Message-ID: <20180116103401.7883-3-jthumshirn@suse.de> (raw)
In-Reply-To: <20180116103401.7883-1-jthumshirn@suse.de>

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/nvme/host/core.c    |  2 ++
 include/trace/events/nvme.h | 31 +++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 4b6a56fe6ccf..bac4559d6134 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -258,6 +258,8 @@ static inline bool nvme_req_needs_retry(struct request *req)
 
 void nvme_complete_rq(struct request *req)
 {
+	trace_nvme_complete_rq(nvme_req(req), req->tag);
+
 	if (unlikely(nvme_req(req)->status && nvme_req_needs_retry(req))) {
 		if (nvme_req_needs_failover(req)) {
 			nvme_failover_req(req);
diff --git a/include/trace/events/nvme.h b/include/trace/events/nvme.h
index 2e93bc7d4f84..d47bd9223241 100644
--- a/include/trace/events/nvme.h
+++ b/include/trace/events/nvme.h
@@ -9,6 +9,8 @@
 #include <linux/tracepoint.h>
 #include <linux/trace_seq.h>
 
+#include "../../../drivers/nvme/host/nvme.h"
+
 #define nvme_opcode_name(opcode)	{ opcode, #opcode }
 #define show_opcode_name(val)					\
 	__print_symbolic(val,					\
@@ -58,6 +60,35 @@ TRACE_EVENT(nvme_setup_cmd,
 		      __parse_nvme_cmd(__entry->cmnd))
 );
 
+TRACE_EVENT(nvme_complete_rq,
+
+	    TP_PROTO(struct nvme_request *req, int tag),
+
+	    TP_ARGS(req, tag),
+
+	    TP_STRUCT__entry(
+		    __field(    int, cid     )
+		    __field( __le64, result  )
+		    __field(     u8, retries )
+		    __field(     u8, flags   )
+		    __field(    u16, status  )
+	    ),
+
+	    TP_fast_assign(
+		    __entry->cid     = tag;
+		    __entry->result  = req->result.u64;
+		    __entry->retries = req->retries;
+		    __entry->flags   = req->flags;
+		    __entry->status  = req->status;
+	    ),
+
+	    TP_printk("command_id=%u, result=%llu, retries=%u, flags=0x%x, status=%u",
+		      __entry->cid,
+		      (unsigned long long)le64_to_cpu(__entry->result),
+		      __entry->retries, __entry->flags, __entry->status)
+
+);
+
 #endif /* _TRACE_NVME_H */
 
 /* This part must be boutside protection */
-- 
2.12.3

  parent reply	other threads:[~2018-01-16 10:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 10:33 [PATCH 0/2] add tracepoints for nvme command submission and completion Johannes Thumshirn
2018-01-16 10:34 ` [PATCH 1/2] nvme: add tracepoint for nvme_setup_cmd Johannes Thumshirn
2018-01-16 11:27   ` Hannes Reinecke
2018-01-16 14:19     ` Johannes Thumshirn
2018-01-16 11:28   ` Christoph Hellwig
2018-01-16 10:34 ` Johannes Thumshirn [this message]
2018-01-16 11:28   ` [PATCH 2/2] nvme: add tracepoint for nvme_complete_rq Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180116103401.7883-3-jthumshirn@suse.de \
    --to=jthumshirn@suse.de \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®