linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Mullins <mmullins@fb.com>
To: "josef@toxicpanda.com" <josef@toxicpanda.com>
Cc: Song Liu <songliubraving@fb.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"ast@kernel.org" <ast@kernel.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	Andrew Hall <hall@fb.com>, "axboe@kernel.dk" <axboe@kernel.dk>,
	"mchehab+samsung@kernel.org" <mchehab+samsung@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Martin Lau <kafai@fb.com>, Yonghong Song <yhs@fb.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"nbd@other.debian.org" <nbd@other.debian.org>,
	"nicolas.ferre@microchip.com" <nicolas.ferre@microchip.com>
Subject: Re: [PATCH bpf-next v2 2/5] nbd: trace sending nbd requests
Date: Mon, 8 Apr 2019 21:30:29 +0000	[thread overview]
Message-ID: <370f1a299dba40bfe31459293b72d89ba0fd72c4.camel@fb.com> (raw)
In-Reply-To: <20190407001045.vbmwrzaokqb4ufww@MacBook-Pro-91.local>

On Sat, 2019-04-06 at 20:10 -0400, Josef Bacik wrote:
> On Fri, Apr 05, 2019 at 04:55:03PM -0700, Matt Mullins wrote:
> > This adds a tracepoint that can both observe the nbd request being sent
> > to the server, as well as modify that request , e.g., setting a flag in
> > the request that will cause the server to collect detailed tracing data.
> > 
> > The struct request * being handled is included to permit correlation
> > with the block tracepoints.
> > 
> > Signed-off-by: Matt Mullins <mmullins@fb.com>
> > ---
> >  MAINTAINERS                |  1 +
> >  drivers/block/nbd.c        |  5 ++++
> >  include/trace/events/nbd.h | 56 ++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 62 insertions(+)
> >  create mode 100644 include/trace/events/nbd.h
> > 
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index e17ebf70b548..6db583d2b0ea 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -10737,6 +10737,7 @@ L:	linux-block@vger.kernel.org
> >  L:	nbd@other.debian.org
> >  F:	Documentation/blockdev/nbd.txt
> >  F:	drivers/block/nbd.c
> > +F:	include/trace/events/nbd.h
> >  F:	include/uapi/linux/nbd.h
> >  
> >  NETWORK DROP MONITOR
> > diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> > index 90ba9f4c03f3..7393d04d255c 100644
> > --- a/drivers/block/nbd.c
> > +++ b/drivers/block/nbd.c
> > @@ -44,6 +44,9 @@
> >  #include <linux/nbd-netlink.h>
> >  #include <net/genetlink.h>
> >  
> > +#define CREATE_TRACE_POINTS
> > +#include <trace/events/nbd.h>
> > +
> >  static DEFINE_IDR(nbd_index_idr);
> >  static DEFINE_MUTEX(nbd_index_mutex);
> >  static int nbd_total_devices = 0;
> > @@ -526,6 +529,8 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)
> >  	handle = nbd_cmd_handle(cmd);
> >  	memcpy(request.handle, &handle, sizeof(handle));
> >  
> > +	trace_nbd_send_request(&request, nbd->index, blk_mq_rq_from_pdu(cmd));
> > +
> 
> Just use the handle, not the pointer.  Thanks,

Assuming you're talking about the struct request *, we are tracing
things through from blk_mq_start_request, which emits tracepoints like

DEFINE_EVENT(block_rq, block_rq_issue,
	TP_PROTO(struct request_queue *q, struct request *rq),

We need at least one of the tracepoints to observe a correlation
between NBD handle (in this case, embedded in the struct nbd_request)
and the struct request.  That said, I don't actually mind if they're
the hashed kind of pointers, as long as the rest of the block
tracepoints do the same...

  reply	other threads:[~2019-04-08 21:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05 23:55 [PATCH bpf-next v2 0/5] writable contexts for bpf raw tracepoints Matt Mullins
2019-04-05 23:55 ` [PATCH bpf-next v2 1/5] bpf: add writable context for " Matt Mullins
2019-04-05 23:55 ` [PATCH bpf-next v2 2/5] nbd: trace sending nbd requests Matt Mullins
2019-04-07  0:10   ` Josef Bacik
2019-04-08 21:30     ` Matt Mullins [this message]
2019-04-05 23:55 ` [PATCH bpf-next v2 3/5] nbd: add tracepoints for send/receive timing Matt Mullins
2019-04-07  0:13   ` Josef Bacik
2019-04-05 23:55 ` [PATCH bpf-next v2 4/5] tools: sync bpf.h Matt Mullins
2019-04-05 23:55 ` [PATCH bpf-next v2 5/5] selftests: bpf: test writable buffers in raw tps Matt Mullins

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=370f1a299dba40bfe31459293b72d89ba0fd72c4.camel@fb.com \
    --to=mmullins@fb.com \
    --cc=ast@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hall@fb.com \
    --cc=josef@toxicpanda.com \
    --cc=kafai@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nbd@other.debian.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=rostedt@goodmis.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).