1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM rpc
5 #if !defined(LTTNG_TRACE_RPC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_RPC_H
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/sunrpc/sched.h>
10 #include <linux/sunrpc/clnt.h>
12 #ifndef ONCE_LTTNG_RPC_H
13 #define ONCE_LTTNG_RPC_H
15 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
17 int lttng_get_clid(const struct rpc_task
*task
)
19 struct rpc_clnt
*tk_client
;
21 tk_client
= task
->tk_client
;
25 * The cl_clid field is always initialized to positive signed
26 * integers. Negative signed integer values are treated as
29 return (int) tk_client
->cl_clid
;
31 #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
33 #endif /* ONCE_LTTNG_RPC_H */
35 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
36 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status
,
38 TP_PROTO(const struct rpc_task
*task
),
43 ctf_integer(unsigned int, task_id
, task
->tk_pid
)
44 ctf_integer(int, client_id
, lttng_get_clid(task
))
45 ctf_integer(int, status
, task
->tk_status
)
49 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status
, rpc_call_status
,
50 TP_PROTO(const struct rpc_task
*task
),
55 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status
, rpc_bind_status
,
56 TP_PROTO(const struct rpc_task
*task
),
60 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
61 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status
,
63 TP_PROTO(struct rpc_task
*task
),
68 ctf_integer(unsigned int, task_id
, task
->tk_pid
)
69 ctf_integer(int, client_id
, lttng_get_clid(task
))
70 ctf_integer(int, status
, task
->tk_status
)
74 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status
, rpc_call_status
,
75 TP_PROTO(struct rpc_task
*task
),
80 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status
, rpc_bind_status
,
81 TP_PROTO(struct rpc_task
*task
),
86 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status
,
88 TP_PROTO(struct rpc_task
*task
),
93 ctf_integer_hex(const struct rpc_task
*, task
, task
)
94 ctf_integer_hex(const struct rpc_clnt
*, clnt
, task
->tk_client
)
95 ctf_integer(int, status
, task
->tk_status
)
99 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status
, rpc_call_status
,
100 TP_PROTO(struct rpc_task
*task
),
105 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status
, rpc_bind_status
,
106 TP_PROTO(struct rpc_task
*task
),
112 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0))
113 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status
, rpc_connect_status
,
114 TP_PROTO(const struct rpc_task
*task
),
118 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
119 LTTNG_TRACEPOINT_EVENT(rpc_connect_status
,
120 TP_PROTO(const struct rpc_task
*task
),
125 ctf_integer(unsigned int, task_id
, task
->tk_pid
)
126 ctf_integer(int, client_id
, lttng_get_clid(task
))
127 ctf_integer(int, status
, task
->tk_status
)
130 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
131 LTTNG_TRACEPOINT_EVENT(rpc_connect_status
,
132 TP_PROTO(struct rpc_task
*task
, int status
),
134 TP_ARGS(task
, status
),
137 ctf_integer(unsigned int, task_id
, task
->tk_pid
)
138 ctf_integer(int, client_id
, lttng_get_clid(task
))
139 ctf_integer(int, status
, status
)
143 LTTNG_TRACEPOINT_EVENT(rpc_connect_status
,
144 TP_PROTO(struct rpc_task
*task
, int status
),
146 TP_ARGS(task
, status
),
149 ctf_integer_hex(const struct rpc_task
*, task
, task
)
150 ctf_integer_hex(const struct rpc_clnt
*, clnt
, task
->tk_client
)
151 ctf_integer(int, status
, status
)
156 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
157 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running
,
159 TP_PROTO(const struct rpc_task
*task
, const void *action
),
161 TP_ARGS(task
, action
),
164 ctf_integer(unsigned int, task_id
, task
->tk_pid
)
165 ctf_integer(int, client_id
, lttng_get_clid(task
))
166 ctf_integer_hex(const void *, action
, action
)
167 ctf_integer(unsigned long, runstate
, task
->tk_runstate
)
168 ctf_integer(int, status
, task
->tk_status
)
169 ctf_integer(unsigned short, flags
, task
->tk_flags
)
173 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running
, rpc_task_begin
,
175 TP_PROTO(const struct rpc_task
*task
, const void *action
),
177 TP_ARGS(task
, action
)
180 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running
, rpc_task_run_action
,
182 TP_PROTO(const struct rpc_task
*task
, const void *action
),
184 TP_ARGS(task
, action
)
187 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running
, rpc_task_complete
,
189 TP_PROTO(const struct rpc_task
*task
, const void *action
),
191 TP_ARGS(task
, action
)
194 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued
,
196 TP_PROTO(const struct rpc_task
*task
, const struct rpc_wait_queue
*q
),
201 ctf_integer(unsigned int, task_id
, task
->tk_pid
)
202 ctf_integer(int, client_id
, lttng_get_clid(task
))
203 ctf_integer(unsigned long, timeout
, task
->tk_timeout
)
204 ctf_integer(unsigned long, runstate
, task
->tk_runstate
)
205 ctf_integer(int, status
, task
->tk_status
)
206 ctf_integer(unsigned short, flags
, task
->tk_flags
)
207 ctf_string(q_name
, rpc_qname(q
))
211 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued
, rpc_task_sleep
,
213 TP_PROTO(const struct rpc_task
*task
, const struct rpc_wait_queue
*q
),
218 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued
, rpc_task_wakeup
,
220 TP_PROTO(const struct rpc_task
*task
, const struct rpc_wait_queue
*q
),
225 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
226 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running
,
228 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const void *action
),
230 TP_ARGS(clnt
, task
, action
),
233 ctf_integer(unsigned int, task_id
, task
->tk_pid
)
234 ctf_integer(int, client_id
, lttng_get_clid(task
))
235 ctf_integer_hex(const void *, action
, action
)
236 ctf_integer(unsigned long, runstate
, task
->tk_runstate
)
237 ctf_integer(int, status
, task
->tk_status
)
238 ctf_integer(unsigned short, flags
, task
->tk_flags
)
242 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running
, rpc_task_begin
,
244 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const void *action
),
246 TP_ARGS(clnt
, task
, action
)
249 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running
, rpc_task_run_action
,
251 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const void *action
),
253 TP_ARGS(clnt
, task
, action
)
256 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running
, rpc_task_complete
,
258 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const void *action
),
260 TP_ARGS(clnt
, task
, action
)
263 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued
,
265 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const struct rpc_wait_queue
*q
),
267 TP_ARGS(clnt
, task
, q
),
270 ctf_integer(unsigned int, task_id
, task
->tk_pid
)
271 ctf_integer(int, client_id
, lttng_get_clid(task
))
272 ctf_integer(unsigned long, timeout
, task
->tk_timeout
)
273 ctf_integer(unsigned long, runstate
, task
->tk_runstate
)
274 ctf_integer(int, status
, task
->tk_status
)
275 ctf_integer(unsigned short, flags
, task
->tk_flags
)
276 ctf_string(q_name
, rpc_qname(q
))
280 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued
, rpc_task_sleep
,
282 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const struct rpc_wait_queue
*q
),
284 TP_ARGS(clnt
, task
, q
)
287 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued
, rpc_task_wakeup
,
289 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const struct rpc_wait_queue
*q
),
291 TP_ARGS(clnt
, task
, q
)
295 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running
,
297 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const void *action
),
299 TP_ARGS(clnt
, task
, action
),
302 ctf_integer_hex(const struct rpc_clnt
*, clnt
, clnt
)
303 ctf_integer_hex(const struct rpc_task
*, task
, task
)
304 ctf_integer_hex(const void *, action
, action
)
305 ctf_integer(unsigned long, runstate
, task
->tk_runstate
)
306 ctf_integer(int, status
, task
->tk_status
)
307 ctf_integer(unsigned short, flags
, task
->tk_flags
)
311 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running
, rpc_task_begin
,
313 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const void *action
),
315 TP_ARGS(clnt
, task
, action
)
318 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running
, rpc_task_run_action
,
320 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const void *action
),
322 TP_ARGS(clnt
, task
, action
)
325 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running
, rpc_task_complete
,
327 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const void *action
),
329 TP_ARGS(clnt
, task
, action
)
332 LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued
,
334 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const struct rpc_wait_queue
*q
),
336 TP_ARGS(clnt
, task
, q
),
339 ctf_integer_hex(const struct rpc_clnt
*, clnt
, clnt
)
340 ctf_integer_hex(const struct rpc_task
*, task
, task
)
341 ctf_integer(unsigned long, timeout
, task
->tk_timeout
)
342 ctf_integer(unsigned long, runstate
, task
->tk_runstate
)
343 ctf_integer(int, status
, task
->tk_status
)
344 ctf_integer(unsigned short, flags
, task
->tk_flags
)
345 ctf_string(q_name
, rpc_qname(q
))
349 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued
, rpc_task_sleep
,
351 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const struct rpc_wait_queue
*q
),
353 TP_ARGS(clnt
, task
, q
)
356 LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued
, rpc_task_wakeup
,
358 TP_PROTO(const struct rpc_clnt
*clnt
, const struct rpc_task
*task
, const struct rpc_wait_queue
*q
),
360 TP_ARGS(clnt
, task
, q
)
364 #endif /* LTTNG_TRACE_RPC_H */
366 #include <probes/define_trace.h>
This page took 0.054996 seconds and 4 git commands to generate.