All of lore.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>
Subject: Re: [PATCH v2 1/2] nvme: add tracepoint for nvme_setup_cmd
Date: Tue, 16 Jan 2018 17:49:54 +0100	[thread overview]
Message-ID: <20180116164954.GA9812@lst.de> (raw)
In-Reply-To: <20180116142821.11693-2-jthumshirn@suse.de>

> +	trace_seq_printf(p, "slba=%llu, length=%u, control=0x%x, dsmgmt=%u, reftag=%u",

Overly long line.

> +			 (unsigned long long)le64_to_cpu(rw.slba),

u64 now always is an unsigned long long, no need for the cast.

> +			 le16_to_cpu(rw.length), le16_to_cpu(rw.control),
> +			 le32_to_cpu(rw.dsmgmt), le32_to_cpu(rw.reftag));
> +	trace_seq_putc(p, 0);

This look weird, is there a a good reason for putting a 0 character?

Also I'd be tempted to add a new trace.c file for these and make them
dependent on whatever kernel option enables the tracing.

> --- /dev/null
> +++ b/drivers/nvme/host/trace.h
> @@ -0,0 +1,69 @@
> +/* SPDX-License-Identifier: GPL-2.0 */

Please add a real copyright header including the author.

const char *nvme_trace_parse_cmd(struct trace_seq *p, struct nvme_command cmnd);

> +#define __parse_nvme_cmd(cmd) nvme_trace_parse_cmd(p, cmd)

This looks weird.

> +TRACE_EVENT(nvme_setup_cmd,
> +
> +	    TP_PROTO(struct nvme_command *cmd),
> +
> +	    TP_ARGS(cmd),
> +

Please remove these empty lines.

> +	    TP_STRUCT__entry(
> +		    __field( __u8,                opcode   )
> +		    __field( __u8,                flags    )
> +		    __field( __u16,               cid      )
> +		    __field( __le32,              nsid     )
> +		    __field( __le64,              metadata )

> +		    __field_struct( struct nvme_command, cmnd )
And the additional whitespaces before and after the braces

> +	    TP_fast_assign(
> +		    __entry->opcode	= cmd->common.opcode;
> +		    __entry->flags	= cmd->common.flags;
> +		    __entry->cid	= cmd->common.command_id;
> +		    __entry->nsid	= cmd->common.nsid;
> +		    __entry->metadata	= cmd->common.metadata;
> +		    memcpy(&__entry->cmnd, cmd, sizeof(__entry->cmnd));

Copying the whole SQE in tracing seems rather excessive.

> +	    TP_printk("nsid=%u, command_id=%u, flags=0x%x, metadata=0x%llx, cmd=(%s %s)",

Too long line.

> +		      le32_to_cpu(__entry->nsid), __entry->cid, __entry->flags,
> +		      (unsigned long long) le64_to_cpu(__entry->metadata),

no need for the cast.

> +#undef TRACE_INCLUDE_PATH
> +#define TRACE_INCLUDE_PATH ../../drivers/nvme/host

This seems wrong.  Instead you should make sure we include the srcdir
in the makefile, take a look at fs/xfs/Makefile for example.

  reply	other threads:[~2018-01-16 16:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 14:28 [PATCH v2 0/2] add tracepoints for nvme command submission and completion Johannes Thumshirn
2018-01-16 14:28 ` [PATCH v2 1/2] nvme: add tracepoint for nvme_setup_cmd Johannes Thumshirn
2018-01-16 16:49   ` Christoph Hellwig [this message]
2018-01-17  7:46     ` Johannes Thumshirn
2018-01-17  7:46       ` Johannes Thumshirn
2018-01-16 14:28 ` [PATCH v2 2/2] nvme: add tracepoint for nvme_complete_rq Johannes Thumshirn
2018-01-16 16:50   ` Christoph Hellwig
2018-01-17  8:50     ` Johannes Thumshirn
2018-01-17  8:50       ` Johannes Thumshirn
2018-01-16 14:55 ` [PATCH v2 0/2] add tracepoints for nvme command submission and completion Keith Busch
2018-01-16 15:00   ` 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=20180116164954.GA9812@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=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.