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