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