1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * RDMA Network Block Driver
5 * Copyright (c) 2022 1&1 IONOS SE. All rights reserved.
8 #define TRACE_SYSTEM rtrs_srv
10 #if !defined(_TRACE_RTRS_SRV_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _TRACE_RTRS_SRV_H
13 #include <linux/tracepoint.h>
19 TRACE_DEFINE_ENUM(RTRS_SRV_CONNECTING
);
20 TRACE_DEFINE_ENUM(RTRS_SRV_CONNECTED
);
21 TRACE_DEFINE_ENUM(RTRS_SRV_CLOSING
);
22 TRACE_DEFINE_ENUM(RTRS_SRV_CLOSED
);
24 #define show_rtrs_srv_state(x) \
26 { RTRS_SRV_CONNECTING, "CONNECTING" }, \
27 { RTRS_SRV_CONNECTED, "CONNECTED" }, \
28 { RTRS_SRV_CLOSING, "CLOSING" }, \
29 { RTRS_SRV_CLOSED, "CLOSED" })
31 TRACE_EVENT(send_io_resp_imm
,
32 TP_PROTO(struct rtrs_srv_op
*id
,
34 bool always_invalidate
,
37 TP_ARGS(id
, need_inval
, always_invalidate
, errno
),
41 __field(bool, need_inval
)
42 __field(bool, always_invalidate
)
45 __field(u32
, signal_interval
)
48 __array(char, sessname
, NAME_MAX
)
52 struct rtrs_srv_con
*con
= id
->con
;
53 struct rtrs_path
*s
= con
->c
.path
;
54 struct rtrs_srv_path
*srv_path
= to_srv_path(s
);
56 __entry
->dir
= id
->dir
;
57 __entry
->state
= srv_path
->state
;
58 __entry
->errno
= errno
;
59 __entry
->need_inval
= need_inval
;
60 __entry
->always_invalidate
= always_invalidate
;
61 __entry
->msg_id
= id
->msg_id
;
62 __entry
->wr_cnt
= atomic_read(&con
->c
.wr_cnt
);
63 __entry
->signal_interval
= s
->signal_interval
;
64 memcpy(__entry
->sessname
, kobject_name(&srv_path
->kobj
), NAME_MAX
);
67 TP_printk("sess='%s' state='%s' dir=%s err='%d' inval='%d' glob-inval='%d' msgid='%u' wrcnt='%d' sig-interval='%u'",
69 show_rtrs_srv_state(__entry
->state
),
70 __print_symbolic(__entry
->dir
,
75 __entry
->always_invalidate
,
78 __entry
->signal_interval
82 #endif /* _TRACE_RTRS_SRV_H */
84 #undef TRACE_INCLUDE_PATH
85 #define TRACE_INCLUDE_PATH .
86 #define TRACE_INCLUDE_FILE rtrs-srv-trace
87 #include <trace/define_trace.h>