diff options
author | Andrew Hall <hall@fb.com> | 2019-04-26 11:49:49 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-04-26 19:04:19 -0700 |
commit | 2abd2de712cd891321a06b0890a85aef1e506cb5 (patch) | |
tree | 0e133410f9fb1335c41ef94ee5e8a822206c14bb /include/trace | |
parent | ea106722c76f08002b69a6983ed84dc18958ba48 (diff) | |
download | linux-riscv-2abd2de712cd891321a06b0890a85aef1e506cb5.tar.gz linux-riscv-2abd2de712cd891321a06b0890a85aef1e506cb5.tar.bz2 linux-riscv-2abd2de712cd891321a06b0890a85aef1e506cb5.zip |
nbd: add tracepoints for send/receive timing
This adds four tracepoints to nbd, enabling separate tracing of payload
and header sending/receipt.
In the send path for headers that have already been sent, we also
explicitly initialize the handle so it can be referenced by the later
tracepoint.
Signed-off-by: Andrew Hall <hall@fb.com>
Signed-off-by: Matt Mullins <mmullins@fb.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/nbd.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/trace/events/nbd.h b/include/trace/events/nbd.h index 5928255ed02e..9849956f34d8 100644 --- a/include/trace/events/nbd.h +++ b/include/trace/events/nbd.h @@ -7,6 +7,57 @@ #include <linux/tracepoint.h> +DECLARE_EVENT_CLASS(nbd_transport_event, + + TP_PROTO(struct request *req, u64 handle), + + TP_ARGS(req, handle), + + TP_STRUCT__entry( + __field(struct request *, req) + __field(u64, handle) + ), + + TP_fast_assign( + __entry->req = req; + __entry->handle = handle; + ), + + TP_printk( + "nbd transport event: request %p, handle 0x%016llx", + __entry->req, + __entry->handle + ) +); + +DEFINE_EVENT(nbd_transport_event, nbd_header_sent, + + TP_PROTO(struct request *req, u64 handle), + + TP_ARGS(req, handle) +); + +DEFINE_EVENT(nbd_transport_event, nbd_payload_sent, + + TP_PROTO(struct request *req, u64 handle), + + TP_ARGS(req, handle) +); + +DEFINE_EVENT(nbd_transport_event, nbd_header_received, + + TP_PROTO(struct request *req, u64 handle), + + TP_ARGS(req, handle) +); + +DEFINE_EVENT(nbd_transport_event, nbd_payload_received, + + TP_PROTO(struct request *req, u64 handle), + + TP_ARGS(req, handle) +); + DECLARE_EVENT_CLASS(nbd_send_request, TP_PROTO(struct nbd_request *nbd_request, int index, |