1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM rcu
5 #if !defined(LTTNG_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_RCU_H
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/version.h>
12 * Tracepoint for start/end markers used for utilization calculations.
13 * By convention, the string is of the following forms:
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.
19 * An "@" character within "<activity>" is a comment character: Data
20 * reduction scripts will ignore the "@" and the remainder of the line.
22 LTTNG_TRACEPOINT_EVENT(rcu_utilization
,
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)) */
28 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
37 #ifdef CONFIG_RCU_TRACE
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)
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").
53 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
54 LTTNG_TRACEPOINT_EVENT(rcu_grace_period
,
56 TP_PROTO(const char *rcuname
, unsigned long gp_seq
, const char *gpevent
),
58 TP_ARGS(rcuname
, gp_seq
, gpevent
),
61 ctf_string(rcuname
, rcuname
)
62 ctf_integer(unsigned long, gp_seq
, gp_seq
)
63 ctf_string(gpevent
, gpevent
)
66 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
67 LTTNG_TRACEPOINT_EVENT(rcu_grace_period
,
69 TP_PROTO(const char *rcuname
, unsigned long gpnum
, const char *gpevent
),
71 TP_ARGS(rcuname
, gpnum
, gpevent
),
74 ctf_string(rcuname
, rcuname
)
75 ctf_integer(unsigned long, gpnum
, gpnum
)
76 ctf_string(gpevent
, gpevent
)
80 LTTNG_TRACEPOINT_EVENT(rcu_grace_period
,
82 TP_PROTO(char *rcuname
, unsigned long gpnum
, char *gpevent
),
84 TP_ARGS(rcuname
, gpnum
, gpevent
),
87 ctf_string(rcuname
, rcuname
)
88 ctf_integer(unsigned long, gpnum
, gpnum
)
89 ctf_string(gpevent
, gpevent
)
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.
101 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
102 LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init
,
104 TP_PROTO(const char *rcuname
, unsigned long gp_seq
, u8 level
,
105 int grplo
, int grphi
, unsigned long qsmask
),
107 TP_ARGS(rcuname
, gp_seq
, level
, grplo
, grphi
, qsmask
),
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
)
118 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
119 LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init
,
121 TP_PROTO(const char *rcuname
, unsigned long gpnum
, u8 level
,
122 int grplo
, int grphi
, unsigned long qsmask
),
124 TP_ARGS(rcuname
, gpnum
, level
, grplo
, grphi
, qsmask
),
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
)
136 LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init
,
138 TP_PROTO(char *rcuname
, unsigned long gpnum
, u8 level
,
139 int grplo
, int grphi
, unsigned long qsmask
),
141 TP_ARGS(rcuname
, gpnum
, level
, grplo
, grphi
, qsmask
),
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
)
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.
160 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
161 LTTNG_TRACEPOINT_EVENT(rcu_preempt_task
,
163 TP_PROTO(const char *rcuname
, int pid
, unsigned long gp_seq
),
165 TP_ARGS(rcuname
, pid
, gp_seq
),
168 ctf_string(rcuname
, rcuname
)
169 ctf_integer(unsigned long, gp_seq
, gp_seq
)
170 ctf_integer(int, pid
, pid
)
173 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
174 LTTNG_TRACEPOINT_EVENT(rcu_preempt_task
,
176 TP_PROTO(const char *rcuname
, int pid
, unsigned long gpnum
),
178 TP_ARGS(rcuname
, pid
, gpnum
),
181 ctf_string(rcuname
, rcuname
)
182 ctf_integer(unsigned long, gpnum
, gpnum
)
183 ctf_integer(int, pid
, pid
)
187 LTTNG_TRACEPOINT_EVENT(rcu_preempt_task
,
189 TP_PROTO(char *rcuname
, int pid
, unsigned long gpnum
),
191 TP_ARGS(rcuname
, pid
, gpnum
),
194 ctf_string(rcuname
, rcuname
)
195 ctf_integer(unsigned long, gpnum
, gpnum
)
196 ctf_integer(int, pid
, pid
)
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.
206 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
207 LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task
,
209 TP_PROTO(const char *rcuname
, unsigned long gp_seq
, int pid
),
211 TP_ARGS(rcuname
, gp_seq
, pid
),
214 ctf_string(rcuname
, rcuname
)
215 ctf_integer(unsigned long, gp_seq
, gp_seq
)
216 ctf_integer(int, pid
, pid
)
219 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
220 LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task
,
222 TP_PROTO(const char *rcuname
, unsigned long gpnum
, int pid
),
224 TP_ARGS(rcuname
, gpnum
, pid
),
227 ctf_string(rcuname
, rcuname
)
228 ctf_integer(unsigned long, gpnum
, gpnum
)
229 ctf_integer(int, pid
, pid
)
233 LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task
,
235 TP_PROTO(char *rcuname
, unsigned long gpnum
, int pid
),
237 TP_ARGS(rcuname
, gpnum
, pid
),
240 ctf_string(rcuname
, rcuname
)
241 ctf_integer(unsigned long, gpnum
, gpnum
)
242 ctf_integer(int, pid
, pid
)
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.
255 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
256 LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report
,
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
),
262 TP_ARGS(rcuname
, gp_seq
, mask
, qsmask
, level
, grplo
, grphi
, gp_tasks
),
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
)
275 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
276 LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report
,
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
),
282 TP_ARGS(rcuname
, gpnum
, mask
, qsmask
, level
, grplo
, grphi
, gp_tasks
),
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
)
296 LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report
,
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
),
302 TP_ARGS(rcuname
, gpnum
, mask
, qsmask
, level
, grplo
, grphi
, gp_tasks
),
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
)
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
325 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
326 LTTNG_TRACEPOINT_EVENT(rcu_fqs
,
328 TP_PROTO(const char *rcuname
, unsigned long gp_seq
, int cpu
, const char *qsevent
),
330 TP_ARGS(rcuname
, gp_seq
, cpu
, qsevent
),
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
)
339 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
340 LTTNG_TRACEPOINT_EVENT(rcu_fqs
,
342 TP_PROTO(const char *rcuname
, unsigned long gpnum
, int cpu
, const char *qsevent
),
344 TP_ARGS(rcuname
, gpnum
, cpu
, qsevent
),
347 ctf_integer(unsigned long, gpnum
, gpnum
)
348 ctf_integer(int, cpu
, cpu
)
349 ctf_string(rcuname
, rcuname
)
350 ctf_string(qsevent
, qsevent
)
354 LTTNG_TRACEPOINT_EVENT(rcu_fqs
,
356 TP_PROTO(char *rcuname
, unsigned long gpnum
, int cpu
, char *qsevent
),
358 TP_ARGS(rcuname
, gpnum
, cpu
, qsevent
),
361 ctf_integer(unsigned long, gpnum
, gpnum
)
362 ctf_integer(int, cpu
, cpu
)
363 ctf_string(rcuname
, rcuname
)
364 ctf_string(qsevent
, qsevent
)
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)
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.
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.
389 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
390 LTTNG_TRACEPOINT_EVENT(rcu_dyntick
,
392 TP_PROTO(const char *polarity
, long oldnesting
, long newnesting
, atomic_t dynticks
),
394 TP_ARGS(polarity
, oldnesting
, newnesting
, dynticks
),
397 ctf_string(polarity
, polarity
)
398 ctf_integer(long, oldnesting
, oldnesting
)
399 ctf_integer(long, newnesting
, newnesting
)
400 ctf_integer(int, dynticks
, atomic_read(&dynticks
))
404 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
405 LTTNG_TRACEPOINT_EVENT(rcu_dyntick
,
407 TP_PROTO(const char *polarity
, long long oldnesting
, long long newnesting
),
409 TP_ARGS(polarity
, oldnesting
, newnesting
),
412 ctf_string(polarity
, polarity
)
413 ctf_integer(long long, oldnesting
, oldnesting
)
414 ctf_integer(long long, newnesting
, newnesting
)
417 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
418 LTTNG_TRACEPOINT_EVENT(rcu_dyntick
,
420 TP_PROTO(char *polarity
, long long oldnesting
, long long newnesting
),
422 TP_ARGS(polarity
, oldnesting
, newnesting
),
425 ctf_string(polarity
, polarity
)
426 ctf_integer(long long, oldnesting
, oldnesting
)
427 ctf_integer(long long, newnesting
, newnesting
)
431 LTTNG_TRACEPOINT_EVENT(rcu_dyntick
,
433 TP_PROTO(char *polarity
),
438 ctf_string(polarity
, polarity
)
444 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
446 * Tracepoint for RCU preparation for idle, the goal being to get RCU
447 * processing done so that the current CPU can shut off its scheduling
448 * clock and enter dyntick-idle mode. One way to accomplish this is
449 * to drain all RCU callbacks from this CPU, and the other is to have
450 * done everything RCU requires for the current grace period. In this
451 * latter case, the CPU will be awakened at the end of the current grace
452 * period in order to process the remainder of its callbacks.
454 * These tracepoints take a string as argument:
456 * "No callbacks": Nothing to do, no callbacks on this CPU.
457 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
458 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
459 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
460 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
461 * "More callbacks": Still more callbacks, try again to clear them out.
462 * "Callbacks drained": All callbacks processed, off to dyntick idle!
463 * "Timer": Timer fired to cause CPU to continue processing callbacks.
464 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
465 * "Cleanup after idle": Idle exited, timer canceled.
467 LTTNG_TRACEPOINT_EVENT(rcu_prep_idle
,
469 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
470 TP_PROTO(const char *reason
),
471 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
472 TP_PROTO(char *reason
),
473 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
478 ctf_string(reason
, reason
)
484 * Tracepoint for the registration of a single RCU callback function.
485 * The first argument is the type of RCU, the second argument is
486 * a pointer to the RCU callback itself, the third element is the
487 * number of lazy callbacks queued, and the fourth element is the
488 * total number of callbacks queued.
490 LTTNG_TRACEPOINT_EVENT(rcu_callback
,
492 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
493 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, long qlen_lazy
,
496 TP_ARGS(rcuname
, rhp
, qlen_lazy
, qlen
),
497 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
498 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, long qlen_lazy
,
501 TP_ARGS(rcuname
, rhp
, qlen_lazy
, qlen
),
503 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, long qlen
),
505 TP_ARGS(rcuname
, rhp
, qlen
),
509 ctf_string(rcuname
, rcuname
)
510 ctf_integer_hex(void *, rhp
, rhp
)
511 ctf_integer_hex(void *, func
, rhp
->func
)
512 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
513 ctf_integer(long, qlen_lazy
, qlen_lazy
)
515 ctf_integer(long, qlen
, qlen
)
520 * Tracepoint for the registration of a single RCU callback of the special
521 * kfree() form. The first argument is the RCU type, the second argument
522 * is a pointer to the RCU callback, the third argument is the offset
523 * of the callback within the enclosing RCU-protected data structure,
524 * the fourth argument is the number of lazy callbacks queued, and the
525 * fifth argument is the total number of callbacks queued.
527 LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback
,
530 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
531 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
532 long qlen_lazy
, long qlen
),
534 TP_ARGS(rcuname
, rhp
, offset
, qlen_lazy
, qlen
),
535 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
536 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
537 long qlen_lazy
, long qlen
),
539 TP_ARGS(rcuname
, rhp
, offset
, qlen_lazy
, qlen
),
541 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
544 TP_ARGS(rcuname
, rhp
, offset
, qlen
),
548 ctf_string(rcuname
, rcuname
)
549 ctf_integer_hex(void *, rhp
, rhp
)
550 ctf_integer_hex(unsigned long, offset
, offset
)
551 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
552 ctf_integer(long, qlen_lazy
, qlen_lazy
)
554 ctf_integer(long, qlen
, qlen
)
559 * Tracepoint for marking the beginning rcu_do_batch, performed to start
560 * RCU callback invocation. The first argument is the RCU flavor,
561 * the second is the number of lazy callbacks queued, the third is
562 * the total number of callbacks queued, and the fourth argument is
563 * the current RCU-callback batch limit.
565 LTTNG_TRACEPOINT_EVENT(rcu_batch_start
,
567 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
568 TP_PROTO(const char *rcuname
, long qlen_lazy
, long qlen
, long blimit
),
570 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
571 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
572 TP_PROTO(char *rcuname
, long qlen_lazy
, long qlen
, long blimit
),
574 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
575 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
576 TP_PROTO(char *rcuname
, long qlen_lazy
, long qlen
, int blimit
),
578 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
580 TP_PROTO(char *rcuname
, long qlen
, int blimit
),
582 TP_ARGS(rcuname
, qlen
, blimit
),
586 ctf_string(rcuname
, rcuname
)
587 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
588 ctf_integer(long, qlen_lazy
, qlen_lazy
)
590 ctf_integer(long, qlen
, qlen
)
591 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
592 ctf_integer(long, blimit
, blimit
)
594 ctf_integer(int, blimit
, blimit
)
600 * Tracepoint for the invocation of a single RCU callback function.
601 * The first argument is the type of RCU, and the second argument is
602 * a pointer to the RCU callback itself.
604 LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback
,
606 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
607 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
),
608 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
609 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
),
610 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
612 TP_ARGS(rcuname
, rhp
),
615 ctf_string(rcuname
, rcuname
)
616 ctf_integer_hex(void *, rhp
, rhp
)
617 ctf_integer_hex(void *, func
, rhp
->func
)
622 * Tracepoint for the invocation of a single RCU callback of the special
623 * kfree() form. The first argument is the RCU flavor, the second
624 * argument is a pointer to the RCU callback, and the third argument
625 * is the offset of the callback within the enclosing RCU-protected
628 LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback
,
630 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
631 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
),
632 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
633 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
),
634 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
636 TP_ARGS(rcuname
, rhp
, offset
),
639 ctf_string(rcuname
, rcuname
)
640 ctf_integer_hex(void *, rhp
, rhp
)
641 ctf_integer(unsigned long, offset
, offset
)
646 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
647 * invoked. The first argument is the name of the RCU flavor,
648 * the second argument is number of callbacks actually invoked,
649 * the third argument (cb) is whether or not any of the callbacks that
650 * were ready to invoke at the beginning of this batch are still
651 * queued, the fourth argument (nr) is the return value of need_resched(),
652 * the fifth argument (iit) is 1 if the current task is the idle task,
653 * and the sixth argument (risk) is the return value from
654 * rcu_is_callbacks_kthread().
656 LTTNG_TRACEPOINT_EVENT(rcu_batch_end
,
658 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
659 TP_PROTO(const char *rcuname
, int callbacks_invoked
,
660 char cb
, char nr
, char iit
, char risk
),
662 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
663 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
664 TP_PROTO(const char *rcuname
, int callbacks_invoked
,
665 bool cb
, bool nr
, bool iit
, bool risk
),
667 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
668 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
669 TP_PROTO(char *rcuname
, int callbacks_invoked
,
670 bool cb
, bool nr
, bool iit
, bool risk
),
672 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
674 TP_PROTO(char *rcuname
, int callbacks_invoked
),
676 TP_ARGS(rcuname
, callbacks_invoked
),
680 ctf_string(rcuname
, rcuname
)
681 ctf_integer(int, callbacks_invoked
, callbacks_invoked
)
682 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
683 ctf_integer(char, cb
, cb
)
684 ctf_integer(char, nr
, nr
)
685 ctf_integer(char, iit
, iit
)
686 ctf_integer(char, risk
, risk
)
687 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
688 ctf_integer(bool, cb
, cb
)
689 ctf_integer(bool, nr
, nr
)
690 ctf_integer(bool, iit
, iit
)
691 ctf_integer(bool, risk
, risk
)
696 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
698 * Tracepoint for rcutorture readers. The first argument is the name
699 * of the RCU flavor from rcutorture's viewpoint and the second argument
700 * is the callback address.
702 LTTNG_TRACEPOINT_EVENT(rcu_torture_read
,
704 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
705 TP_PROTO(const char *rcutorturename
, struct rcu_head
*rhp
,
706 unsigned long secs
, unsigned long c_old
, unsigned long c
),
708 TP_ARGS(rcutorturename
, rhp
, secs
, c_old
, c
),
709 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
710 TP_PROTO(char *rcutorturename
, struct rcu_head
*rhp
,
711 unsigned long secs
, unsigned long c_old
, unsigned long c
),
713 TP_ARGS(rcutorturename
, rhp
, secs
, c_old
, c
),
715 TP_PROTO(char *rcutorturename
, struct rcu_head
*rhp
),
717 TP_ARGS(rcutorturename
, rhp
),
721 ctf_string(rcutorturename
, rcutorturename
)
722 ctf_integer_hex(struct rcu_head
*, rhp
, rhp
)
723 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
724 ctf_integer(unsigned long, secs
, secs
)
725 ctf_integer(unsigned long, c_old
, c_old
)
726 ctf_integer(unsigned long, c
, c
)
732 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
734 * Tracepoint for _rcu_barrier() execution. The string "s" describes
735 * the _rcu_barrier phase:
736 * "Begin": rcu_barrier_callback() started.
737 * "Check": rcu_barrier_callback() checking for piggybacking.
738 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
739 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
740 * "Offline": rcu_barrier_callback() found offline CPU
741 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
742 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
743 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
744 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
745 * "LastCB": An rcu_barrier_callback() invoked the last callback.
746 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
747 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
748 * is the count of remaining callbacks, and "done" is the piggybacking count.
750 LTTNG_TRACEPOINT_EVENT(rcu_barrier
,
752 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
753 TP_PROTO(const char *rcuname
, const char *s
, int cpu
, int cnt
, unsigned long done
),
754 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
755 TP_PROTO(char *rcuname
, char *s
, int cpu
, int cnt
, unsigned long done
),
756 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
758 TP_ARGS(rcuname
, s
, cpu
, cnt
, done
),
761 ctf_string(rcuname
, rcuname
)
763 ctf_integer(int, cpu
, cpu
)
764 ctf_integer(int, cnt
, cnt
)
765 ctf_integer(unsigned long, done
, done
)
770 #else /* #ifdef CONFIG_RCU_TRACE */
772 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
773 #define trace_rcu_grace_period(rcuname, gp_seq, gpevent) do { } while (0)
774 #define trace_rcu_grace_period_init(rcuname, gp_seq, level, grplo, grphi, \
775 qsmask) do { } while (0)
776 #define trace_rcu_preempt_task(rcuname, pid, gp_seq) do { } while (0)
777 #define trace_rcu_unlock_preempted_task(rcuname, gp_seq, pid) do { } while (0)
778 #define trace_rcu_quiescent_state_report(rcuname, gp_seq, mask, qsmask, level, \
779 grplo, grphi, gp_tasks) do { } \
781 #define trace_rcu_fqs(rcuname, gp_seq, cpu, qsevent) do { } while (0)
783 #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
784 #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
785 qsmask) do { } while (0)
786 #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
787 #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
788 #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
789 grplo, grphi, gp_tasks) do { } \
791 #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
794 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
795 #define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0)
796 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
797 #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
799 #define trace_rcu_dyntick(polarity) do { } while (0)
801 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
802 #define trace_rcu_prep_idle(reason) do { } while (0)
804 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
805 #define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
806 #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
808 #define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
811 #define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0)
812 #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0)
813 #define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0)
815 #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
816 #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
817 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
818 #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
821 #define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0)
823 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
824 #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
826 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
827 #define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0)
829 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
830 #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
832 #endif /* #else #ifdef CONFIG_RCU_TRACE */
834 #endif /* LTTNG_TRACE_RCU_H */
836 /* This part must be outside protection */
837 #include <probes/define_trace.h>