Commit | Line | Data |
---|---|---|
9f36eaed | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
b87700e3 | 2 | #undef TRACE_SYSTEM |
9bbf98da | 3 | #define TRACE_SYSTEM rpc |
b87700e3 | 4 | |
9bbf98da MD |
5 | #if !defined(LTTNG_TRACE_RPC_H) || defined(TRACE_HEADER_MULTI_READ) |
6 | #define LTTNG_TRACE_RPC_H | |
b87700e3 | 7 | |
6ec43db8 | 8 | #include <probes/lttng-tracepoint-event.h> |
b87700e3 AG |
9 | #include <linux/sunrpc/sched.h> |
10 | #include <linux/sunrpc/clnt.h> | |
b87700e3 | 11 | |
b9dbdfe2 MJ |
12 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
13 | LTTNG_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 | |
3bc29f0a | 26 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, |
b87700e3 AG |
27 | |
28 | TP_PROTO(struct rpc_task *task), | |
29 | ||
30 | TP_ARGS(task), | |
31 | ||
f127e61e | 32 | TP_FIELDS( |
fa91fcac MD |
33 | ctf_integer_hex(const struct rpc_task *, task, task) |
34 | ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) | |
f127e61e MD |
35 | ctf_integer(int, status, task->tk_status) |
36 | ) | |
b87700e3 | 37 | ) |
b9dbdfe2 | 38 | #endif |
b87700e3 | 39 | |
3bc29f0a | 40 | LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, |
b87700e3 AG |
41 | TP_PROTO(struct rpc_task *task), |
42 | ||
43 | TP_ARGS(task) | |
44 | ) | |
45 | ||
3bc29f0a | 46 | LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, |
b87700e3 AG |
47 | TP_PROTO(struct rpc_task *task), |
48 | ||
49 | TP_ARGS(task) | |
50 | ) | |
51 | ||
0f891764 MJ |
52 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) |
53 | LTTNG_TRACEPOINT_EVENT(rpc_connect_status, | |
54 | TP_PROTO(const struct rpc_task *task), | |
55 | ||
56 | TP_ARGS(task), | |
57 | ||
58 | TP_FIELDS( | |
b9dbdfe2 MJ |
59 | ctf_integer(unsigned int, task_id, task->tk_pid) |
60 | ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | |
0f891764 MJ |
61 | ctf_integer(int, status, task->tk_status) |
62 | ) | |
63 | ) | |
64 | ||
65 | LTTNG_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( | |
b9dbdfe2 MJ |
72 | ctf_integer(unsigned int, task_id, task->tk_pid) |
73 | ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | |
0f891764 MJ |
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 | ||
81 | LTTNG_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 | ||
88 | LTTNG_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 | ||
95 | LTTNG_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 | ||
102 | LTTNG_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( | |
b9dbdfe2 MJ |
109 | ctf_integer(unsigned int, task_id, task->tk_pid) |
110 | ctf_integer(unsigned int, client_id, task->tk_client->cl_clid) | |
0f891764 MJ |
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 | ||
119 | LTTNG_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 | ||
126 | LTTNG_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 | ||
b9dbdfe2 MJ |
133 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
134 | LTTNG_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 | ||
146 | LTTNG_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 | ||
162 | LTTNG_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 | ||
169 | LTTNG_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 | ||
176 | LTTNG_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 | ||
183 | LTTNG_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 | ||
200 | LTTNG_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 | ||
207 | LTTNG_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 | ||
0f891764 | 214 | #else |
3bc29f0a | 215 | LTTNG_TRACEPOINT_EVENT(rpc_connect_status, |
b87700e3 AG |
216 | TP_PROTO(struct rpc_task *task, int status), |
217 | ||
218 | TP_ARGS(task, status), | |
219 | ||
f127e61e | 220 | TP_FIELDS( |
fa91fcac MD |
221 | ctf_integer_hex(const struct rpc_task *, task, task) |
222 | ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) | |
f127e61e MD |
223 | ctf_integer(int, status, status) |
224 | ) | |
b87700e3 AG |
225 | ) |
226 | ||
3bc29f0a | 227 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, |
b87700e3 AG |
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 | ||
f127e61e | 233 | TP_FIELDS( |
fa91fcac MD |
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) | |
f127e61e MD |
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 | ) | |
b87700e3 AG |
241 | ) |
242 | ||
3bc29f0a | 243 | LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, |
b87700e3 AG |
244 | |
245 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | |
246 | ||
247 | TP_ARGS(clnt, task, action) | |
b87700e3 AG |
248 | ) |
249 | ||
3bc29f0a | 250 | LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, |
b87700e3 AG |
251 | |
252 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | |
253 | ||
254 | TP_ARGS(clnt, task, action) | |
b87700e3 AG |
255 | ) |
256 | ||
3bc29f0a | 257 | LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, |
b87700e3 AG |
258 | |
259 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), | |
260 | ||
261 | TP_ARGS(clnt, task, action) | |
b87700e3 AG |
262 | ) |
263 | ||
3bc29f0a | 264 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, |
b87700e3 AG |
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 | ||
f127e61e | 270 | TP_FIELDS( |
fa91fcac MD |
271 | ctf_integer_hex(const struct rpc_clnt *, clnt, clnt) |
272 | ctf_integer_hex(const struct rpc_task *, task, task) | |
f127e61e MD |
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 | ) | |
b87700e3 AG |
279 | ) |
280 | ||
3bc29f0a | 281 | LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, |
b87700e3 AG |
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) | |
b87700e3 AG |
286 | ) |
287 | ||
3bc29f0a | 288 | LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, |
b87700e3 AG |
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) | |
b87700e3 | 293 | ) |
0f891764 | 294 | #endif |
b87700e3 | 295 | |
9bbf98da | 296 | #endif /* LTTNG_TRACE_RPC_H */ |
b87700e3 | 297 | |
6ec43db8 | 298 | #include <probes/define_trace.h> |