1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM nbd
5 #if !defined(_TRACE_NBD_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/tracepoint.h>
10 DECLARE_EVENT_CLASS(nbd_transport_event
,
12 TP_PROTO(struct request
*req
, u64 handle
),
17 __field(struct request
*, req
)
23 __entry
->handle
= handle
;
27 "nbd transport event: request %p, handle 0x%016llx",
33 DEFINE_EVENT(nbd_transport_event
, nbd_header_sent
,
35 TP_PROTO(struct request
*req
, u64 handle
),
40 DEFINE_EVENT(nbd_transport_event
, nbd_payload_sent
,
42 TP_PROTO(struct request
*req
, u64 handle
),
47 DEFINE_EVENT(nbd_transport_event
, nbd_header_received
,
49 TP_PROTO(struct request
*req
, u64 handle
),
54 DEFINE_EVENT(nbd_transport_event
, nbd_payload_received
,
56 TP_PROTO(struct request
*req
, u64 handle
),
61 DECLARE_EVENT_CLASS(nbd_send_request
,
63 TP_PROTO(struct nbd_request
*nbd_request
, int index
,
66 TP_ARGS(nbd_request
, index
, rq
),
69 __field(struct nbd_request
*, nbd_request
)
70 __field(u64
, dev_index
)
71 __field(struct request
*, request
)
75 __entry
->nbd_request
= 0;
76 __entry
->dev_index
= index
;
77 __entry
->request
= rq
;
80 TP_printk("nbd%lld: request %p", __entry
->dev_index
, __entry
->request
)
83 #ifdef DEFINE_EVENT_WRITABLE
84 #undef NBD_DEFINE_EVENT
85 #define NBD_DEFINE_EVENT(template, call, proto, args, size) \
86 DEFINE_EVENT_WRITABLE(template, call, PARAMS(proto), \
89 #undef NBD_DEFINE_EVENT
90 #define NBD_DEFINE_EVENT(template, call, proto, args, size) \
91 DEFINE_EVENT(template, call, PARAMS(proto), PARAMS(args))
94 NBD_DEFINE_EVENT(nbd_send_request
, nbd_send_request
,
96 TP_PROTO(struct nbd_request
*nbd_request
, int index
,
99 TP_ARGS(nbd_request
, index
, rq
),
101 sizeof(struct nbd_request
)
106 /* This part must be outside protection */
107 #include <trace/define_trace.h>