All of lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH 1/1] nvme: add get-feature to admin cmds tracer
Date: Thu, 31 Jan 2019 09:11:09 -0700	[thread overview]
Message-ID: <20190131161108.GA20811@localhost.localdomain> (raw)
In-Reply-To: <1548947610-9330-1-git-send-email-maxg@mellanox.com>

On Thu, Jan 31, 2019@05:13:30PM +0200, Max Gurtovoy wrote:
> +static const char *nvme_trace_admin_get_features(struct trace_seq *p,
> +						 u8 *cdw10)
> +{
> +	const char *ret = trace_seq_buffer_ptr(p);
> +	u8 fid = cdw10[0];
> +	u8 sel = cdw10[1];
> +	u32 cdw11 = get_unaligned_le32(cdw10 + 4);
> +
> +	trace_seq_printf(p, "fid=0x%x sel=0x%x cdw11=0x%x", fid, sel, cdw11);
> +	trace_seq_putc(p, 0);

The 'sel' field is technically 3 bits, so this decoding may have a
forward compatibility problem if the commitee defines the upper bits
to a different field. Of course we'd have to update any trace event if
the spec changes in the future anyway.

So then maybe it would make more sense to *not* decode these things in
the kernel and just print out raw dwords that can be piped to a user
space utility for a more human friendly interpretation. Something like
what blkparse does for block trace events. Does that sound okay, or do
people really prefer having the kernel do this?

  reply	other threads:[~2019-01-31 16:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 15:13 [PATCH 1/1] nvme: add get-feature to admin cmds tracer Max Gurtovoy
2019-01-31 16:11 ` Keith Busch [this message]
2019-01-31 17:01   ` Max Gurtovoy
2019-02-04  8:23     ` Johannes Thumshirn
2019-02-07 10:28       ` Max Gurtovoy
2019-02-08  8:42         ` Christoph Hellwig
2019-02-08  8:49           ` Johannes Thumshirn
2019-02-08 15:30             ` Keith Busch
2019-02-08 15:39               ` Johannes Thumshirn

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=20190131161108.GA20811@localhost.localdomain \
    --to=keith.busch@intel.com \
    /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.