68c622c0c63e09d7192951d3c62d750ee99b42f5
[lttng-modules.git] / instrumentation / events / lttng-module / rpc.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM rpc
4
5 #if !defined(LTTNG_TRACE_RPC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_RPC_H
7
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/sunrpc/sched.h>
10 #include <linux/sunrpc/clnt.h>
11
12 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
13 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
14
15 TP_PROTO(const struct rpc_task *task),
16
17 TP_ARGS(task),
18
19 TP_FIELDS(
20 ctf_integer(unsigned int, task_id, task->tk_pid)
21 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
22 ctf_integer(int, status, task->tk_status)
23 )
24 )
25
26 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
27 TP_PROTO(const struct rpc_task *task),
28
29 TP_ARGS(task)
30 )
31
32 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
33 TP_PROTO(const struct rpc_task *task),
34
35 TP_ARGS(task)
36 )
37 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
38 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
39
40 TP_PROTO(struct rpc_task *task),
41
42 TP_ARGS(task),
43
44 TP_FIELDS(
45 ctf_integer(unsigned int, task_id, task->tk_pid)
46 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
47 ctf_integer(int, status, task->tk_status)
48 )
49 )
50
51 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
52 TP_PROTO(struct rpc_task *task),
53
54 TP_ARGS(task)
55 )
56
57 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
58 TP_PROTO(struct rpc_task *task),
59
60 TP_ARGS(task)
61 )
62 #else
63 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
64
65 TP_PROTO(struct rpc_task *task),
66
67 TP_ARGS(task),
68
69 TP_FIELDS(
70 ctf_integer_hex(const struct rpc_task *, task, task)
71 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
72 ctf_integer(int, status, task->tk_status)
73 )
74 )
75
76 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
77 TP_PROTO(struct rpc_task *task),
78
79 TP_ARGS(task)
80 )
81
82 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
83 TP_PROTO(struct rpc_task *task),
84
85 TP_ARGS(task)
86 )
87 #endif
88
89 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
90 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_connect_status,
91 TP_PROTO(const struct rpc_task *task),
92
93 TP_ARGS(task)
94 )
95 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
96 LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
97 TP_PROTO(const struct rpc_task *task),
98
99 TP_ARGS(task),
100
101 TP_FIELDS(
102 ctf_integer(unsigned int, task_id, task->tk_pid)
103 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
104 ctf_integer(int, status, task->tk_status)
105 )
106 )
107 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
108 LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
109 TP_PROTO(struct rpc_task *task, int status),
110
111 TP_ARGS(task, status),
112
113 TP_FIELDS(
114 ctf_integer(unsigned int, task_id, task->tk_pid)
115 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
116 ctf_integer(int, status, status)
117 )
118 )
119 #else
120 LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
121 TP_PROTO(struct rpc_task *task, int status),
122
123 TP_ARGS(task, status),
124
125 TP_FIELDS(
126 ctf_integer_hex(const struct rpc_task *, task, task)
127 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
128 ctf_integer(int, status, status)
129 )
130 )
131 #endif
132
133 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
134 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
135
136 TP_PROTO(const struct rpc_task *task, const void *action),
137
138 TP_ARGS(task, action),
139
140 TP_FIELDS(
141 ctf_integer(unsigned int, task_id, task->tk_pid)
142 ctf_integer(unsigned int, client_id, task->tk_client ? task->tk_client->cl_clid : -1)
143 ctf_integer_hex(const void *, action, action)
144 ctf_integer(unsigned long, runstate, task->tk_runstate)
145 ctf_integer(int, status, task->tk_status)
146 ctf_integer(unsigned short, flags, task->tk_flags)
147 )
148 )
149
150 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
151
152 TP_PROTO(const struct rpc_task *task, const void *action),
153
154 TP_ARGS(task, action)
155 )
156
157 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
158
159 TP_PROTO(const struct rpc_task *task, const void *action),
160
161 TP_ARGS(task, action)
162 )
163
164 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
165
166 TP_PROTO(const struct rpc_task *task, const void *action),
167
168 TP_ARGS(task, action)
169 )
170
171 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
172
173 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
174
175 TP_ARGS(task, q),
176
177 TP_FIELDS(
178 ctf_integer(unsigned int, task_id, task->tk_pid)
179 ctf_integer(unsigned int, client_id, task->tk_client ?
180 task->tk_client->cl_clid : -1)
181 ctf_integer(unsigned long, timeout, task->tk_timeout)
182 ctf_integer(unsigned long, runstate, task->tk_runstate)
183 ctf_integer(int, status, task->tk_status)
184 ctf_integer(unsigned short, flags, task->tk_flags)
185 ctf_string(q_name, rpc_qname(q))
186 )
187 )
188
189 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
190
191 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
192
193 TP_ARGS(task, q)
194 )
195
196 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
197
198 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
199
200 TP_ARGS(task, q)
201 )
202
203 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
204 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
205
206 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
207
208 TP_ARGS(clnt, task, action),
209
210 TP_FIELDS(
211 ctf_integer(unsigned int, task_id, task->tk_pid)
212 ctf_integer(unsigned int, client_id, task->tk_client ? task->tk_client->cl_clid : -1)
213 ctf_integer_hex(const void *, action, action)
214 ctf_integer(unsigned long, runstate, task->tk_runstate)
215 ctf_integer(int, status, task->tk_status)
216 ctf_integer(unsigned short, flags, task->tk_flags)
217 )
218 )
219
220 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
221
222 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
223
224 TP_ARGS(clnt, task, action)
225 )
226
227 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
228
229 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
230
231 TP_ARGS(clnt, task, action)
232 )
233
234 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
235
236 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
237
238 TP_ARGS(clnt, task, action)
239 )
240
241 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
242
243 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
244
245 TP_ARGS(clnt, task, q),
246
247 TP_FIELDS(
248 ctf_integer(unsigned int, task_id, task->tk_pid)
249 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
250 ctf_integer(unsigned long, timeout, task->tk_timeout)
251 ctf_integer(unsigned long, runstate, task->tk_runstate)
252 ctf_integer(int, status, task->tk_status)
253 ctf_integer(unsigned short, flags, task->tk_flags)
254 ctf_string(q_name, rpc_qname(q))
255 )
256 )
257
258 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
259
260 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
261
262 TP_ARGS(clnt, task, q)
263 )
264
265 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
266
267 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
268
269 TP_ARGS(clnt, task, q)
270 )
271
272 #else
273 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
274
275 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
276
277 TP_ARGS(clnt, task, action),
278
279 TP_FIELDS(
280 ctf_integer_hex(const struct rpc_clnt *, clnt, clnt)
281 ctf_integer_hex(const struct rpc_task *, task, task)
282 ctf_integer_hex(const void *, action, action)
283 ctf_integer(unsigned long, runstate, task->tk_runstate)
284 ctf_integer(int, status, task->tk_status)
285 ctf_integer(unsigned short, flags, task->tk_flags)
286 )
287 )
288
289 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
290
291 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
292
293 TP_ARGS(clnt, task, action)
294 )
295
296 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
297
298 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
299
300 TP_ARGS(clnt, task, action)
301 )
302
303 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
304
305 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
306
307 TP_ARGS(clnt, task, action)
308 )
309
310 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
311
312 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
313
314 TP_ARGS(clnt, task, q),
315
316 TP_FIELDS(
317 ctf_integer_hex(const struct rpc_clnt *, clnt, clnt)
318 ctf_integer_hex(const struct rpc_task *, task, task)
319 ctf_integer(unsigned long, timeout, task->tk_timeout)
320 ctf_integer(unsigned long, runstate, task->tk_runstate)
321 ctf_integer(int, status, task->tk_status)
322 ctf_integer(unsigned short, flags, task->tk_flags)
323 ctf_string(q_name, rpc_qname(q))
324 )
325 )
326
327 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
328
329 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
330
331 TP_ARGS(clnt, task, q)
332 )
333
334 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
335
336 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
337
338 TP_ARGS(clnt, task, q)
339 )
340 #endif
341
342 #endif /* LTTNG_TRACE_RPC_H */
343
344 #include <probes/define_trace.h>
This page took 0.03521 seconds and 3 git commands to generate.