lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 8 Apr 2019 21:30:29 +0000
From:   Matt Mullins <mmullins@...com>
To:     "josef@...icpanda.com" <josef@...icpanda.com>
CC:     Song Liu <songliubraving@...com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        "daniel@...earbox.net" <daniel@...earbox.net>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>,
        "ast@...nel.org" <ast@...nel.org>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        Andrew Hall <hall@...com>, "axboe@...nel.dk" <axboe@...nel.dk>,
        "mchehab+samsung@...nel.org" <mchehab+samsung@...nel.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Martin Lau <kafai@...com>, Yonghong Song <yhs@...com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "nbd@...er.debian.org" <nbd@...er.debian.org>,
        "nicolas.ferre@...rochip.com" <nicolas.ferre@...rochip.com>
Subject: Re: [PATCH bpf-next v2 2/5] nbd: trace sending nbd requests

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@...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@...r.kernel.org
> >  L:	nbd@...er.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...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ