Commit | Line | Data |
---|---|---|
b87700e3 AG |
1 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM rcu | |
3 | ||
3bc29f0a MD |
4 | #if !defined(LTTNG_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ) |
5 | #define LTTNG_TRACE_RCU_H | |
b87700e3 | 6 | |
6ec43db8 | 7 | #include <probes/lttng-tracepoint-event.h> |
b87700e3 AG |
8 | #include <linux/version.h> |
9 | ||
10 | /* | |
11 | * Tracepoint for start/end markers used for utilization calculations. | |
12 | * By convention, the string is of the following forms: | |
13 | * | |
14 | * "Start <activity>" -- Mark the start of the specified activity, | |
15 | * such as "context switch". Nesting is permitted. | |
16 | * "End <activity>" -- Mark the end of the specified activity. | |
17 | * | |
18 | * An "@" character within "<activity>" is a comment character: Data | |
19 | * reduction scripts will ignore the "@" and the remainder of the line. | |
20 | */ | |
3bc29f0a | 21 | LTTNG_TRACEPOINT_EVENT(rcu_utilization, |
b87700e3 | 22 | |
8e621312 MD |
23 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
24 | TP_PROTO(const char *s), | |
25 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 26 | TP_PROTO(char *s), |
8e621312 | 27 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
28 | |
29 | TP_ARGS(s), | |
30 | ||
f127e61e MD |
31 | TP_FIELDS( |
32 | ctf_string(s, s) | |
33 | ) | |
b87700e3 AG |
34 | ) |
35 | ||
36 | #ifdef CONFIG_RCU_TRACE | |
37 | ||
12318fb8 MD |
38 | #if defined(CONFIG_TREE_RCU) \ |
39 | || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) \ | |
40 | && defined(CONFIG_PREEMPT_RCU)) \ | |
41 | || defined(CONFIG_TREE_PREEMPT_RCU) | |
b87700e3 AG |
42 | |
43 | /* | |
44 | * Tracepoint for grace-period events: starting and ending a grace | |
45 | * period ("start" and "end", respectively), a CPU noting the start | |
46 | * of a new grace period or the end of an old grace period ("cpustart" | |
47 | * and "cpuend", respectively), a CPU passing through a quiescent | |
48 | * state ("cpuqs"), a CPU coming online or going offline ("cpuonl" | |
49 | * and "cpuofl", respectively), and a CPU being kicked for being too | |
50 | * long in dyntick-idle mode ("kick"). | |
51 | */ | |
3bc29f0a | 52 | LTTNG_TRACEPOINT_EVENT(rcu_grace_period, |
b87700e3 | 53 | |
01adf18e MD |
54 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
55 | TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent), | |
56 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 57 | TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent), |
01adf18e | 58 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
59 | |
60 | TP_ARGS(rcuname, gpnum, gpevent), | |
61 | ||
f127e61e MD |
62 | TP_FIELDS( |
63 | ctf_string(rcuname, rcuname) | |
64 | ctf_integer(unsigned long, gpnum, gpnum) | |
65 | ctf_string(gpevent, gpevent) | |
66 | ) | |
b87700e3 AG |
67 | ) |
68 | ||
69 | /* | |
70 | * Tracepoint for grace-period-initialization events. These are | |
71 | * distinguished by the type of RCU, the new grace-period number, the | |
72 | * rcu_node structure level, the starting and ending CPU covered by the | |
73 | * rcu_node structure, and the mask of CPUs that will be waited for. | |
74 | * All but the type of RCU are extracted from the rcu_node structure. | |
75 | */ | |
3bc29f0a | 76 | LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init, |
b87700e3 | 77 | |
01adf18e MD |
78 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
79 | TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level, | |
80 | int grplo, int grphi, unsigned long qsmask), | |
81 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 AG |
82 | TP_PROTO(char *rcuname, unsigned long gpnum, u8 level, |
83 | int grplo, int grphi, unsigned long qsmask), | |
01adf18e | 84 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
85 | |
86 | TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), | |
87 | ||
f127e61e MD |
88 | TP_FIELDS( |
89 | ctf_string(rcuname, rcuname) | |
90 | ctf_integer(unsigned long, gpnum, gpnum) | |
91 | ctf_integer(u8, level, level) | |
92 | ctf_integer(int, grplo, grplo) | |
93 | ctf_integer(int, grphi, grphi) | |
94 | ctf_integer(unsigned long, qsmask, qsmask) | |
95 | ) | |
b87700e3 AG |
96 | ) |
97 | ||
98 | /* | |
99 | * Tracepoint for tasks blocking within preemptible-RCU read-side | |
100 | * critical sections. Track the type of RCU (which one day might | |
101 | * include SRCU), the grace-period number that the task is blocking | |
102 | * (the current or the next), and the task's PID. | |
103 | */ | |
3bc29f0a | 104 | LTTNG_TRACEPOINT_EVENT(rcu_preempt_task, |
b87700e3 | 105 | |
01adf18e MD |
106 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
107 | TP_PROTO(const char *rcuname, int pid, unsigned long gpnum), | |
108 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 109 | TP_PROTO(char *rcuname, int pid, unsigned long gpnum), |
01adf18e | 110 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
111 | |
112 | TP_ARGS(rcuname, pid, gpnum), | |
113 | ||
f127e61e MD |
114 | TP_FIELDS( |
115 | ctf_string(rcuname, rcuname) | |
116 | ctf_integer(unsigned long, gpnum, gpnum) | |
117 | ctf_integer(int, pid, pid) | |
118 | ) | |
b87700e3 AG |
119 | ) |
120 | ||
121 | /* | |
122 | * Tracepoint for tasks that blocked within a given preemptible-RCU | |
123 | * read-side critical section exiting that critical section. Track the | |
124 | * type of RCU (which one day might include SRCU) and the task's PID. | |
125 | */ | |
3bc29f0a | 126 | LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task, |
b87700e3 | 127 | |
01adf18e MD |
128 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
129 | TP_PROTO(const char *rcuname, unsigned long gpnum, int pid), | |
130 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 131 | TP_PROTO(char *rcuname, unsigned long gpnum, int pid), |
01adf18e | 132 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
133 | |
134 | TP_ARGS(rcuname, gpnum, pid), | |
135 | ||
f127e61e MD |
136 | TP_FIELDS( |
137 | ctf_string(rcuname, rcuname) | |
138 | ctf_integer(unsigned long, gpnum, gpnum) | |
139 | ctf_integer(int, pid, pid) | |
140 | ) | |
b87700e3 AG |
141 | ) |
142 | ||
143 | /* | |
144 | * Tracepoint for quiescent-state-reporting events. These are | |
145 | * distinguished by the type of RCU, the grace-period number, the | |
146 | * mask of quiescent lower-level entities, the rcu_node structure level, | |
147 | * the starting and ending CPU covered by the rcu_node structure, and | |
148 | * whether there are any blocked tasks blocking the current grace period. | |
149 | * All but the type of RCU are extracted from the rcu_node structure. | |
150 | */ | |
3bc29f0a | 151 | LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report, |
b87700e3 | 152 | |
01adf18e MD |
153 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
154 | TP_PROTO(const char *rcuname, unsigned long gpnum, | |
155 | unsigned long mask, unsigned long qsmask, | |
156 | u8 level, int grplo, int grphi, int gp_tasks), | |
157 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 AG |
158 | TP_PROTO(char *rcuname, unsigned long gpnum, |
159 | unsigned long mask, unsigned long qsmask, | |
160 | u8 level, int grplo, int grphi, int gp_tasks), | |
01adf18e | 161 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
162 | |
163 | TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), | |
164 | ||
f127e61e MD |
165 | TP_FIELDS( |
166 | ctf_string(rcuname, rcuname) | |
167 | ctf_integer(unsigned long, gpnum, gpnum) | |
168 | ctf_integer(unsigned long, mask, mask) | |
169 | ctf_integer(unsigned long, qsmask, qsmask) | |
170 | ctf_integer(u8, level, level) | |
171 | ctf_integer(int, grplo, grplo) | |
172 | ctf_integer(int, grphi, grphi) | |
173 | ctf_integer(u8, gp_tasks, gp_tasks) | |
174 | ) | |
b87700e3 AG |
175 | ) |
176 | ||
177 | /* | |
178 | * Tracepoint for quiescent states detected by force_quiescent_state(). | |
179 | * These trace events include the type of RCU, the grace-period number | |
180 | * that was blocked by the CPU, the CPU itself, and the type of quiescent | |
181 | * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline, | |
182 | * or "kick" when kicking a CPU that has been in dyntick-idle mode for | |
183 | * too long. | |
184 | */ | |
3bc29f0a | 185 | LTTNG_TRACEPOINT_EVENT(rcu_fqs, |
b87700e3 | 186 | |
01adf18e MD |
187 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
188 | TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent), | |
189 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 190 | TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent), |
01adf18e | 191 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
192 | |
193 | TP_ARGS(rcuname, gpnum, cpu, qsevent), | |
194 | ||
f127e61e MD |
195 | TP_FIELDS( |
196 | ctf_integer(unsigned long, gpnum, gpnum) | |
197 | ctf_integer(int, cpu, cpu) | |
198 | ctf_string(rcuname, rcuname) | |
199 | ctf_string(qsevent, qsevent) | |
200 | ) | |
b87700e3 AG |
201 | ) |
202 | ||
12318fb8 MD |
203 | #endif /* |
204 | * #if defined(CONFIG_TREE_RCU) | |
205 | * || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) | |
206 | * && defined(CONFIG_PREEMPT_RCU)) | |
207 | * || defined(CONFIG_TREE_PREEMPT_RCU) | |
208 | */ | |
b87700e3 AG |
209 | |
210 | /* | |
211 | * Tracepoint for dyntick-idle entry/exit events. These take a string | |
212 | * as argument: "Start" for entering dyntick-idle mode, "End" for | |
213 | * leaving it, "--=" for events moving towards idle, and "++=" for events | |
214 | * moving away from idle. "Error on entry: not idle task" and "Error on | |
215 | * exit: not idle task" indicate that a non-idle task is erroneously | |
216 | * toying with the idle loop. | |
217 | * | |
218 | * These events also take a pair of numbers, which indicate the nesting | |
219 | * depth before and after the event of interest. Note that task-related | |
220 | * events use the upper bits of each number, while interrupt-related | |
221 | * events use the lower bits. | |
222 | */ | |
3bc29f0a | 223 | LTTNG_TRACEPOINT_EVENT(rcu_dyntick, |
b87700e3 | 224 | |
01adf18e MD |
225 | |
226 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
227 | TP_PROTO(const char *polarity, long long oldnesting, long long newnesting), | |
228 | ||
229 | TP_ARGS(polarity, oldnesting, newnesting), | |
230 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
b87700e3 AG |
231 | TP_PROTO(char *polarity, long long oldnesting, long long newnesting), |
232 | ||
233 | TP_ARGS(polarity, oldnesting, newnesting), | |
234 | #else | |
235 | TP_PROTO(char *polarity), | |
236 | ||
237 | TP_ARGS(polarity), | |
238 | #endif | |
239 | ||
f127e61e MD |
240 | TP_FIELDS( |
241 | ctf_string(polarity, polarity) | |
b87700e3 | 242 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) |
f127e61e MD |
243 | ctf_integer(long long, oldnesting, oldnesting) |
244 | ctf_integer(long long, newnesting, newnesting) | |
b87700e3 | 245 | #endif |
f127e61e | 246 | ) |
b87700e3 AG |
247 | ) |
248 | ||
249 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
250 | /* | |
251 | * Tracepoint for RCU preparation for idle, the goal being to get RCU | |
252 | * processing done so that the current CPU can shut off its scheduling | |
253 | * clock and enter dyntick-idle mode. One way to accomplish this is | |
254 | * to drain all RCU callbacks from this CPU, and the other is to have | |
255 | * done everything RCU requires for the current grace period. In this | |
256 | * latter case, the CPU will be awakened at the end of the current grace | |
257 | * period in order to process the remainder of its callbacks. | |
258 | * | |
259 | * These tracepoints take a string as argument: | |
260 | * | |
261 | * "No callbacks": Nothing to do, no callbacks on this CPU. | |
262 | * "In holdoff": Nothing to do, holding off after unsuccessful attempt. | |
263 | * "Begin holdoff": Attempt failed, don't retry until next jiffy. | |
264 | * "Dyntick with callbacks": Entering dyntick-idle despite callbacks. | |
265 | * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks. | |
266 | * "More callbacks": Still more callbacks, try again to clear them out. | |
267 | * "Callbacks drained": All callbacks processed, off to dyntick idle! | |
268 | * "Timer": Timer fired to cause CPU to continue processing callbacks. | |
269 | * "Demigrate": Timer fired on wrong CPU, woke up correct CPU. | |
270 | * "Cleanup after idle": Idle exited, timer canceled. | |
271 | */ | |
3bc29f0a | 272 | LTTNG_TRACEPOINT_EVENT(rcu_prep_idle, |
b87700e3 | 273 | |
01adf18e MD |
274 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
275 | TP_PROTO(const char *reason), | |
276 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 277 | TP_PROTO(char *reason), |
01adf18e | 278 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
279 | |
280 | TP_ARGS(reason), | |
281 | ||
f127e61e MD |
282 | TP_FIELDS( |
283 | ctf_string(reason, reason) | |
284 | ) | |
b87700e3 AG |
285 | ) |
286 | #endif | |
287 | ||
288 | /* | |
289 | * Tracepoint for the registration of a single RCU callback function. | |
290 | * The first argument is the type of RCU, the second argument is | |
291 | * a pointer to the RCU callback itself, the third element is the | |
292 | * number of lazy callbacks queued, and the fourth element is the | |
293 | * total number of callbacks queued. | |
294 | */ | |
3bc29f0a | 295 | LTTNG_TRACEPOINT_EVENT(rcu_callback, |
b87700e3 | 296 | |
01adf18e MD |
297 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
298 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy, | |
299 | long qlen), | |
300 | ||
301 | TP_ARGS(rcuname, rhp, qlen_lazy, qlen), | |
302 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
b87700e3 AG |
303 | TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy, |
304 | long qlen), | |
305 | ||
306 | TP_ARGS(rcuname, rhp, qlen_lazy, qlen), | |
307 | #else | |
308 | TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen), | |
309 | ||
310 | TP_ARGS(rcuname, rhp, qlen), | |
311 | #endif | |
312 | ||
f127e61e MD |
313 | TP_FIELDS( |
314 | ctf_string(rcuname, rcuname) | |
fa91fcac MD |
315 | ctf_integer_hex(void *, rhp, rhp) |
316 | ctf_integer_hex(void *, func, rhp->func) | |
b87700e3 | 317 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) |
f127e61e | 318 | ctf_integer(long, qlen_lazy, qlen_lazy) |
b87700e3 | 319 | #endif |
f127e61e MD |
320 | ctf_integer(long, qlen, qlen) |
321 | ) | |
b87700e3 AG |
322 | ) |
323 | ||
324 | /* | |
325 | * Tracepoint for the registration of a single RCU callback of the special | |
326 | * kfree() form. The first argument is the RCU type, the second argument | |
327 | * is a pointer to the RCU callback, the third argument is the offset | |
328 | * of the callback within the enclosing RCU-protected data structure, | |
329 | * the fourth argument is the number of lazy callbacks queued, and the | |
330 | * fifth argument is the total number of callbacks queued. | |
331 | */ | |
3bc29f0a | 332 | LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, |
b87700e3 | 333 | |
01adf18e MD |
334 | |
335 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
336 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset, | |
337 | long qlen_lazy, long qlen), | |
338 | ||
339 | TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), | |
340 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
b87700e3 AG |
341 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, |
342 | long qlen_lazy, long qlen), | |
343 | ||
344 | TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), | |
345 | #else | |
346 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, | |
347 | long qlen), | |
348 | ||
349 | TP_ARGS(rcuname, rhp, offset, qlen), | |
350 | #endif | |
351 | ||
f127e61e MD |
352 | TP_FIELDS( |
353 | ctf_string(rcuname, rcuname) | |
fa91fcac MD |
354 | ctf_integer_hex(void *, rhp, rhp) |
355 | ctf_integer_hex(unsigned long, offset, offset) | |
b87700e3 | 356 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) |
f127e61e | 357 | ctf_integer(long, qlen_lazy, qlen_lazy) |
b87700e3 | 358 | #endif |
f127e61e MD |
359 | ctf_integer(long, qlen, qlen) |
360 | ) | |
b87700e3 AG |
361 | ) |
362 | ||
363 | /* | |
364 | * Tracepoint for marking the beginning rcu_do_batch, performed to start | |
365 | * RCU callback invocation. The first argument is the RCU flavor, | |
366 | * the second is the number of lazy callbacks queued, the third is | |
367 | * the total number of callbacks queued, and the fourth argument is | |
368 | * the current RCU-callback batch limit. | |
369 | */ | |
3bc29f0a | 370 | LTTNG_TRACEPOINT_EVENT(rcu_batch_start, |
b87700e3 | 371 | |
01adf18e MD |
372 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
373 | TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit), | |
374 | ||
375 | TP_ARGS(rcuname, qlen_lazy, qlen, blimit), | |
376 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
4b4111c9 MD |
377 | TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit), |
378 | ||
379 | TP_ARGS(rcuname, qlen_lazy, qlen, blimit), | |
380 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
b87700e3 AG |
381 | TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit), |
382 | ||
383 | TP_ARGS(rcuname, qlen_lazy, qlen, blimit), | |
384 | #else | |
385 | TP_PROTO(char *rcuname, long qlen, int blimit), | |
386 | ||
387 | TP_ARGS(rcuname, qlen, blimit), | |
388 | #endif | |
389 | ||
f127e61e MD |
390 | TP_FIELDS( |
391 | ctf_string(rcuname, rcuname) | |
b87700e3 | 392 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) |
f127e61e | 393 | ctf_integer(long, qlen_lazy, qlen_lazy) |
b87700e3 | 394 | #endif |
f127e61e | 395 | ctf_integer(long, qlen, qlen) |
4b4111c9 | 396 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
f127e61e | 397 | ctf_integer(long, blimit, blimit) |
b87700e3 | 398 | #else |
f127e61e | 399 | ctf_integer(int, blimit, blimit) |
b87700e3 | 400 | #endif |
f127e61e | 401 | ) |
b87700e3 AG |
402 | ) |
403 | ||
404 | /* | |
405 | * Tracepoint for the invocation of a single RCU callback function. | |
406 | * The first argument is the type of RCU, and the second argument is | |
407 | * a pointer to the RCU callback itself. | |
408 | */ | |
3bc29f0a | 409 | LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback, |
b87700e3 | 410 | |
01adf18e MD |
411 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
412 | TP_PROTO(const char *rcuname, struct rcu_head *rhp), | |
413 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 414 | TP_PROTO(char *rcuname, struct rcu_head *rhp), |
01adf18e | 415 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
416 | |
417 | TP_ARGS(rcuname, rhp), | |
418 | ||
f127e61e MD |
419 | TP_FIELDS( |
420 | ctf_string(rcuname, rcuname) | |
fa91fcac MD |
421 | ctf_integer_hex(void *, rhp, rhp) |
422 | ctf_integer_hex(void *, func, rhp->func) | |
f127e61e | 423 | ) |
b87700e3 AG |
424 | ) |
425 | ||
426 | /* | |
427 | * Tracepoint for the invocation of a single RCU callback of the special | |
428 | * kfree() form. The first argument is the RCU flavor, the second | |
429 | * argument is a pointer to the RCU callback, and the third argument | |
430 | * is the offset of the callback within the enclosing RCU-protected | |
431 | * data structure. | |
432 | */ | |
3bc29f0a | 433 | LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback, |
b87700e3 | 434 | |
01adf18e MD |
435 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
436 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset), | |
437 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 438 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset), |
01adf18e | 439 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
440 | |
441 | TP_ARGS(rcuname, rhp, offset), | |
442 | ||
f127e61e MD |
443 | TP_FIELDS( |
444 | ctf_string(rcuname, rcuname) | |
fa91fcac | 445 | ctf_integer_hex(void *, rhp, rhp) |
f127e61e MD |
446 | ctf_integer(unsigned long, offset, offset) |
447 | ) | |
b87700e3 AG |
448 | ) |
449 | ||
450 | /* | |
451 | * Tracepoint for exiting rcu_do_batch after RCU callbacks have been | |
452 | * invoked. The first argument is the name of the RCU flavor, | |
453 | * the second argument is number of callbacks actually invoked, | |
454 | * the third argument (cb) is whether or not any of the callbacks that | |
455 | * were ready to invoke at the beginning of this batch are still | |
456 | * queued, the fourth argument (nr) is the return value of need_resched(), | |
457 | * the fifth argument (iit) is 1 if the current task is the idle task, | |
458 | * and the sixth argument (risk) is the return value from | |
459 | * rcu_is_callbacks_kthread(). | |
460 | */ | |
3bc29f0a | 461 | LTTNG_TRACEPOINT_EVENT(rcu_batch_end, |
b87700e3 | 462 | |
01adf18e MD |
463 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) |
464 | TP_PROTO(const char *rcuname, int callbacks_invoked, | |
465 | char cb, char nr, char iit, char risk), | |
466 | ||
467 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), | |
468 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
469 | TP_PROTO(const char *rcuname, int callbacks_invoked, | |
470 | bool cb, bool nr, bool iit, bool risk), | |
471 | ||
472 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), | |
473 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
b87700e3 AG |
474 | TP_PROTO(char *rcuname, int callbacks_invoked, |
475 | bool cb, bool nr, bool iit, bool risk), | |
476 | ||
477 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), | |
478 | #else | |
479 | TP_PROTO(char *rcuname, int callbacks_invoked), | |
480 | ||
481 | TP_ARGS(rcuname, callbacks_invoked), | |
482 | #endif | |
483 | ||
f127e61e MD |
484 | TP_FIELDS( |
485 | ctf_string(rcuname, rcuname) | |
486 | ctf_integer(int, callbacks_invoked, callbacks_invoked) | |
01adf18e | 487 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) |
f127e61e MD |
488 | ctf_integer(char, cb, cb) |
489 | ctf_integer(char, nr, nr) | |
490 | ctf_integer(char, iit, iit) | |
491 | ctf_integer(char, risk, risk) | |
01adf18e | 492 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) |
f127e61e MD |
493 | ctf_integer(bool, cb, cb) |
494 | ctf_integer(bool, nr, nr) | |
495 | ctf_integer(bool, iit, iit) | |
496 | ctf_integer(bool, risk, risk) | |
b87700e3 | 497 | #endif |
f127e61e | 498 | ) |
b87700e3 AG |
499 | ) |
500 | ||
501 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
502 | /* | |
503 | * Tracepoint for rcutorture readers. The first argument is the name | |
504 | * of the RCU flavor from rcutorture's viewpoint and the second argument | |
505 | * is the callback address. | |
506 | */ | |
3bc29f0a | 507 | LTTNG_TRACEPOINT_EVENT(rcu_torture_read, |
b87700e3 | 508 | |
01adf18e MD |
509 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
510 | TP_PROTO(const char *rcutorturename, struct rcu_head *rhp, | |
511 | unsigned long secs, unsigned long c_old, unsigned long c), | |
512 | ||
513 | TP_ARGS(rcutorturename, rhp, secs, c_old, c), | |
514 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
a828b9d5 MD |
515 | TP_PROTO(char *rcutorturename, struct rcu_head *rhp, |
516 | unsigned long secs, unsigned long c_old, unsigned long c), | |
517 | ||
518 | TP_ARGS(rcutorturename, rhp, secs, c_old, c), | |
519 | #else | |
b87700e3 AG |
520 | TP_PROTO(char *rcutorturename, struct rcu_head *rhp), |
521 | ||
522 | TP_ARGS(rcutorturename, rhp), | |
a828b9d5 | 523 | #endif |
b87700e3 | 524 | |
f127e61e MD |
525 | TP_FIELDS( |
526 | ctf_string(rcutorturename, rcutorturename) | |
fa91fcac | 527 | ctf_integer_hex(struct rcu_head *, rhp, rhp) |
a828b9d5 | 528 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
f127e61e MD |
529 | ctf_integer(unsigned long, secs, secs) |
530 | ctf_integer(unsigned long, c_old, c_old) | |
531 | ctf_integer(unsigned long, c, c) | |
a828b9d5 | 532 | #endif |
f127e61e | 533 | ) |
b87700e3 AG |
534 | ) |
535 | #endif | |
536 | ||
537 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) | |
538 | /* | |
539 | * Tracepoint for _rcu_barrier() execution. The string "s" describes | |
540 | * the _rcu_barrier phase: | |
541 | * "Begin": rcu_barrier_callback() started. | |
542 | * "Check": rcu_barrier_callback() checking for piggybacking. | |
543 | * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit. | |
544 | * "Inc1": rcu_barrier_callback() piggyback check counter incremented. | |
545 | * "Offline": rcu_barrier_callback() found offline CPU | |
546 | * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks. | |
547 | * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks. | |
548 | * "IRQ": An rcu_barrier_callback() callback posted on remote CPU. | |
549 | * "CB": An rcu_barrier_callback() invoked a callback, not the last. | |
550 | * "LastCB": An rcu_barrier_callback() invoked the last callback. | |
551 | * "Inc2": rcu_barrier_callback() piggyback check counter incremented. | |
552 | * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument | |
553 | * is the count of remaining callbacks, and "done" is the piggybacking count. | |
554 | */ | |
3bc29f0a | 555 | LTTNG_TRACEPOINT_EVENT(rcu_barrier, |
b87700e3 | 556 | |
01adf18e MD |
557 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
558 | TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done), | |
559 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 560 | TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done), |
01adf18e | 561 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
562 | |
563 | TP_ARGS(rcuname, s, cpu, cnt, done), | |
564 | ||
f127e61e MD |
565 | TP_FIELDS( |
566 | ctf_string(rcuname, rcuname) | |
567 | ctf_string(s, s) | |
568 | ctf_integer(int, cpu, cpu) | |
569 | ctf_integer(int, cnt, cnt) | |
570 | ctf_integer(unsigned long, done, done) | |
571 | ) | |
b87700e3 AG |
572 | ) |
573 | #endif | |
574 | ||
575 | #else /* #ifdef CONFIG_RCU_TRACE */ | |
576 | ||
577 | #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0) | |
578 | #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \ | |
579 | qsmask) do { } while (0) | |
580 | #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0) | |
581 | #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0) | |
582 | #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \ | |
583 | grplo, grphi, gp_tasks) do { } \ | |
584 | while (0) | |
585 | #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0) | |
586 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
587 | #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0) | |
588 | #else | |
589 | #define trace_rcu_dyntick(polarity) do { } while (0) | |
590 | #endif | |
591 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
592 | #define trace_rcu_prep_idle(reason) do { } while (0) | |
593 | #endif | |
594 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
595 | #define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0) | |
596 | #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \ | |
597 | do { } while (0) | |
598 | #define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \ | |
599 | do { } while (0) | |
600 | #else | |
601 | #define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0) | |
602 | #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0) | |
603 | #define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0) | |
604 | #endif | |
605 | #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0) | |
606 | #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0) | |
607 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
608 | #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \ | |
609 | do { } while (0) | |
610 | #else | |
611 | #define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0) | |
612 | #endif | |
a828b9d5 MD |
613 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
614 | #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ | |
615 | do { } while (0) | |
616 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
b87700e3 AG |
617 | #define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0) |
618 | #endif | |
619 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) | |
620 | #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0) | |
621 | #endif | |
622 | #endif /* #else #ifdef CONFIG_RCU_TRACE */ | |
623 | ||
3bc29f0a | 624 | #endif /* LTTNG_TRACE_RCU_H */ |
b87700e3 AG |
625 | |
626 | /* This part must be outside protection */ | |
6ec43db8 | 627 | #include <probes/define_trace.h> |