Fix: Replace pointer values with task->tk_pid and rpc_clnt->cl_clid
[lttng-modules.git] / instrumentation / events / lttng-module / rpc.h
... / ...
CommitLineData
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(3,12,0))
13LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
14
15 TP_PROTO(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#else
26LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status,
27
28 TP_PROTO(struct rpc_task *task),
29
30 TP_ARGS(task),
31
32 TP_FIELDS(
33 ctf_integer_hex(const struct rpc_task *, task, task)
34 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
35 ctf_integer(int, status, task->tk_status)
36 )
37)
38#endif
39
40LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status,
41 TP_PROTO(struct rpc_task *task),
42
43 TP_ARGS(task)
44)
45
46LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status,
47 TP_PROTO(struct rpc_task *task),
48
49 TP_ARGS(task)
50)
51
52#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
53LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
54 TP_PROTO(const struct rpc_task *task),
55
56 TP_ARGS(task),
57
58 TP_FIELDS(
59 ctf_integer(unsigned int, task_id, task->tk_pid)
60 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
61 ctf_integer(int, status, task->tk_status)
62 )
63)
64
65LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
66
67 TP_PROTO(const struct rpc_task *task, const void *action),
68
69 TP_ARGS(task, action),
70
71 TP_FIELDS(
72 ctf_integer(unsigned int, task_id, task->tk_pid)
73 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
74 ctf_integer_hex(const void *, action, action)
75 ctf_integer(unsigned long, runstate, task->tk_runstate)
76 ctf_integer(int, status, task->tk_status)
77 ctf_integer(unsigned short, flags, task->tk_flags)
78 )
79)
80
81LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
82
83 TP_PROTO(const struct rpc_task *task, const void *action),
84
85 TP_ARGS(task, action)
86)
87
88LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
89
90 TP_PROTO(const struct rpc_task *task, const void *action),
91
92 TP_ARGS(task, action)
93)
94
95LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
96
97 TP_PROTO(const struct rpc_task *task, const void *action),
98
99 TP_ARGS(task, action)
100)
101
102LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
103
104 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
105
106 TP_ARGS(task, q),
107
108 TP_FIELDS(
109 ctf_integer(unsigned int, task_id, task->tk_pid)
110 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
111 ctf_integer(unsigned long, timeout, task->tk_timeout)
112 ctf_integer(unsigned long, runstate, task->tk_runstate)
113 ctf_integer(int, status, task->tk_status)
114 ctf_integer(unsigned short, flags, task->tk_flags)
115 ctf_string(q_name, rpc_qname(q))
116 )
117)
118
119LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
120
121 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
122
123 TP_ARGS(task, q)
124)
125
126LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
127
128 TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
129
130 TP_ARGS(task, q)
131)
132
133#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
134LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
135 TP_PROTO(struct rpc_task *task, int status),
136
137 TP_ARGS(task, status),
138
139 TP_FIELDS(
140 ctf_integer(unsigned int, task_id, task->tk_pid)
141 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
142 ctf_integer(int, status, status)
143 )
144)
145
146LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
147
148 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
149
150 TP_ARGS(clnt, task, action),
151
152 TP_FIELDS(
153 ctf_integer(unsigned int, task_id, task->tk_pid)
154 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
155 ctf_integer_hex(const void *, action, action)
156 ctf_integer(unsigned long, runstate, task->tk_runstate)
157 ctf_integer(int, status, task->tk_status)
158 ctf_integer(unsigned short, flags, task->tk_flags)
159 )
160)
161
162LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
163
164 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
165
166 TP_ARGS(clnt, task, action)
167)
168
169LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
170
171 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
172
173 TP_ARGS(clnt, task, action)
174)
175
176LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
177
178 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
179
180 TP_ARGS(clnt, task, action)
181)
182
183LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
184
185 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
186
187 TP_ARGS(clnt, task, q),
188
189 TP_FIELDS(
190 ctf_integer(unsigned int, task_id, task->tk_pid)
191 ctf_integer(unsigned int, client_id, task->tk_client->cl_clid)
192 ctf_integer(unsigned long, timeout, task->tk_timeout)
193 ctf_integer(unsigned long, runstate, task->tk_runstate)
194 ctf_integer(int, status, task->tk_status)
195 ctf_integer(unsigned short, flags, task->tk_flags)
196 ctf_string(q_name, rpc_qname(q))
197 )
198)
199
200LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
201
202 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
203
204 TP_ARGS(clnt, task, q)
205)
206
207LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
208
209 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
210
211 TP_ARGS(clnt, task, q)
212)
213
214#else
215LTTNG_TRACEPOINT_EVENT(rpc_connect_status,
216 TP_PROTO(struct rpc_task *task, int status),
217
218 TP_ARGS(task, status),
219
220 TP_FIELDS(
221 ctf_integer_hex(const struct rpc_task *, task, task)
222 ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client)
223 ctf_integer(int, status, status)
224 )
225)
226
227LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running,
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 TP_FIELDS(
234 ctf_integer_hex(const struct rpc_clnt *, clnt, clnt)
235 ctf_integer_hex(const struct rpc_task *, task, task)
236 ctf_integer_hex(const void *, action, action)
237 ctf_integer(unsigned long, runstate, task->tk_runstate)
238 ctf_integer(int, status, task->tk_status)
239 ctf_integer(unsigned short, flags, task->tk_flags)
240 )
241)
242
243LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin,
244
245 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
246
247 TP_ARGS(clnt, task, action)
248)
249
250LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action,
251
252 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
253
254 TP_ARGS(clnt, task, action)
255)
256
257LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete,
258
259 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action),
260
261 TP_ARGS(clnt, task, action)
262)
263
264LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued,
265
266 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
267
268 TP_ARGS(clnt, task, q),
269
270 TP_FIELDS(
271 ctf_integer_hex(const struct rpc_clnt *, clnt, clnt)
272 ctf_integer_hex(const struct rpc_task *, task, task)
273 ctf_integer(unsigned long, timeout, task->tk_timeout)
274 ctf_integer(unsigned long, runstate, task->tk_runstate)
275 ctf_integer(int, status, task->tk_status)
276 ctf_integer(unsigned short, flags, task->tk_flags)
277 ctf_string(q_name, rpc_qname(q))
278 )
279)
280
281LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep,
282
283 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
284
285 TP_ARGS(clnt, task, q)
286)
287
288LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup,
289
290 TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q),
291
292 TP_ARGS(clnt, task, q)
293)
294#endif
295
296#endif /* LTTNG_TRACE_RPC_H */
297
298#include <probes/define_trace.h>
This page took 0.023455 seconds and 4 git commands to generate.