lkml.org 
[lkml]   [2019]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@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,

Josef

\
 
 \ /
  Last update: 2019-04-07 02:11    [W:0.076 / U:3.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site