fix: writeback: Fix sync livelock due to b_dirty_time processing (v5.9)
[lttng-modules.git] / instrumentation / events / lttng-module / rcu.h
CommitLineData
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 21LTTNG_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 */
e0a2e22c
MJ
52#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
53 LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0))
ae8ff4cd
MJ
54LTTNG_TRACEPOINT_EVENT(rcu_grace_period,
55
56 TP_PROTO(const char *rcuname, unsigned long gp_seq, const char *gpevent),
57
58 TP_ARGS(rcuname, gp_seq, gpevent),
59
60 TP_FIELDS(
61 ctf_string(rcuname, rcuname)
62 ctf_integer(unsigned long, gp_seq, gp_seq)
63 ctf_string(gpevent, gpevent)
64 )
65)
66#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
3bc29f0a 67LTTNG_TRACEPOINT_EVENT(rcu_grace_period,
b87700e3 68
01adf18e 69 TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent),
ae8ff4cd
MJ
70
71 TP_ARGS(rcuname, gpnum, gpevent),
72
73 TP_FIELDS(
74 ctf_string(rcuname, rcuname)
75 ctf_integer(unsigned long, gpnum, gpnum)
76 ctf_string(gpevent, gpevent)
77 )
78)
79#else
80LTTNG_TRACEPOINT_EVENT(rcu_grace_period,
81
b87700e3
AG
82 TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent),
83
84 TP_ARGS(rcuname, gpnum, gpevent),
85
f127e61e
MD
86 TP_FIELDS(
87 ctf_string(rcuname, rcuname)
88 ctf_integer(unsigned long, gpnum, gpnum)
89 ctf_string(gpevent, gpevent)
90 )
b87700e3 91)
ae8ff4cd 92#endif
b87700e3
AG
93
94/*
95 * Tracepoint for grace-period-initialization events. These are
96 * distinguished by the type of RCU, the new grace-period number, the
97 * rcu_node structure level, the starting and ending CPU covered by the
98 * rcu_node structure, and the mask of CPUs that will be waited for.
99 * All but the type of RCU are extracted from the rcu_node structure.
100 */
e0a2e22c
MJ
101#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
102 LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0))
ae8ff4cd
MJ
103LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init,
104
105 TP_PROTO(const char *rcuname, unsigned long gp_seq, u8 level,
106 int grplo, int grphi, unsigned long qsmask),
107
108 TP_ARGS(rcuname, gp_seq, level, grplo, grphi, qsmask),
109
110 TP_FIELDS(
111 ctf_string(rcuname, rcuname)
112 ctf_integer(unsigned long, gp_seq, gp_seq)
113 ctf_integer(u8, level, level)
114 ctf_integer(int, grplo, grplo)
115 ctf_integer(int, grphi, grphi)
116 ctf_integer(unsigned long, qsmask, qsmask)
117 )
118)
119#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
3bc29f0a 120LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init,
b87700e3 121
01adf18e
MD
122 TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level,
123 int grplo, int grphi, unsigned long qsmask),
ae8ff4cd
MJ
124
125 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
126
127 TP_FIELDS(
128 ctf_string(rcuname, rcuname)
129 ctf_integer(unsigned long, gpnum, gpnum)
130 ctf_integer(u8, level, level)
131 ctf_integer(int, grplo, grplo)
132 ctf_integer(int, grphi, grphi)
133 ctf_integer(unsigned long, qsmask, qsmask)
134 )
135)
136#else
137LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init,
138
b87700e3
AG
139 TP_PROTO(char *rcuname, unsigned long gpnum, u8 level,
140 int grplo, int grphi, unsigned long qsmask),
141
142 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
143
f127e61e
MD
144 TP_FIELDS(
145 ctf_string(rcuname, rcuname)
146 ctf_integer(unsigned long, gpnum, gpnum)
147 ctf_integer(u8, level, level)
148 ctf_integer(int, grplo, grplo)
149 ctf_integer(int, grphi, grphi)
150 ctf_integer(unsigned long, qsmask, qsmask)
151 )
b87700e3 152)
ae8ff4cd 153#endif
b87700e3
AG
154
155/*
156 * Tracepoint for tasks blocking within preemptible-RCU read-side
157 * critical sections. Track the type of RCU (which one day might
158 * include SRCU), the grace-period number that the task is blocking
159 * (the current or the next), and the task's PID.
160 */
e0a2e22c
MJ
161#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
162 LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0))
ae8ff4cd
MJ
163LTTNG_TRACEPOINT_EVENT(rcu_preempt_task,
164
165 TP_PROTO(const char *rcuname, int pid, unsigned long gp_seq),
166
167 TP_ARGS(rcuname, pid, gp_seq),
168
169 TP_FIELDS(
170 ctf_string(rcuname, rcuname)
171 ctf_integer(unsigned long, gp_seq, gp_seq)
172 ctf_integer(int, pid, pid)
173 )
174)
175#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
3bc29f0a 176LTTNG_TRACEPOINT_EVENT(rcu_preempt_task,
b87700e3 177
01adf18e 178 TP_PROTO(const char *rcuname, int pid, unsigned long gpnum),
ae8ff4cd
MJ
179
180 TP_ARGS(rcuname, pid, gpnum),
181
182 TP_FIELDS(
183 ctf_string(rcuname, rcuname)
184 ctf_integer(unsigned long, gpnum, gpnum)
185 ctf_integer(int, pid, pid)
186 )
187)
188#else
189LTTNG_TRACEPOINT_EVENT(rcu_preempt_task,
190
b87700e3
AG
191 TP_PROTO(char *rcuname, int pid, unsigned long gpnum),
192
193 TP_ARGS(rcuname, pid, gpnum),
194
f127e61e
MD
195 TP_FIELDS(
196 ctf_string(rcuname, rcuname)
197 ctf_integer(unsigned long, gpnum, gpnum)
198 ctf_integer(int, pid, pid)
199 )
b87700e3 200)
ae8ff4cd 201#endif
b87700e3
AG
202
203/*
204 * Tracepoint for tasks that blocked within a given preemptible-RCU
205 * read-side critical section exiting that critical section. Track the
206 * type of RCU (which one day might include SRCU) and the task's PID.
207 */
e0a2e22c
MJ
208#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
209 LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0))
ae8ff4cd
MJ
210LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task,
211
212 TP_PROTO(const char *rcuname, unsigned long gp_seq, int pid),
213
214 TP_ARGS(rcuname, gp_seq, pid),
215
216 TP_FIELDS(
217 ctf_string(rcuname, rcuname)
218 ctf_integer(unsigned long, gp_seq, gp_seq)
219 ctf_integer(int, pid, pid)
220 )
221)
222#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
3bc29f0a 223LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task,
b87700e3 224
01adf18e 225 TP_PROTO(const char *rcuname, unsigned long gpnum, int pid),
ae8ff4cd
MJ
226
227 TP_ARGS(rcuname, gpnum, pid),
228
229 TP_FIELDS(
230 ctf_string(rcuname, rcuname)
231 ctf_integer(unsigned long, gpnum, gpnum)
232 ctf_integer(int, pid, pid)
233 )
234)
235#else
236LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task,
237
b87700e3
AG
238 TP_PROTO(char *rcuname, unsigned long gpnum, int pid),
239
240 TP_ARGS(rcuname, gpnum, pid),
241
f127e61e
MD
242 TP_FIELDS(
243 ctf_string(rcuname, rcuname)
244 ctf_integer(unsigned long, gpnum, gpnum)
245 ctf_integer(int, pid, pid)
246 )
b87700e3 247)
ae8ff4cd 248#endif
b87700e3
AG
249
250/*
251 * Tracepoint for quiescent-state-reporting events. These are
252 * distinguished by the type of RCU, the grace-period number, the
253 * mask of quiescent lower-level entities, the rcu_node structure level,
254 * the starting and ending CPU covered by the rcu_node structure, and
255 * whether there are any blocked tasks blocking the current grace period.
256 * All but the type of RCU are extracted from the rcu_node structure.
257 */
e0a2e22c
MJ
258#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
259 LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0))
ae8ff4cd
MJ
260LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report,
261
262 TP_PROTO(const char *rcuname, unsigned long gp_seq,
263 unsigned long mask, unsigned long qsmask,
264 u8 level, int grplo, int grphi, int gp_tasks),
265
266 TP_ARGS(rcuname, gp_seq, mask, qsmask, level, grplo, grphi, gp_tasks),
267
268 TP_FIELDS(
269 ctf_string(rcuname, rcuname)
270 ctf_integer(unsigned long, gp_seq, gp_seq)
271 ctf_integer(unsigned long, mask, mask)
272 ctf_integer(unsigned long, qsmask, qsmask)
273 ctf_integer(u8, level, level)
274 ctf_integer(int, grplo, grplo)
275 ctf_integer(int, grphi, grphi)
276 ctf_integer(u8, gp_tasks, gp_tasks)
277 )
278)
279#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
3bc29f0a 280LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report,
b87700e3 281
01adf18e
MD
282 TP_PROTO(const char *rcuname, unsigned long gpnum,
283 unsigned long mask, unsigned long qsmask,
284 u8 level, int grplo, int grphi, int gp_tasks),
ae8ff4cd
MJ
285
286 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
287
288 TP_FIELDS(
289 ctf_string(rcuname, rcuname)
290 ctf_integer(unsigned long, gpnum, gpnum)
291 ctf_integer(unsigned long, mask, mask)
292 ctf_integer(unsigned long, qsmask, qsmask)
293 ctf_integer(u8, level, level)
294 ctf_integer(int, grplo, grplo)
295 ctf_integer(int, grphi, grphi)
296 ctf_integer(u8, gp_tasks, gp_tasks)
297 )
298)
299#else
300LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report,
301
b87700e3
AG
302 TP_PROTO(char *rcuname, unsigned long gpnum,
303 unsigned long mask, unsigned long qsmask,
304 u8 level, int grplo, int grphi, int gp_tasks),
305
306 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
307
f127e61e
MD
308 TP_FIELDS(
309 ctf_string(rcuname, rcuname)
310 ctf_integer(unsigned long, gpnum, gpnum)
311 ctf_integer(unsigned long, mask, mask)
312 ctf_integer(unsigned long, qsmask, qsmask)
313 ctf_integer(u8, level, level)
314 ctf_integer(int, grplo, grplo)
315 ctf_integer(int, grphi, grphi)
316 ctf_integer(u8, gp_tasks, gp_tasks)
317 )
b87700e3 318)
ae8ff4cd 319#endif
b87700e3
AG
320
321/*
322 * Tracepoint for quiescent states detected by force_quiescent_state().
323 * These trace events include the type of RCU, the grace-period number
324 * that was blocked by the CPU, the CPU itself, and the type of quiescent
325 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
326 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
327 * too long.
328 */
e0a2e22c
MJ
329#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
330 LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0))
ae8ff4cd
MJ
331LTTNG_TRACEPOINT_EVENT(rcu_fqs,
332
333 TP_PROTO(const char *rcuname, unsigned long gp_seq, int cpu, const char *qsevent),
334
335 TP_ARGS(rcuname, gp_seq, cpu, qsevent),
336
337 TP_FIELDS(
338 ctf_integer(unsigned long, gp_seq, gp_seq)
339 ctf_integer(int, cpu, cpu)
340 ctf_string(rcuname, rcuname)
341 ctf_string(qsevent, qsevent)
342 )
343)
344#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
3bc29f0a 345LTTNG_TRACEPOINT_EVENT(rcu_fqs,
b87700e3 346
01adf18e 347 TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent),
ae8ff4cd
MJ
348
349 TP_ARGS(rcuname, gpnum, cpu, qsevent),
350
351 TP_FIELDS(
352 ctf_integer(unsigned long, gpnum, gpnum)
353 ctf_integer(int, cpu, cpu)
354 ctf_string(rcuname, rcuname)
355 ctf_string(qsevent, qsevent)
356 )
357)
358#else
359LTTNG_TRACEPOINT_EVENT(rcu_fqs,
360
b87700e3
AG
361 TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent),
362
363 TP_ARGS(rcuname, gpnum, cpu, qsevent),
364
f127e61e
MD
365 TP_FIELDS(
366 ctf_integer(unsigned long, gpnum, gpnum)
367 ctf_integer(int, cpu, cpu)
368 ctf_string(rcuname, rcuname)
369 ctf_string(qsevent, qsevent)
370 )
b87700e3 371)
ae8ff4cd 372#endif
b87700e3 373
12318fb8
MD
374#endif /*
375 * #if defined(CONFIG_TREE_RCU)
376 * || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
377 * && defined(CONFIG_PREEMPT_RCU))
378 * || defined(CONFIG_TREE_PREEMPT_RCU)
379 */
b87700e3
AG
380
381/*
382 * Tracepoint for dyntick-idle entry/exit events. These take a string
383 * as argument: "Start" for entering dyntick-idle mode, "End" for
384 * leaving it, "--=" for events moving towards idle, and "++=" for events
385 * moving away from idle. "Error on entry: not idle task" and "Error on
386 * exit: not idle task" indicate that a non-idle task is erroneously
387 * toying with the idle loop.
388 *
389 * These events also take a pair of numbers, which indicate the nesting
390 * depth before and after the event of interest. Note that task-related
391 * events use the upper bits of each number, while interrupt-related
392 * events use the lower bits.
393 */
dab37f95
MD
394#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) \
395 || LTTNG_KERNEL_RANGE(5,5,6, 5,6,0) \
396 || LTTNG_KERNEL_RANGE(5,4,22, 5,5,0)
2cdc2db7
MJ
397LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
398
399 TP_PROTO(const char *polarity, long oldnesting, long newnesting, int dynticks),
400
401 TP_ARGS(polarity, oldnesting, newnesting, dynticks),
402
403 TP_FIELDS(
404 ctf_string(polarity, polarity)
405 ctf_integer(long, oldnesting, oldnesting)
406 ctf_integer(long, newnesting, newnesting)
407 ctf_integer(int, dynticks, dynticks)
408 )
409)
410
411#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
3bc29f0a 412LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
b87700e3 413
8c7865d5
MJ
414 TP_PROTO(const char *polarity, long oldnesting, long newnesting, atomic_t dynticks),
415
416 TP_ARGS(polarity, oldnesting, newnesting, dynticks),
417
418 TP_FIELDS(
419 ctf_string(polarity, polarity)
420 ctf_integer(long, oldnesting, oldnesting)
421 ctf_integer(long, newnesting, newnesting)
422 ctf_integer(int, dynticks, atomic_read(&dynticks))
423 )
424)
425
426#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
427LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
01adf18e 428
01adf18e
MD
429 TP_PROTO(const char *polarity, long long oldnesting, long long newnesting),
430
431 TP_ARGS(polarity, oldnesting, newnesting),
8c7865d5
MJ
432
433 TP_FIELDS(
434 ctf_string(polarity, polarity)
435 ctf_integer(long long, oldnesting, oldnesting)
436 ctf_integer(long long, newnesting, newnesting)
437 )
438)
01adf18e 439#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
8c7865d5
MJ
440LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
441
b87700e3
AG
442 TP_PROTO(char *polarity, long long oldnesting, long long newnesting),
443
444 TP_ARGS(polarity, oldnesting, newnesting),
8c7865d5
MJ
445
446 TP_FIELDS(
447 ctf_string(polarity, polarity)
448 ctf_integer(long long, oldnesting, oldnesting)
449 ctf_integer(long long, newnesting, newnesting)
450 )
451)
b87700e3 452#else
8c7865d5
MJ
453LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
454
b87700e3
AG
455 TP_PROTO(char *polarity),
456
457 TP_ARGS(polarity),
b87700e3 458
f127e61e
MD
459 TP_FIELDS(
460 ctf_string(polarity, polarity)
f127e61e 461 )
b87700e3 462)
8c7865d5
MJ
463#endif
464
b87700e3
AG
465
466#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
467/*
468 * Tracepoint for RCU preparation for idle, the goal being to get RCU
469 * processing done so that the current CPU can shut off its scheduling
470 * clock and enter dyntick-idle mode. One way to accomplish this is
471 * to drain all RCU callbacks from this CPU, and the other is to have
472 * done everything RCU requires for the current grace period. In this
473 * latter case, the CPU will be awakened at the end of the current grace
474 * period in order to process the remainder of its callbacks.
475 *
476 * These tracepoints take a string as argument:
477 *
478 * "No callbacks": Nothing to do, no callbacks on this CPU.
479 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
480 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
481 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
482 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
483 * "More callbacks": Still more callbacks, try again to clear them out.
484 * "Callbacks drained": All callbacks processed, off to dyntick idle!
485 * "Timer": Timer fired to cause CPU to continue processing callbacks.
486 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
487 * "Cleanup after idle": Idle exited, timer canceled.
488 */
3bc29f0a 489LTTNG_TRACEPOINT_EVENT(rcu_prep_idle,
b87700e3 490
01adf18e
MD
491#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
492 TP_PROTO(const char *reason),
493#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
b87700e3 494 TP_PROTO(char *reason),
01adf18e 495#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
b87700e3
AG
496
497 TP_ARGS(reason),
498
f127e61e
MD
499 TP_FIELDS(
500 ctf_string(reason, reason)
501 )
b87700e3
AG
502)
503#endif
504
505/*
506 * Tracepoint for the registration of a single RCU callback function.
507 * The first argument is the type of RCU, the second argument is
508 * a pointer to the RCU callback itself, the third element is the
509 * number of lazy callbacks queued, and the fourth element is the
510 * total number of callbacks queued.
511 */
9f48a814
MJ
512#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
513LTTNG_TRACEPOINT_EVENT(rcu_callback,
514
515 TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen),
516
517 TP_ARGS(rcuname, rhp, qlen),
518
519 TP_FIELDS(
520 ctf_string(rcuname, rcuname)
521 ctf_integer_hex(void *, rhp, rhp)
522 ctf_integer_hex(void *, func, rhp->func)
523 ctf_integer(long, qlen, qlen)
524 )
525)
526#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
3bc29f0a 527LTTNG_TRACEPOINT_EVENT(rcu_callback,
b87700e3 528
01adf18e
MD
529 TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
530 long qlen),
531
532 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
9f48a814
MJ
533
534 TP_FIELDS(
535 ctf_string(rcuname, rcuname)
536 ctf_integer_hex(void *, rhp, rhp)
537 ctf_integer_hex(void *, func, rhp->func)
538 ctf_integer(long, qlen_lazy, qlen_lazy)
539 ctf_integer(long, qlen, qlen)
540 )
541)
01adf18e 542#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
9f48a814
MJ
543LTTNG_TRACEPOINT_EVENT(rcu_callback,
544
b87700e3
AG
545 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy,
546 long qlen),
547
548 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
9f48a814
MJ
549
550 TP_FIELDS(
551 ctf_string(rcuname, rcuname)
552 ctf_integer_hex(void *, rhp, rhp)
553 ctf_integer_hex(void *, func, rhp->func)
554 ctf_integer(long, qlen_lazy, qlen_lazy)
555 ctf_integer(long, qlen, qlen)
556 )
557)
b87700e3 558#else
9f48a814
MJ
559LTTNG_TRACEPOINT_EVENT(rcu_callback,
560
b87700e3
AG
561 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen),
562
563 TP_ARGS(rcuname, rhp, qlen),
b87700e3 564
f127e61e
MD
565 TP_FIELDS(
566 ctf_string(rcuname, rcuname)
fa91fcac
MD
567 ctf_integer_hex(void *, rhp, rhp)
568 ctf_integer_hex(void *, func, rhp->func)
f127e61e
MD
569 ctf_integer(long, qlen, qlen)
570 )
b87700e3 571)
9f48a814
MJ
572#endif
573
b87700e3
AG
574
575/*
576 * Tracepoint for the registration of a single RCU callback of the special
577 * kfree() form. The first argument is the RCU type, the second argument
578 * is a pointer to the RCU callback, the third argument is the offset
579 * of the callback within the enclosing RCU-protected data structure,
580 * the fourth argument is the number of lazy callbacks queued, and the
581 * fifth argument is the total number of callbacks queued.
582 */
9f48a814 583#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
3bc29f0a 584LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback,
b87700e3 585
9f48a814
MJ
586 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
587 long qlen),
588
589 TP_ARGS(rcuname, rhp, offset, qlen),
590
591 TP_FIELDS(
592 ctf_string(rcuname, rcuname)
593 ctf_integer_hex(void *, rhp, rhp)
594 ctf_integer_hex(unsigned long, offset, offset)
595 ctf_integer(long, qlen, qlen)
596 )
597)
598#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
599LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback,
01adf18e 600
01adf18e
MD
601 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
602 long qlen_lazy, long qlen),
603
604 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
9f48a814
MJ
605
606 TP_FIELDS(
607 ctf_string(rcuname, rcuname)
608 ctf_integer_hex(void *, rhp, rhp)
609 ctf_integer_hex(unsigned long, offset, offset)
610 ctf_integer(long, qlen_lazy, qlen_lazy)
611 ctf_integer(long, qlen, qlen)
612 )
613)
01adf18e 614#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
9f48a814
MJ
615LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback,
616
b87700e3
AG
617 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
618 long qlen_lazy, long qlen),
619
620 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
9f48a814
MJ
621
622 TP_FIELDS(
623 ctf_string(rcuname, rcuname)
624 ctf_integer_hex(void *, rhp, rhp)
625 ctf_integer_hex(unsigned long, offset, offset)
626 ctf_integer(long, qlen_lazy, qlen_lazy)
627 ctf_integer(long, qlen, qlen)
628 )
629)
b87700e3 630#else
9f48a814
MJ
631LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback,
632
b87700e3
AG
633 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
634 long qlen),
635
636 TP_ARGS(rcuname, rhp, offset, qlen),
b87700e3 637
f127e61e
MD
638 TP_FIELDS(
639 ctf_string(rcuname, rcuname)
fa91fcac
MD
640 ctf_integer_hex(void *, rhp, rhp)
641 ctf_integer_hex(unsigned long, offset, offset)
f127e61e
MD
642 ctf_integer(long, qlen, qlen)
643 )
b87700e3 644)
9f48a814 645#endif
b87700e3
AG
646
647/*
648 * Tracepoint for marking the beginning rcu_do_batch, performed to start
649 * RCU callback invocation. The first argument is the RCU flavor,
650 * the second is the number of lazy callbacks queued, the third is
651 * the total number of callbacks queued, and the fourth argument is
652 * the current RCU-callback batch limit.
653 */
9f48a814
MJ
654#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
655LTTNG_TRACEPOINT_EVENT(rcu_batch_start,
656
657 TP_PROTO(const char *rcuname, long qlen, long blimit),
658
659 TP_ARGS(rcuname, qlen, blimit),
660
661 TP_FIELDS(
662 ctf_string(rcuname, rcuname)
663 ctf_integer(long, qlen, qlen)
664 ctf_integer(long, blimit, blimit)
665 )
666)
667#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
3bc29f0a 668LTTNG_TRACEPOINT_EVENT(rcu_batch_start,
b87700e3 669
01adf18e
MD
670 TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
671
672 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
9f48a814
MJ
673
674 TP_FIELDS(
675 ctf_string(rcuname, rcuname)
676 ctf_integer(long, qlen_lazy, qlen_lazy)
677 ctf_integer(long, qlen, qlen)
678 ctf_integer(long, blimit, blimit)
679 )
680)
01adf18e 681#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
9f48a814
MJ
682LTTNG_TRACEPOINT_EVENT(rcu_batch_start,
683
4b4111c9
MD
684 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit),
685
686 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
9f48a814
MJ
687
688 TP_FIELDS(
689 ctf_string(rcuname, rcuname)
690 ctf_integer(long, qlen_lazy, qlen_lazy)
691 ctf_integer(long, qlen, qlen)
692 ctf_integer(long, blimit, blimit)
693 )
694)
4b4111c9 695#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
9f48a814
MJ
696LTTNG_TRACEPOINT_EVENT(rcu_batch_start,
697
b87700e3
AG
698 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit),
699
700 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
9f48a814
MJ
701
702 TP_FIELDS(
703 ctf_string(rcuname, rcuname)
704 ctf_integer(long, qlen_lazy, qlen_lazy)
705 ctf_integer(long, qlen, qlen)
706 ctf_integer(int, blimit, blimit)
707 )
708)
b87700e3 709#else
9f48a814
MJ
710LTTNG_TRACEPOINT_EVENT(rcu_batch_start,
711
b87700e3
AG
712 TP_PROTO(char *rcuname, long qlen, int blimit),
713
714 TP_ARGS(rcuname, qlen, blimit),
b87700e3 715
f127e61e
MD
716 TP_FIELDS(
717 ctf_string(rcuname, rcuname)
f127e61e 718 ctf_integer(long, qlen, qlen)
f127e61e 719 ctf_integer(int, blimit, blimit)
f127e61e 720 )
b87700e3 721)
9f48a814 722#endif
b87700e3
AG
723
724/*
725 * Tracepoint for the invocation of a single RCU callback function.
726 * The first argument is the type of RCU, and the second argument is
727 * a pointer to the RCU callback itself.
728 */
3bc29f0a 729LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback,
b87700e3 730
01adf18e
MD
731#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
732 TP_PROTO(const char *rcuname, struct rcu_head *rhp),
733#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
b87700e3 734 TP_PROTO(char *rcuname, struct rcu_head *rhp),
01adf18e 735#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
b87700e3
AG
736
737 TP_ARGS(rcuname, rhp),
738
f127e61e
MD
739 TP_FIELDS(
740 ctf_string(rcuname, rcuname)
fa91fcac
MD
741 ctf_integer_hex(void *, rhp, rhp)
742 ctf_integer_hex(void *, func, rhp->func)
f127e61e 743 )
b87700e3
AG
744)
745
746/*
747 * Tracepoint for the invocation of a single RCU callback of the special
748 * kfree() form. The first argument is the RCU flavor, the second
749 * argument is a pointer to the RCU callback, and the third argument
750 * is the offset of the callback within the enclosing RCU-protected
751 * data structure.
752 */
3bc29f0a 753LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback,
b87700e3 754
01adf18e
MD
755#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
756 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
757#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
b87700e3 758 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset),
01adf18e 759#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
b87700e3
AG
760
761 TP_ARGS(rcuname, rhp, offset),
762
f127e61e
MD
763 TP_FIELDS(
764 ctf_string(rcuname, rcuname)
fa91fcac 765 ctf_integer_hex(void *, rhp, rhp)
f127e61e
MD
766 ctf_integer(unsigned long, offset, offset)
767 )
b87700e3
AG
768)
769
770/*
771 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
772 * invoked. The first argument is the name of the RCU flavor,
773 * the second argument is number of callbacks actually invoked,
774 * the third argument (cb) is whether or not any of the callbacks that
775 * were ready to invoke at the beginning of this batch are still
776 * queued, the fourth argument (nr) is the return value of need_resched(),
777 * the fifth argument (iit) is 1 if the current task is the idle task,
778 * and the sixth argument (risk) is the return value from
779 * rcu_is_callbacks_kthread().
780 */
3bc29f0a 781LTTNG_TRACEPOINT_EVENT(rcu_batch_end,
b87700e3 782
01adf18e
MD
783#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
784 TP_PROTO(const char *rcuname, int callbacks_invoked,
785 char cb, char nr, char iit, char risk),
786
787 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
788#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
789 TP_PROTO(const char *rcuname, int callbacks_invoked,
790 bool cb, bool nr, bool iit, bool risk),
791
792 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
793#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
b87700e3
AG
794 TP_PROTO(char *rcuname, int callbacks_invoked,
795 bool cb, bool nr, bool iit, bool risk),
796
797 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
798#else
799 TP_PROTO(char *rcuname, int callbacks_invoked),
800
801 TP_ARGS(rcuname, callbacks_invoked),
802#endif
803
f127e61e
MD
804 TP_FIELDS(
805 ctf_string(rcuname, rcuname)
806 ctf_integer(int, callbacks_invoked, callbacks_invoked)
01adf18e 807#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
f127e61e
MD
808 ctf_integer(char, cb, cb)
809 ctf_integer(char, nr, nr)
810 ctf_integer(char, iit, iit)
811 ctf_integer(char, risk, risk)
01adf18e 812#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
f127e61e
MD
813 ctf_integer(bool, cb, cb)
814 ctf_integer(bool, nr, nr)
815 ctf_integer(bool, iit, iit)
816 ctf_integer(bool, risk, risk)
b87700e3 817#endif
f127e61e 818 )
b87700e3
AG
819)
820
821#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
822/*
823 * Tracepoint for rcutorture readers. The first argument is the name
824 * of the RCU flavor from rcutorture's viewpoint and the second argument
825 * is the callback address.
826 */
3bc29f0a 827LTTNG_TRACEPOINT_EVENT(rcu_torture_read,
b87700e3 828
01adf18e
MD
829#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
830 TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
831 unsigned long secs, unsigned long c_old, unsigned long c),
832
833 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
834#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
a828b9d5
MD
835 TP_PROTO(char *rcutorturename, struct rcu_head *rhp,
836 unsigned long secs, unsigned long c_old, unsigned long c),
837
838 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
839#else
b87700e3
AG
840 TP_PROTO(char *rcutorturename, struct rcu_head *rhp),
841
842 TP_ARGS(rcutorturename, rhp),
a828b9d5 843#endif
b87700e3 844
f127e61e
MD
845 TP_FIELDS(
846 ctf_string(rcutorturename, rcutorturename)
fa91fcac 847 ctf_integer_hex(struct rcu_head *, rhp, rhp)
a828b9d5 848#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
f127e61e
MD
849 ctf_integer(unsigned long, secs, secs)
850 ctf_integer(unsigned long, c_old, c_old)
851 ctf_integer(unsigned long, c, c)
a828b9d5 852#endif
f127e61e 853 )
b87700e3
AG
854)
855#endif
856
857#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
858/*
859 * Tracepoint for _rcu_barrier() execution. The string "s" describes
860 * the _rcu_barrier phase:
861 * "Begin": rcu_barrier_callback() started.
862 * "Check": rcu_barrier_callback() checking for piggybacking.
863 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
864 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
865 * "Offline": rcu_barrier_callback() found offline CPU
866 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
867 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
868 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
869 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
870 * "LastCB": An rcu_barrier_callback() invoked the last callback.
871 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
872 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
873 * is the count of remaining callbacks, and "done" is the piggybacking count.
874 */
3bc29f0a 875LTTNG_TRACEPOINT_EVENT(rcu_barrier,
b87700e3 876
01adf18e
MD
877#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
878 TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
879#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
b87700e3 880 TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done),
01adf18e 881#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
b87700e3
AG
882
883 TP_ARGS(rcuname, s, cpu, cnt, done),
884
f127e61e
MD
885 TP_FIELDS(
886 ctf_string(rcuname, rcuname)
887 ctf_string(s, s)
888 ctf_integer(int, cpu, cpu)
889 ctf_integer(int, cnt, cnt)
890 ctf_integer(unsigned long, done, done)
891 )
b87700e3
AG
892)
893#endif
894
895#else /* #ifdef CONFIG_RCU_TRACE */
896
e0a2e22c
MJ
897#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
898 LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0))
ae8ff4cd
MJ
899#define trace_rcu_grace_period(rcuname, gp_seq, gpevent) do { } while (0)
900#define trace_rcu_grace_period_init(rcuname, gp_seq, level, grplo, grphi, \
901 qsmask) do { } while (0)
902#define trace_rcu_preempt_task(rcuname, pid, gp_seq) do { } while (0)
903#define trace_rcu_unlock_preempted_task(rcuname, gp_seq, pid) do { } while (0)
904#define trace_rcu_quiescent_state_report(rcuname, gp_seq, mask, qsmask, level, \
905 grplo, grphi, gp_tasks) do { } \
906 while (0)
907#define trace_rcu_fqs(rcuname, gp_seq, cpu, qsevent) do { } while (0)
908#else
b87700e3
AG
909#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
910#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
911 qsmask) do { } while (0)
912#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
913#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
914#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
915 grplo, grphi, gp_tasks) do { } \
916 while (0)
917#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
ae8ff4cd
MJ
918#endif
919
e706ff36 920#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
b575c4a3
MD
921#define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0)
922#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
b87700e3
AG
923#define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
924#else
925#define trace_rcu_dyntick(polarity) do { } while (0)
926#endif
927#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
928#define trace_rcu_prep_idle(reason) do { } while (0)
929#endif
930#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
931#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
932#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
933 do { } while (0)
934#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
935 do { } while (0)
936#else
937#define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0)
938#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0)
939#define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0)
940#endif
941#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
942#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
943#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
944#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
945 do { } while (0)
946#else
947#define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0)
948#endif
a828b9d5
MD
949#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
950#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
951 do { } while (0)
952#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
b87700e3
AG
953#define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0)
954#endif
955#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
956#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
957#endif
958#endif /* #else #ifdef CONFIG_RCU_TRACE */
959
3bc29f0a 960#endif /* LTTNG_TRACE_RCU_H */
b87700e3
AG
961
962/* This part must be outside protection */
6ec43db8 963#include <probes/define_trace.h>
This page took 0.0759 seconds and 4 git commands to generate.