All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minwoo Im <minwoo.im.dev@gmail.com>
To: Michal Krakowiak <michal.krakowiak@linux.intel.com>
Cc: Michal Krakowiak <michal.krakowiak@intel.com>,
	Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org, Jens Axboe <axboe@fb.com>,
	Keith Busch <kbusch@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] nvme: trace: parse format nvm command in detail
Date: Wed, 6 Jan 2021 04:31:57 +0900	[thread overview]
Message-ID: <20210105193157.GC4426@localhost.localdomain> (raw)
In-Reply-To: <20210104155343.GA26034@michal-desk>

Hello,

On 21-01-04 16:53:43, Michal Krakowiak wrote:
> FTrace does not parse NVMe commands consistently. There are commands
> that are being parsed in detail and commands for which the trace log
> contains only raw bytes of command dwords. Add detailed parsing of
> format nvm admin command to make the trace log more consistent and
> human-readable.
> 
> Signed-off-by: Michal Krakowiak <michal.krakowiak@intel.com>
> Acked-by: Dan Williams <dan.j.williams@intel.com>

Looks good to me unless driver decides to go to raw trace with
user-space application like blkparse according to Keith's opinion.

Actually Format command has several meaningful fields related
to LBA format and protection information slo so that I would be happy
for format command to be parsed for now.

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>

Thanks,

> ---
>  drivers/nvme/host/trace.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/nvme/host/trace.c b/drivers/nvme/host/trace.c
> index 5c3cb6928f3c..e0400de713b5 100644
> --- a/drivers/nvme/host/trace.c
> +++ b/drivers/nvme/host/trace.c
> @@ -102,6 +102,23 @@ static const char *nvme_trace_get_lba_status(struct trace_seq *p,
>  	return ret;
>  }
> 
> +static const char *nvme_trace_admin_format_nvm(struct trace_seq *p, u8 *cdw10)
> +{
> +	const char *ret = trace_seq_buffer_ptr(p);
> +	u8 lbaf = cdw10[0] & 0xF;
> +	u8 mset = (cdw10[0] >> 4) & 0x1;
> +	u8 pi = (cdw10[0] >> 5) & 0x7;
> +	u8 pil = cdw10[1] & 0x1;
> +	u8 ses = (cdw10[1] >> 1) & 0x7;
> +
> +	trace_seq_printf(p, "lbaf=%u, mset=%u, pi=%u, pil=%u, ses=%u",
> +			lbaf, mset, pi, pil, ses);
> +
> +	trace_seq_putc(p, 0);
> +
> +	return ret;
> +}
> +
>  static const char *nvme_trace_read_write(struct trace_seq *p, u8 *cdw10)
>  {
>  	const char *ret = trace_seq_buffer_ptr(p);
> @@ -159,6 +176,8 @@ const char *nvme_trace_parse_admin_cmd(struct trace_seq *p,
>  		return nvme_trace_admin_get_features(p, cdw10);
>  	case nvme_admin_get_lba_status:
>  		return nvme_trace_get_lba_status(p, cdw10);
> +	case nvme_admin_format_nvm:
> +		return nvme_trace_admin_format_nvm(p, cdw10);
>  	default:
>  		return nvme_trace_common(p, cdw10);
>  	}
> --
> 2.20.1
> 
> 
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme

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

  parent reply	other threads:[~2021-01-05 19:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 15:53 [PATCH] nvme: trace: parse format nvm command in detail Michal Krakowiak
2021-01-04 16:02 ` Keith Busch
2021-01-06  9:00   ` Christoph Hellwig
2021-01-08 22:34     ` Keith Busch
2021-01-09  0:12       ` Dan Williams
2021-01-11 17:01         ` Keith Busch
2021-01-11 17:10           ` Dan Williams
2021-01-11 17:50             ` Keith Busch
2021-01-11 20:15               ` Michal Krakowiak
2021-01-12  8:33                 ` Christoph Hellwig
2021-01-05 19:31 ` Minwoo Im [this message]
2021-01-27 17:46 ` Christoph Hellwig
2021-01-28 12:25   ` Michal Krakowiak
2021-01-28 12:39     ` Christoph Hellwig

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=20210105193157.GC4426@localhost.localdomain \
    --to=minwoo.im.dev@gmail.com \
    --cc=axboe@fb.com \
    --cc=dan.j.williams@intel.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=michal.krakowiak@intel.com \
    --cc=michal.krakowiak@linux.intel.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 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.