diff options
author | Andrew Hall <hall@fb.com> | 2019-04-26 14:49:49 -0400 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-04-26 22:04:19 -0400 |
commit | 2abd2de712cd891321a06b0890a85aef1e506cb5 (patch) | |
tree | 0e133410f9fb1335c41ef94ee5e8a822206c14bb /include/trace | |
parent | ea106722c76f08002b69a6983ed84dc18958ba48 (diff) |
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 @@ | |||
7 | 7 | ||
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | 9 | ||
10 | DECLARE_EVENT_CLASS(nbd_transport_event, | ||
11 | |||
12 | TP_PROTO(struct request *req, u64 handle), | ||
13 | |||
14 | TP_ARGS(req, handle), | ||
15 | |||
16 | TP_STRUCT__entry( | ||
17 | __field(struct request *, req) | ||
18 | __field(u64, handle) | ||
19 | ), | ||
20 | |||
21 | TP_fast_assign( | ||
22 | __entry->req = req; | ||
23 | __entry->handle = handle; | ||
24 | ), | ||
25 | |||
26 | TP_printk( | ||
27 | "nbd transport event: request %p, handle 0x%016llx", | ||
28 | __entry->req, | ||
29 | __entry->handle | ||
30 | ) | ||
31 | ); | ||
32 | |||
33 | DEFINE_EVENT(nbd_transport_event, nbd_header_sent, | ||
34 | |||
35 | TP_PROTO(struct request *req, u64 handle), | ||
36 | |||
37 | TP_ARGS(req, handle) | ||
38 | ); | ||
39 | |||
40 | DEFINE_EVENT(nbd_transport_event, nbd_payload_sent, | ||
41 | |||
42 | TP_PROTO(struct request *req, u64 handle), | ||
43 | |||
44 | TP_ARGS(req, handle) | ||
45 | ); | ||
46 | |||
47 | DEFINE_EVENT(nbd_transport_event, nbd_header_received, | ||
48 | |||
49 | TP_PROTO(struct request *req, u64 handle), | ||
50 | |||
51 | TP_ARGS(req, handle) | ||
52 | ); | ||
53 | |||
54 | DEFINE_EVENT(nbd_transport_event, nbd_payload_received, | ||
55 | |||
56 | TP_PROTO(struct request *req, u64 handle), | ||
57 | |||
58 | TP_ARGS(req, handle) | ||
59 | ); | ||
60 | |||
10 | DECLARE_EVENT_CLASS(nbd_send_request, | 61 | DECLARE_EVENT_CLASS(nbd_send_request, |
11 | 62 | ||
12 | TP_PROTO(struct nbd_request *nbd_request, int index, | 63 | TP_PROTO(struct nbd_request *nbd_request, int index, |