[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190407001045.vbmwrzaokqb4ufww@MacBook-Pro-91.local>
Date: Sat, 6 Apr 2019 20:10:46 -0400
From: Josef Bacik <josef@...icpanda.com>
To: Matt Mullins <mmullins@...com>
Cc: hall@...com, ast@...nel.org, bpf@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Josef Bacik <josef@...icpanda.com>,
Jens Axboe <axboe@...nel.dk>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
"David S. Miller" <davem@...emloft.net>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
linux-block@...r.kernel.org, nbd@...er.debian.org
Subject: Re: [PATCH bpf-next v2 2/5] nbd: trace sending nbd requests
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,
Josef
Powered by blists - more mailing lists