Fix: sunrpc instrumentation for 4.17
[lttng-modules.git] / instrumentation / events / lttng-module / rpc.h
CommitLineData
b87700e3 1#undef TRACE_SYSTEM
9bbf98da 2#define TRACE_SYSTEM rpc
b87700e3 3
9bbf98da
MD
4#if !defined(LTTNG_TRACE_RPC_H) || defined(TRACE_HEADER_MULTI_READ)
5#define LTTNG_TRACE_RPC_H
b87700e3 6
6ec43db8 7#include <probes/lttng-tracepoint-event.h>
b87700e3
AG
8#include <linux/sunrpc/sched.h>
9#include <linux/sunrpc/clnt.h>
b87700e3 10
3bc29f0a 11LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
b87700e3
AG
12
13 TP_PROTO(struct rpc_task *task),
14
15 TP_ARGS(task),
16
f127e61e 17 TP_FIELDS(
fa91fcac
MD
18 ctf_integer_hex(const struct rpc_task *, task, task)
19 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
f127e61e
MD
20 ctf_integer(int, status, task->tk_status)
21 )
b87700e3
AG
22)
23
3bc29f0a 24LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
b87700e3
AG
25 TP_PROTO(struct rpc_task *task),
26
27 TP_ARGS(task)
28)
29
3bc29f0a 30LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
b87700e3
AG
31 TP_PROTO(struct rpc_task *task),
32
33 TP_ARGS(task)
34)
35
0f891764
MJ
36#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
37LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
38 TP_PROTO(const struct rpc_task *task),
39
40 TP_ARGS(task),
41
42 TP_FIELDS(
43 ctf_integer_hex(const struct rpc_task *, task, task)
44 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
45 ctf_integer(int, status, task->tk_status)
46 )
47)
48
49LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
50
51 TP_PROTO(const struct rpc_task *task, const void *action),
52
53 TP_ARGS(task, action),
54
55 TP_FIELDS(
56 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
57 ctf_integer_hex(const struct rpc_task *, task, task)
58 ctf_integer_hex(const void *, action, action)
59 ctf_integer(unsigned long, runstate, task->tk_runstate)
60 ctf_integer(int, status, task->tk_status)
61 ctf_integer(unsigned short, flags, task->tk_flags)
62 )
63)
64
65LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
66
67 TP_PROTO(const struct rpc_task *task, const void *action),
68
69 TP_ARGS(task, action)
70)
71
72LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
73
74 TP_PROTO(const struct rpc_task *task, const void *action),
75
76 TP_ARGS(task, action)
77)
78
79LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
80
81 TP_PROTO(const struct rpc_task *task, const void *action),
82
83 TP_ARGS(task, action)
84)
85
86LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
87
88 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
89
90 TP_ARGS(task, q),
91
92 TP_FIELDS(
93 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
94 ctf_integer_hex(const struct rpc_task *, task, task)
95 ctf_integer(unsigned long, timeout, task->tk_timeout)
96 ctf_integer(unsigned long, runstate, task->tk_runstate)
97 ctf_integer(int, status, task->tk_status)
98 ctf_integer(unsigned short, flags, task->tk_flags)
99 ctf_string(q_name, rpc_qname(q))
100 )
101)
102
103LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
104
105 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
106
107 TP_ARGS(task, q)
108)
109
110LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
111
112 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
113
114 TP_ARGS(task, q)
115)
116
117#else
3bc29f0a 118LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
b87700e3
AG
119 TP_PROTO(struct rpc_task *task, int status),
120
121 TP_ARGS(task, status),
122
f127e61e 123 TP_FIELDS(
fa91fcac
MD
124 ctf_integer_hex(const struct rpc_task *, task, task)
125 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
f127e61e
MD
126 ctf_integer(int, status, status)
127 )
b87700e3
AG
128)
129
3bc29f0a 130LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
b87700e3
AG
131
132 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
133
134 TP_ARGS(clnt, task, action),
135
f127e61e 136 TP_FIELDS(
fa91fcac
MD
137 ctf_integer_hex(const struct rpc_clnt *, clnt, clnt)
138 ctf_integer_hex(const struct rpc_task *, task, task)
139 ctf_integer_hex(const void *, action, action)
f127e61e
MD
140 ctf_integer(unsigned long, runstate, task->tk_runstate)
141 ctf_integer(int, status, task->tk_status)
142 ctf_integer(unsigned short, flags, task->tk_flags)
143 )
b87700e3
AG
144)
145
3bc29f0a 146LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
b87700e3
AG
147
148 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
149
150 TP_ARGS(clnt, task, action)
b87700e3
AG
151)
152
3bc29f0a 153LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
b87700e3
AG
154
155 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
156
157 TP_ARGS(clnt, task, action)
b87700e3
AG
158)
159
3bc29f0a 160LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
b87700e3
AG
161
162 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
163
164 TP_ARGS(clnt, task, action)
b87700e3
AG
165)
166
3bc29f0a 167LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
b87700e3
AG
168
169 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
170
171 TP_ARGS(clnt, task, q),
172
f127e61e 173 TP_FIELDS(
fa91fcac
MD
174 ctf_integer_hex(const struct rpc_clnt *, clnt, clnt)
175 ctf_integer_hex(const struct rpc_task *, task, task)
f127e61e
MD
176 ctf_integer(unsigned long, timeout, task->tk_timeout)
177 ctf_integer(unsigned long, runstate, task->tk_runstate)
178 ctf_integer(int, status, task->tk_status)
179 ctf_integer(unsigned short, flags, task->tk_flags)
180 ctf_string(q_name, rpc_qname(q))
181 )
b87700e3
AG
182)
183
3bc29f0a 184LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
b87700e3
AG
185
186 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
187
188 TP_ARGS(clnt, task, q)
b87700e3
AG
189)
190
3bc29f0a 191LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
b87700e3
AG
192
193 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
194
195 TP_ARGS(clnt, task, q)
b87700e3 196)
0f891764 197#endif
b87700e3 198
9bbf98da 199#endif /* LTTNG_TRACE_RPC_H */
b87700e3 200
6ec43db8 201#include <probes/define_trace.h>
This page took 0.038752 seconds and 4 git commands to generate.