public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Christoph Hellwig <hch@lst.de>, 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>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH v4 2/2] nvme: add tracepoint for nvme_complete_rq
Date: Mon, 22 Jan 2018 16:23:40 +0100	[thread overview]
Message-ID: <20180122152340.GB5818@lst.de> (raw)
In-Reply-To: <20180119141819.11938-3-jthumshirn@suse.de>

On Fri, Jan 19, 2018 at 03:18:19PM +0100, Johannes Thumshirn wrote:
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> Reviewed-by: Keith Busch <keith.busch@intel.com>
> 
> ---
> Changes to v2:
> * Pass the whole struct request to the tracepoint
> * Removed spaces after parenthesis (Christoph)
> ---
>  drivers/nvme/host/core.c  |  2 ++
>  drivers/nvme/host/trace.h | 24 ++++++++++++++++++++++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 1ca515720216..45a9b7092993 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -193,6 +193,8 @@ static inline bool nvme_req_needs_retry(struct request *req)
>  
>  void nvme_complete_rq(struct request *req)
>  {
> +	trace_nvme_complete_rq(req);
> +
>  	if (unlikely(nvme_req(req)->status && nvme_req_needs_retry(req))) {
>  		if (nvme_req_needs_failover(req)) {
>  			nvme_failover_req(req);
> diff --git a/drivers/nvme/host/trace.h b/drivers/nvme/host/trace.h
> index 69e054c2e791..41d000fdd96f 100644
> --- a/drivers/nvme/host/trace.h
> +++ b/drivers/nvme/host/trace.h
> @@ -101,6 +101,30 @@ TRACE_EVENT(nvme_setup_cmd,
>  				       __entry->cdw10))
>  );
>  
> +TRACE_EVENT(nvme_complete_rq,
> +	    TP_PROTO(struct request *req),
> +	    TP_ARGS(req),
> +	    TP_STRUCT__entry(
> +		    __field(int, cid)
> +		    __field(__le64, result)
> +		    __field(u8, retries)
> +		    __field(u8, flags)
> +		    __field(u16, status)
> +	    ),
> +	    TP_fast_assign(
> +		    __entry->cid = req->tag;
> +		    __entry->result = nvme_req(req)->result.u64;
> +		    __entry->retries = nvme_req(req)->retries;
> +		    __entry->flags = nvme_req(req)->flags;
> +		    __entry->status = nvme_req(req)->status;
> +	    ),
> +	    TP_printk("cmdid=%u, res=%llu, retries=%u, flags=0x%x, status=%u",
> +		      __entry->cid,
> +		      le64_to_cpu(__entry->result),
> +		      __entry->retries, __entry->flags, __entry->status)
> +
> +);

Wouldn't some indication on which queue this completion happens
be useful?

  reply	other threads:[~2018-01-22 15:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 14:18 [PATCH v4 0/2] add tracepoints for nvme command submission and completion Johannes Thumshirn
2018-01-19 14:18 ` [PATCH v4 1/2] nvme: add tracepoint for nvme_setup_cmd Johannes Thumshirn
2018-01-22 15:23   ` Christoph Hellwig
2018-01-22 15:53     ` Johannes Thumshirn
2018-01-22 15:59       ` Christoph Hellwig
2018-01-22 16:04         ` Johannes Thumshirn
2018-01-22 16:10           ` Christoph Hellwig
2018-01-22 16:15             ` Johannes Thumshirn
2018-01-19 14:18 ` [PATCH v4 2/2] nvme: add tracepoint for nvme_complete_rq Johannes Thumshirn
2018-01-22 15:23   ` Christoph Hellwig [this message]
2018-01-22 15:30     ` Johannes Thumshirn
2018-01-22 19:35       ` Martin K. Petersen

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=20180122152340.GB5818@lst.de \
    --to=hch@lst.de \
    --cc=hare@suse.de \
    --cc=jthumshirn@suse.de \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=martin.petersen@oracle.com \
    --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