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 LTTNG_TRACEPOINT_EVENT(rcu_grace_period
,
55 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
56 TP_PROTO(const char *rcuname
, unsigned long gpnum
, const char *gpevent
),
57 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
58 TP_PROTO(char *rcuname
, unsigned long gpnum
, char *gpevent
),
59 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
61 TP_ARGS(rcuname
, gpnum
, gpevent
),
64 ctf_string(rcuname
, rcuname
)
65 ctf_integer(unsigned long, gpnum
, gpnum
)
66 ctf_string(gpevent
, gpevent
)
71 * Tracepoint for grace-period-initialization events. These are
72 * distinguished by the type of RCU, the new grace-period number, the
73 * rcu_node structure level, the starting and ending CPU covered by the
74 * rcu_node structure, and the mask of CPUs that will be waited for.
75 * All but the type of RCU are extracted from the rcu_node structure.
77 LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init
,
79 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
80 TP_PROTO(const char *rcuname
, unsigned long gpnum
, u8 level
,
81 int grplo
, int grphi
, unsigned long qsmask
),
82 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
83 TP_PROTO(char *rcuname
, unsigned long gpnum
, u8 level
,
84 int grplo
, int grphi
, unsigned long qsmask
),
85 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
87 TP_ARGS(rcuname
, gpnum
, level
, grplo
, grphi
, qsmask
),
90 ctf_string(rcuname
, rcuname
)
91 ctf_integer(unsigned long, gpnum
, gpnum
)
92 ctf_integer(u8
, level
, level
)
93 ctf_integer(int, grplo
, grplo
)
94 ctf_integer(int, grphi
, grphi
)
95 ctf_integer(unsigned long, qsmask
, qsmask
)
100 * Tracepoint for tasks blocking within preemptible-RCU read-side
101 * critical sections. Track the type of RCU (which one day might
102 * include SRCU), the grace-period number that the task is blocking
103 * (the current or the next), and the task's PID.
105 LTTNG_TRACEPOINT_EVENT(rcu_preempt_task
,
107 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
108 TP_PROTO(const char *rcuname
, int pid
, unsigned long gpnum
),
109 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
110 TP_PROTO(char *rcuname
, int pid
, unsigned long gpnum
),
111 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
113 TP_ARGS(rcuname
, pid
, gpnum
),
116 ctf_string(rcuname
, rcuname
)
117 ctf_integer(unsigned long, gpnum
, gpnum
)
118 ctf_integer(int, pid
, pid
)
123 * Tracepoint for tasks that blocked within a given preemptible-RCU
124 * read-side critical section exiting that critical section. Track the
125 * type of RCU (which one day might include SRCU) and the task's PID.
127 LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task
,
129 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
130 TP_PROTO(const char *rcuname
, unsigned long gpnum
, int pid
),
131 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
132 TP_PROTO(char *rcuname
, unsigned long gpnum
, int pid
),
133 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
135 TP_ARGS(rcuname
, gpnum
, pid
),
138 ctf_string(rcuname
, rcuname
)
139 ctf_integer(unsigned long, gpnum
, gpnum
)
140 ctf_integer(int, pid
, pid
)
145 * Tracepoint for quiescent-state-reporting events. These are
146 * distinguished by the type of RCU, the grace-period number, the
147 * mask of quiescent lower-level entities, the rcu_node structure level,
148 * the starting and ending CPU covered by the rcu_node structure, and
149 * whether there are any blocked tasks blocking the current grace period.
150 * All but the type of RCU are extracted from the rcu_node structure.
152 LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report
,
154 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
155 TP_PROTO(const char *rcuname
, unsigned long gpnum
,
156 unsigned long mask
, unsigned long qsmask
,
157 u8 level
, int grplo
, int grphi
, int gp_tasks
),
158 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
159 TP_PROTO(char *rcuname
, unsigned long gpnum
,
160 unsigned long mask
, unsigned long qsmask
,
161 u8 level
, int grplo
, int grphi
, int gp_tasks
),
162 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
164 TP_ARGS(rcuname
, gpnum
, mask
, qsmask
, level
, grplo
, grphi
, gp_tasks
),
167 ctf_string(rcuname
, rcuname
)
168 ctf_integer(unsigned long, gpnum
, gpnum
)
169 ctf_integer(unsigned long, mask
, mask
)
170 ctf_integer(unsigned long, qsmask
, qsmask
)
171 ctf_integer(u8
, level
, level
)
172 ctf_integer(int, grplo
, grplo
)
173 ctf_integer(int, grphi
, grphi
)
174 ctf_integer(u8
, gp_tasks
, gp_tasks
)
179 * Tracepoint for quiescent states detected by force_quiescent_state().
180 * These trace events include the type of RCU, the grace-period number
181 * that was blocked by the CPU, the CPU itself, and the type of quiescent
182 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
183 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
186 LTTNG_TRACEPOINT_EVENT(rcu_fqs
,
188 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
189 TP_PROTO(const char *rcuname
, unsigned long gpnum
, int cpu
, const char *qsevent
),
190 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
191 TP_PROTO(char *rcuname
, unsigned long gpnum
, int cpu
, char *qsevent
),
192 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
194 TP_ARGS(rcuname
, gpnum
, cpu
, qsevent
),
197 ctf_integer(unsigned long, gpnum
, gpnum
)
198 ctf_integer(int, cpu
, cpu
)
199 ctf_string(rcuname
, rcuname
)
200 ctf_string(qsevent
, qsevent
)
205 * #if defined(CONFIG_TREE_RCU)
206 * || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
207 * && defined(CONFIG_PREEMPT_RCU))
208 * || defined(CONFIG_TREE_PREEMPT_RCU)
212 * Tracepoint for dyntick-idle entry/exit events. These take a string
213 * as argument: "Start" for entering dyntick-idle mode, "End" for
214 * leaving it, "--=" for events moving towards idle, and "++=" for events
215 * moving away from idle. "Error on entry: not idle task" and "Error on
216 * exit: not idle task" indicate that a non-idle task is erroneously
217 * toying with the idle loop.
219 * These events also take a pair of numbers, which indicate the nesting
220 * depth before and after the event of interest. Note that task-related
221 * events use the upper bits of each number, while interrupt-related
222 * events use the lower bits.
224 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
225 LTTNG_TRACEPOINT_EVENT(rcu_dyntick
,
227 TP_PROTO(const char *polarity
, long oldnesting
, long newnesting
, atomic_t dynticks
),
229 TP_ARGS(polarity
, oldnesting
, newnesting
, dynticks
),
232 ctf_string(polarity
, polarity
)
233 ctf_integer(long, oldnesting
, oldnesting
)
234 ctf_integer(long, newnesting
, newnesting
)
235 ctf_integer(int, dynticks
, atomic_read(&dynticks
))
239 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
240 LTTNG_TRACEPOINT_EVENT(rcu_dyntick
,
242 TP_PROTO(const char *polarity
, long long oldnesting
, long long newnesting
),
244 TP_ARGS(polarity
, oldnesting
, newnesting
),
247 ctf_string(polarity
, polarity
)
248 ctf_integer(long long, oldnesting
, oldnesting
)
249 ctf_integer(long long, newnesting
, newnesting
)
252 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
253 LTTNG_TRACEPOINT_EVENT(rcu_dyntick
,
255 TP_PROTO(char *polarity
, long long oldnesting
, long long newnesting
),
257 TP_ARGS(polarity
, oldnesting
, newnesting
),
260 ctf_string(polarity
, polarity
)
261 ctf_integer(long long, oldnesting
, oldnesting
)
262 ctf_integer(long long, newnesting
, newnesting
)
266 LTTNG_TRACEPOINT_EVENT(rcu_dyntick
,
268 TP_PROTO(char *polarity
),
273 ctf_string(polarity
, polarity
)
279 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
281 * Tracepoint for RCU preparation for idle, the goal being to get RCU
282 * processing done so that the current CPU can shut off its scheduling
283 * clock and enter dyntick-idle mode. One way to accomplish this is
284 * to drain all RCU callbacks from this CPU, and the other is to have
285 * done everything RCU requires for the current grace period. In this
286 * latter case, the CPU will be awakened at the end of the current grace
287 * period in order to process the remainder of its callbacks.
289 * These tracepoints take a string as argument:
291 * "No callbacks": Nothing to do, no callbacks on this CPU.
292 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
293 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
294 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
295 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
296 * "More callbacks": Still more callbacks, try again to clear them out.
297 * "Callbacks drained": All callbacks processed, off to dyntick idle!
298 * "Timer": Timer fired to cause CPU to continue processing callbacks.
299 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
300 * "Cleanup after idle": Idle exited, timer canceled.
302 LTTNG_TRACEPOINT_EVENT(rcu_prep_idle
,
304 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
305 TP_PROTO(const char *reason
),
306 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
307 TP_PROTO(char *reason
),
308 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
313 ctf_string(reason
, reason
)
319 * Tracepoint for the registration of a single RCU callback function.
320 * The first argument is the type of RCU, the second argument is
321 * a pointer to the RCU callback itself, the third element is the
322 * number of lazy callbacks queued, and the fourth element is the
323 * total number of callbacks queued.
325 LTTNG_TRACEPOINT_EVENT(rcu_callback
,
327 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
328 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, long qlen_lazy
,
331 TP_ARGS(rcuname
, rhp
, qlen_lazy
, qlen
),
332 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
333 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, long qlen_lazy
,
336 TP_ARGS(rcuname
, rhp
, qlen_lazy
, qlen
),
338 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, long qlen
),
340 TP_ARGS(rcuname
, rhp
, qlen
),
344 ctf_string(rcuname
, rcuname
)
345 ctf_integer_hex(void *, rhp
, rhp
)
346 ctf_integer_hex(void *, func
, rhp
->func
)
347 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
348 ctf_integer(long, qlen_lazy
, qlen_lazy
)
350 ctf_integer(long, qlen
, qlen
)
355 * Tracepoint for the registration of a single RCU callback of the special
356 * kfree() form. The first argument is the RCU type, the second argument
357 * is a pointer to the RCU callback, the third argument is the offset
358 * of the callback within the enclosing RCU-protected data structure,
359 * the fourth argument is the number of lazy callbacks queued, and the
360 * fifth argument is the total number of callbacks queued.
362 LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback
,
365 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
366 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
367 long qlen_lazy
, long qlen
),
369 TP_ARGS(rcuname
, rhp
, offset
, qlen_lazy
, qlen
),
370 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
371 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
372 long qlen_lazy
, long qlen
),
374 TP_ARGS(rcuname
, rhp
, offset
, qlen_lazy
, qlen
),
376 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
379 TP_ARGS(rcuname
, rhp
, offset
, qlen
),
383 ctf_string(rcuname
, rcuname
)
384 ctf_integer_hex(void *, rhp
, rhp
)
385 ctf_integer_hex(unsigned long, offset
, offset
)
386 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
387 ctf_integer(long, qlen_lazy
, qlen_lazy
)
389 ctf_integer(long, qlen
, qlen
)
394 * Tracepoint for marking the beginning rcu_do_batch, performed to start
395 * RCU callback invocation. The first argument is the RCU flavor,
396 * the second is the number of lazy callbacks queued, the third is
397 * the total number of callbacks queued, and the fourth argument is
398 * the current RCU-callback batch limit.
400 LTTNG_TRACEPOINT_EVENT(rcu_batch_start
,
402 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
403 TP_PROTO(const char *rcuname
, long qlen_lazy
, long qlen
, long blimit
),
405 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
406 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
407 TP_PROTO(char *rcuname
, long qlen_lazy
, long qlen
, long blimit
),
409 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
410 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
411 TP_PROTO(char *rcuname
, long qlen_lazy
, long qlen
, int blimit
),
413 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
415 TP_PROTO(char *rcuname
, long qlen
, int blimit
),
417 TP_ARGS(rcuname
, qlen
, blimit
),
421 ctf_string(rcuname
, rcuname
)
422 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
423 ctf_integer(long, qlen_lazy
, qlen_lazy
)
425 ctf_integer(long, qlen
, qlen
)
426 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
427 ctf_integer(long, blimit
, blimit
)
429 ctf_integer(int, blimit
, blimit
)
435 * Tracepoint for the invocation of a single RCU callback function.
436 * The first argument is the type of RCU, and the second argument is
437 * a pointer to the RCU callback itself.
439 LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback
,
441 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
442 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
),
443 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
444 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
),
445 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
447 TP_ARGS(rcuname
, rhp
),
450 ctf_string(rcuname
, rcuname
)
451 ctf_integer_hex(void *, rhp
, rhp
)
452 ctf_integer_hex(void *, func
, rhp
->func
)
457 * Tracepoint for the invocation of a single RCU callback of the special
458 * kfree() form. The first argument is the RCU flavor, the second
459 * argument is a pointer to the RCU callback, and the third argument
460 * is the offset of the callback within the enclosing RCU-protected
463 LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback
,
465 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
466 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
),
467 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
468 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
),
469 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
471 TP_ARGS(rcuname
, rhp
, offset
),
474 ctf_string(rcuname
, rcuname
)
475 ctf_integer_hex(void *, rhp
, rhp
)
476 ctf_integer(unsigned long, offset
, offset
)
481 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
482 * invoked. The first argument is the name of the RCU flavor,
483 * the second argument is number of callbacks actually invoked,
484 * the third argument (cb) is whether or not any of the callbacks that
485 * were ready to invoke at the beginning of this batch are still
486 * queued, the fourth argument (nr) is the return value of need_resched(),
487 * the fifth argument (iit) is 1 if the current task is the idle task,
488 * and the sixth argument (risk) is the return value from
489 * rcu_is_callbacks_kthread().
491 LTTNG_TRACEPOINT_EVENT(rcu_batch_end
,
493 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
494 TP_PROTO(const char *rcuname
, int callbacks_invoked
,
495 char cb
, char nr
, char iit
, char risk
),
497 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
498 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
499 TP_PROTO(const char *rcuname
, int callbacks_invoked
,
500 bool cb
, bool nr
, bool iit
, bool risk
),
502 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
503 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
504 TP_PROTO(char *rcuname
, int callbacks_invoked
,
505 bool cb
, bool nr
, bool iit
, bool risk
),
507 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
509 TP_PROTO(char *rcuname
, int callbacks_invoked
),
511 TP_ARGS(rcuname
, callbacks_invoked
),
515 ctf_string(rcuname
, rcuname
)
516 ctf_integer(int, callbacks_invoked
, callbacks_invoked
)
517 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
518 ctf_integer(char, cb
, cb
)
519 ctf_integer(char, nr
, nr
)
520 ctf_integer(char, iit
, iit
)
521 ctf_integer(char, risk
, risk
)
522 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
523 ctf_integer(bool, cb
, cb
)
524 ctf_integer(bool, nr
, nr
)
525 ctf_integer(bool, iit
, iit
)
526 ctf_integer(bool, risk
, risk
)
531 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
533 * Tracepoint for rcutorture readers. The first argument is the name
534 * of the RCU flavor from rcutorture's viewpoint and the second argument
535 * is the callback address.
537 LTTNG_TRACEPOINT_EVENT(rcu_torture_read
,
539 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
540 TP_PROTO(const char *rcutorturename
, struct rcu_head
*rhp
,
541 unsigned long secs
, unsigned long c_old
, unsigned long c
),
543 TP_ARGS(rcutorturename
, rhp
, secs
, c_old
, c
),
544 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
545 TP_PROTO(char *rcutorturename
, struct rcu_head
*rhp
,
546 unsigned long secs
, unsigned long c_old
, unsigned long c
),
548 TP_ARGS(rcutorturename
, rhp
, secs
, c_old
, c
),
550 TP_PROTO(char *rcutorturename
, struct rcu_head
*rhp
),
552 TP_ARGS(rcutorturename
, rhp
),
556 ctf_string(rcutorturename
, rcutorturename
)
557 ctf_integer_hex(struct rcu_head
*, rhp
, rhp
)
558 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
559 ctf_integer(unsigned long, secs
, secs
)
560 ctf_integer(unsigned long, c_old
, c_old
)
561 ctf_integer(unsigned long, c
, c
)
567 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
569 * Tracepoint for _rcu_barrier() execution. The string "s" describes
570 * the _rcu_barrier phase:
571 * "Begin": rcu_barrier_callback() started.
572 * "Check": rcu_barrier_callback() checking for piggybacking.
573 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
574 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
575 * "Offline": rcu_barrier_callback() found offline CPU
576 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
577 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
578 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
579 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
580 * "LastCB": An rcu_barrier_callback() invoked the last callback.
581 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
582 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
583 * is the count of remaining callbacks, and "done" is the piggybacking count.
585 LTTNG_TRACEPOINT_EVENT(rcu_barrier
,
587 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
588 TP_PROTO(const char *rcuname
, const char *s
, int cpu
, int cnt
, unsigned long done
),
589 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
590 TP_PROTO(char *rcuname
, char *s
, int cpu
, int cnt
, unsigned long done
),
591 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
593 TP_ARGS(rcuname
, s
, cpu
, cnt
, done
),
596 ctf_string(rcuname
, rcuname
)
598 ctf_integer(int, cpu
, cpu
)
599 ctf_integer(int, cnt
, cnt
)
600 ctf_integer(unsigned long, done
, done
)
605 #else /* #ifdef CONFIG_RCU_TRACE */
607 #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
608 #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
609 qsmask) do { } while (0)
610 #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
611 #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
612 #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
613 grplo, grphi, gp_tasks) do { } \
615 #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
616 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
617 #define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0)
618 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
619 #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
621 #define trace_rcu_dyntick(polarity) do { } while (0)
623 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
624 #define trace_rcu_prep_idle(reason) do { } while (0)
626 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
627 #define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
628 #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
630 #define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
633 #define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0)
634 #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0)
635 #define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0)
637 #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
638 #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
639 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
640 #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
643 #define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0)
645 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
646 #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
648 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
649 #define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0)
651 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
652 #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
654 #endif /* #else #ifdef CONFIG_RCU_TRACE */
656 #endif /* LTTNG_TRACE_RCU_H */
658 /* This part must be outside protection */
659 #include <probes/define_trace.h>