2 #define TRACE_SYSTEM rcu
4 #if !defined(LTTNG_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_RCU_H
7 #include "../../../probes/lttng-tracepoint-event.h"
8 #include <linux/version.h>
11 * Tracepoint for start/end markers used for utilization calculations.
12 * By convention, the string is of the following forms:
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.
18 * An "@" character within "<activity>" is a comment character: Data
19 * reduction scripts will ignore the "@" and the remainder of the line.
21 LTTNG_TRACEPOINT_EVENT(rcu_utilization
,
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)) */
27 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
39 TP_printk("%s", __get_str(s
))
42 #ifdef CONFIG_RCU_TRACE
44 #if defined(CONFIG_TREE_RCU) \
45 || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) \
46 && defined(CONFIG_PREEMPT_RCU)) \
47 || defined(CONFIG_TREE_PREEMPT_RCU)
50 * Tracepoint for grace-period events: starting and ending a grace
51 * period ("start" and "end", respectively), a CPU noting the start
52 * of a new grace period or the end of an old grace period ("cpustart"
53 * and "cpuend", respectively), a CPU passing through a quiescent
54 * state ("cpuqs"), a CPU coming online or going offline ("cpuonl"
55 * and "cpuofl", respectively), and a CPU being kicked for being too
56 * long in dyntick-idle mode ("kick").
58 LTTNG_TRACEPOINT_EVENT(rcu_grace_period
,
60 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
61 TP_PROTO(const char *rcuname
, unsigned long gpnum
, const char *gpevent
),
62 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
63 TP_PROTO(char *rcuname
, unsigned long gpnum
, char *gpevent
),
64 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
66 TP_ARGS(rcuname
, gpnum
, gpevent
),
69 __string(rcuname
, rcuname
)
70 __field(unsigned long, gpnum
)
71 __string(gpevent
, gpevent
)
75 tp_strcpy(rcuname
, rcuname
)
76 tp_assign(gpnum
, gpnum
)
77 tp_strcpy(gpevent
, gpevent
)
80 TP_printk("%s %lu %s",
81 __get_str(rcuname
), __entry
->gpnum
, __get_str(gpevent
))
85 * Tracepoint for grace-period-initialization events. These are
86 * distinguished by the type of RCU, the new grace-period number, the
87 * rcu_node structure level, the starting and ending CPU covered by the
88 * rcu_node structure, and the mask of CPUs that will be waited for.
89 * All but the type of RCU are extracted from the rcu_node structure.
91 LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init
,
93 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
94 TP_PROTO(const char *rcuname
, unsigned long gpnum
, u8 level
,
95 int grplo
, int grphi
, unsigned long qsmask
),
96 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
97 TP_PROTO(char *rcuname
, unsigned long gpnum
, u8 level
,
98 int grplo
, int grphi
, unsigned long qsmask
),
99 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
101 TP_ARGS(rcuname
, gpnum
, level
, grplo
, grphi
, qsmask
),
104 __string(rcuname
, rcuname
)
105 __field(unsigned long, gpnum
)
109 __field(unsigned long, qsmask
)
113 tp_strcpy(rcuname
, rcuname
)
114 tp_assign(gpnum
, gpnum
)
115 tp_assign(level
, level
)
116 tp_assign(grplo
, grplo
)
117 tp_assign(grphi
, grphi
)
118 tp_assign(qsmask
, qsmask
)
121 TP_printk("%s %lu %u %d %d %lx",
122 __get_str(rcuname
), __entry
->gpnum
, __entry
->level
,
123 __entry
->grplo
, __entry
->grphi
, __entry
->qsmask
)
127 * Tracepoint for tasks blocking within preemptible-RCU read-side
128 * critical sections. Track the type of RCU (which one day might
129 * include SRCU), the grace-period number that the task is blocking
130 * (the current or the next), and the task's PID.
132 LTTNG_TRACEPOINT_EVENT(rcu_preempt_task
,
134 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
135 TP_PROTO(const char *rcuname
, int pid
, unsigned long gpnum
),
136 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
137 TP_PROTO(char *rcuname
, int pid
, unsigned long gpnum
),
138 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
140 TP_ARGS(rcuname
, pid
, gpnum
),
143 __string(rcuname
, rcuname
)
144 __field(unsigned long, gpnum
)
149 tp_strcpy(rcuname
, rcuname
)
150 tp_assign(gpnum
, gpnum
)
154 TP_printk("%s %lu %d",
155 __get_str(rcuname
), __entry
->gpnum
, __entry
->pid
)
159 * Tracepoint for tasks that blocked within a given preemptible-RCU
160 * read-side critical section exiting that critical section. Track the
161 * type of RCU (which one day might include SRCU) and the task's PID.
163 LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task
,
165 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
166 TP_PROTO(const char *rcuname
, unsigned long gpnum
, int pid
),
167 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
168 TP_PROTO(char *rcuname
, unsigned long gpnum
, int pid
),
169 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
171 TP_ARGS(rcuname
, gpnum
, pid
),
174 __string(rcuname
, rcuname
)
175 __field(unsigned long, gpnum
)
180 tp_strcpy(rcuname
, rcuname
)
181 tp_assign(gpnum
, gpnum
)
185 TP_printk("%s %lu %d", __get_str(rcuname
), __entry
->gpnum
, __entry
->pid
)
189 * Tracepoint for quiescent-state-reporting events. These are
190 * distinguished by the type of RCU, the grace-period number, the
191 * mask of quiescent lower-level entities, the rcu_node structure level,
192 * the starting and ending CPU covered by the rcu_node structure, and
193 * whether there are any blocked tasks blocking the current grace period.
194 * All but the type of RCU are extracted from the rcu_node structure.
196 LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report
,
198 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
199 TP_PROTO(const char *rcuname
, unsigned long gpnum
,
200 unsigned long mask
, unsigned long qsmask
,
201 u8 level
, int grplo
, int grphi
, int gp_tasks
),
202 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
203 TP_PROTO(char *rcuname
, unsigned long gpnum
,
204 unsigned long mask
, unsigned long qsmask
,
205 u8 level
, int grplo
, int grphi
, int gp_tasks
),
206 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
208 TP_ARGS(rcuname
, gpnum
, mask
, qsmask
, level
, grplo
, grphi
, gp_tasks
),
211 __string(rcuname
, rcuname
)
212 __field(unsigned long, gpnum
)
213 __field(unsigned long, mask
)
214 __field(unsigned long, qsmask
)
218 __field(u8
, gp_tasks
)
222 tp_strcpy(rcuname
, rcuname
)
223 tp_assign(gpnum
, gpnum
)
224 tp_assign(mask
, mask
)
225 tp_assign(qsmask
, qsmask
)
226 tp_assign(level
, level
)
227 tp_assign(grplo
, grplo
)
228 tp_assign(grphi
, grphi
)
229 tp_assign(gp_tasks
, gp_tasks
)
232 TP_printk("%s %lu %lx>%lx %u %d %d %u",
233 __get_str(rcuname
), __entry
->gpnum
,
234 __entry
->mask
, __entry
->qsmask
, __entry
->level
,
235 __entry
->grplo
, __entry
->grphi
, __entry
->gp_tasks
)
239 * Tracepoint for quiescent states detected by force_quiescent_state().
240 * These trace events include the type of RCU, the grace-period number
241 * that was blocked by the CPU, the CPU itself, and the type of quiescent
242 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
243 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
246 LTTNG_TRACEPOINT_EVENT(rcu_fqs
,
248 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
249 TP_PROTO(const char *rcuname
, unsigned long gpnum
, int cpu
, const char *qsevent
),
250 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
251 TP_PROTO(char *rcuname
, unsigned long gpnum
, int cpu
, char *qsevent
),
252 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
254 TP_ARGS(rcuname
, gpnum
, cpu
, qsevent
),
257 __string(rcuname
, rcuname
)
258 __field(unsigned long, gpnum
)
260 __string(qsevent
, qsevent
)
264 tp_strcpy(rcuname
, rcuname
)
265 tp_assign(gpnum
, gpnum
)
267 tp_strcpy(qsevent
, qsevent
)
270 TP_printk("%s %lu %d %s",
271 __get_str(rcuname
), __entry
->gpnum
,
272 __entry
->cpu
, __get_str(qsevent
))
276 * #if defined(CONFIG_TREE_RCU)
277 * || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
278 * && defined(CONFIG_PREEMPT_RCU))
279 * || defined(CONFIG_TREE_PREEMPT_RCU)
283 * Tracepoint for dyntick-idle entry/exit events. These take a string
284 * as argument: "Start" for entering dyntick-idle mode, "End" for
285 * leaving it, "--=" for events moving towards idle, and "++=" for events
286 * moving away from idle. "Error on entry: not idle task" and "Error on
287 * exit: not idle task" indicate that a non-idle task is erroneously
288 * toying with the idle loop.
290 * These events also take a pair of numbers, which indicate the nesting
291 * depth before and after the event of interest. Note that task-related
292 * events use the upper bits of each number, while interrupt-related
293 * events use the lower bits.
295 LTTNG_TRACEPOINT_EVENT(rcu_dyntick
,
298 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
299 TP_PROTO(const char *polarity
, long long oldnesting
, long long newnesting
),
301 TP_ARGS(polarity
, oldnesting
, newnesting
),
302 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
303 TP_PROTO(char *polarity
, long long oldnesting
, long long newnesting
),
305 TP_ARGS(polarity
, oldnesting
, newnesting
),
307 TP_PROTO(char *polarity
),
313 __string(polarity
, polarity
)
314 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
315 __field(long long, oldnesting
)
316 __field(long long, newnesting
)
321 tp_strcpy(polarity
, polarity
)
322 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
323 tp_assign(oldnesting
, oldnesting
)
324 tp_assign(newnesting
, newnesting
)
328 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
329 TP_printk("%s %llx %llx", __get_str(polarity
),
330 __entry
->oldnesting
, __entry
->newnesting
)
332 TP_printk("%s", __get_str(polarity
))
336 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
338 * Tracepoint for RCU preparation for idle, the goal being to get RCU
339 * processing done so that the current CPU can shut off its scheduling
340 * clock and enter dyntick-idle mode. One way to accomplish this is
341 * to drain all RCU callbacks from this CPU, and the other is to have
342 * done everything RCU requires for the current grace period. In this
343 * latter case, the CPU will be awakened at the end of the current grace
344 * period in order to process the remainder of its callbacks.
346 * These tracepoints take a string as argument:
348 * "No callbacks": Nothing to do, no callbacks on this CPU.
349 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
350 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
351 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
352 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
353 * "More callbacks": Still more callbacks, try again to clear them out.
354 * "Callbacks drained": All callbacks processed, off to dyntick idle!
355 * "Timer": Timer fired to cause CPU to continue processing callbacks.
356 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
357 * "Cleanup after idle": Idle exited, timer canceled.
359 LTTNG_TRACEPOINT_EVENT(rcu_prep_idle
,
361 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
362 TP_PROTO(const char *reason
),
363 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
364 TP_PROTO(char *reason
),
365 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
370 __string(reason
, reason
)
374 tp_strcpy(reason
, reason
)
377 TP_printk("%s", __get_str(reason
))
382 * Tracepoint for the registration of a single RCU callback function.
383 * The first argument is the type of RCU, the second argument is
384 * a pointer to the RCU callback itself, the third element is the
385 * number of lazy callbacks queued, and the fourth element is the
386 * total number of callbacks queued.
388 LTTNG_TRACEPOINT_EVENT(rcu_callback
,
390 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
391 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, long qlen_lazy
,
394 TP_ARGS(rcuname
, rhp
, qlen_lazy
, qlen
),
395 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
396 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, long qlen_lazy
,
399 TP_ARGS(rcuname
, rhp
, qlen_lazy
, qlen
),
401 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, long qlen
),
403 TP_ARGS(rcuname
, rhp
, qlen
),
407 __string(rcuname
, rcuname
)
409 __field(void *, func
)
410 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
411 __field(long, qlen_lazy
)
417 tp_strcpy(rcuname
, rcuname
)
419 tp_assign(func
, rhp
->func
)
420 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
421 tp_assign(qlen_lazy
, qlen_lazy
)
423 tp_assign(qlen
, qlen
)
426 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
427 TP_printk("%s rhp=%p func=%pf %ld/%ld",
428 __get_str(rcuname
), __entry
->rhp
, __entry
->func
,
429 __entry
->qlen_lazy
, __entry
->qlen
)
431 TP_printk("%s rhp=%p func=%pf %ld",
432 __get_str(rcuname
), __entry
->rhp
, __entry
->func
,
438 * Tracepoint for the registration of a single RCU callback of the special
439 * kfree() form. The first argument is the RCU type, the second argument
440 * is a pointer to the RCU callback, the third argument is the offset
441 * of the callback within the enclosing RCU-protected data structure,
442 * the fourth argument is the number of lazy callbacks queued, and the
443 * fifth argument is the total number of callbacks queued.
445 LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback
,
448 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
449 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
450 long qlen_lazy
, long qlen
),
452 TP_ARGS(rcuname
, rhp
, offset
, qlen_lazy
, qlen
),
453 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
454 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
455 long qlen_lazy
, long qlen
),
457 TP_ARGS(rcuname
, rhp
, offset
, qlen_lazy
, qlen
),
459 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
462 TP_ARGS(rcuname
, rhp
, offset
, qlen
),
466 __string(rcuname
, rcuname
)
468 __field(unsigned long, offset
)
469 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
470 __field(long, qlen_lazy
)
476 tp_strcpy(rcuname
, rcuname
)
478 tp_assign(offset
, offset
)
479 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
480 tp_assign(qlen_lazy
, qlen_lazy
)
482 tp_assign(qlen
, qlen
)
485 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
486 TP_printk("%s rhp=%p func=%ld %ld/%ld",
487 __get_str(rcuname
), __entry
->rhp
, __entry
->offset
,
488 __entry
->qlen_lazy
, __entry
->qlen
)
490 TP_printk("%s rhp=%p func=%ld %ld",
491 __get_str(rcuname
), __entry
->rhp
, __entry
->offset
,
497 * Tracepoint for marking the beginning rcu_do_batch, performed to start
498 * RCU callback invocation. The first argument is the RCU flavor,
499 * the second is the number of lazy callbacks queued, the third is
500 * the total number of callbacks queued, and the fourth argument is
501 * the current RCU-callback batch limit.
503 LTTNG_TRACEPOINT_EVENT(rcu_batch_start
,
505 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
506 TP_PROTO(const char *rcuname
, long qlen_lazy
, long qlen
, long blimit
),
508 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
509 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
510 TP_PROTO(char *rcuname
, long qlen_lazy
, long qlen
, long blimit
),
512 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
513 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
514 TP_PROTO(char *rcuname
, long qlen_lazy
, long qlen
, int blimit
),
516 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
518 TP_PROTO(char *rcuname
, long qlen
, int blimit
),
520 TP_ARGS(rcuname
, qlen
, blimit
),
524 __string(rcuname
, rcuname
)
525 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
526 __field(long, qlen_lazy
)
529 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
530 __field(long, blimit
)
537 tp_strcpy(rcuname
, rcuname
)
538 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
539 tp_assign(qlen_lazy
, qlen_lazy
)
541 tp_assign(qlen
, qlen
)
542 tp_assign(blimit
, blimit
)
545 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
546 TP_printk("%s CBs=%ld/%ld bl=%ld",
547 __get_str(rcuname
), __entry
->qlen_lazy
, __entry
->qlen
,
549 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
550 TP_printk("%s CBs=%ld/%ld bl=%d",
551 __get_str(rcuname
), __entry
->qlen_lazy
, __entry
->qlen
,
554 TP_printk("%s CBs=%ld bl=%d",
555 __get_str(rcuname
), __entry
->qlen
, __entry
->blimit
)
560 * Tracepoint for the invocation of a single RCU callback function.
561 * The first argument is the type of RCU, and the second argument is
562 * a pointer to the RCU callback itself.
564 LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback
,
566 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
567 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
),
568 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
569 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
),
570 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
572 TP_ARGS(rcuname
, rhp
),
575 __string(rcuname
, rcuname
)
577 __field(void *, func
)
581 tp_strcpy(rcuname
, rcuname
)
583 tp_assign(func
, rhp
->func
)
586 TP_printk("%s rhp=%p func=%pf",
587 __get_str(rcuname
), __entry
->rhp
, __entry
->func
)
591 * Tracepoint for the invocation of a single RCU callback of the special
592 * kfree() form. The first argument is the RCU flavor, the second
593 * argument is a pointer to the RCU callback, and the third argument
594 * is the offset of the callback within the enclosing RCU-protected
597 LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback
,
599 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
600 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
),
601 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
602 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
),
603 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
605 TP_ARGS(rcuname
, rhp
, offset
),
608 __string(rcuname
, rcuname
)
610 __field(unsigned long, offset
)
614 tp_strcpy(rcuname
, rcuname
)
616 tp_assign(offset
, offset
)
619 TP_printk("%s rhp=%p func=%ld",
620 __get_str(rcuname
), __entry
->rhp
, __entry
->offset
)
624 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
625 * invoked. The first argument is the name of the RCU flavor,
626 * the second argument is number of callbacks actually invoked,
627 * the third argument (cb) is whether or not any of the callbacks that
628 * were ready to invoke at the beginning of this batch are still
629 * queued, the fourth argument (nr) is the return value of need_resched(),
630 * the fifth argument (iit) is 1 if the current task is the idle task,
631 * and the sixth argument (risk) is the return value from
632 * rcu_is_callbacks_kthread().
634 LTTNG_TRACEPOINT_EVENT(rcu_batch_end
,
636 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
637 TP_PROTO(const char *rcuname
, int callbacks_invoked
,
638 char cb
, char nr
, char iit
, char risk
),
640 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
641 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
642 TP_PROTO(const char *rcuname
, int callbacks_invoked
,
643 bool cb
, bool nr
, bool iit
, bool risk
),
645 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
646 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
647 TP_PROTO(char *rcuname
, int callbacks_invoked
,
648 bool cb
, bool nr
, bool iit
, bool risk
),
650 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
652 TP_PROTO(char *rcuname
, int callbacks_invoked
),
654 TP_ARGS(rcuname
, callbacks_invoked
),
658 __string(rcuname
, rcuname
)
659 __field(int, callbacks_invoked
)
660 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
665 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
674 tp_strcpy(rcuname
, rcuname
)
675 tp_assign(callbacks_invoked
, callbacks_invoked
)
676 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
680 tp_assign(risk
, risk
)
684 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
685 TP_printk("%s CBs-invoked=%d idle=%c%c%c%c",
686 __get_str(rcuname
), __entry
->callbacks_invoked
,
687 __entry
->cb
? 'C' : '.',
688 __entry
->nr
? 'S' : '.',
689 __entry
->iit
? 'I' : '.',
690 __entry
->risk
? 'R' : '.')
692 TP_printk("%s CBs-invoked=%d",
693 __get_str(rcuname
), __entry
->callbacks_invoked
)
697 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
699 * Tracepoint for rcutorture readers. The first argument is the name
700 * of the RCU flavor from rcutorture's viewpoint and the second argument
701 * is the callback address.
703 LTTNG_TRACEPOINT_EVENT(rcu_torture_read
,
705 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
706 TP_PROTO(const char *rcutorturename
, struct rcu_head
*rhp
,
707 unsigned long secs
, unsigned long c_old
, unsigned long c
),
709 TP_ARGS(rcutorturename
, rhp
, secs
, c_old
, c
),
710 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
711 TP_PROTO(char *rcutorturename
, struct rcu_head
*rhp
,
712 unsigned long secs
, unsigned long c_old
, unsigned long c
),
714 TP_ARGS(rcutorturename
, rhp
, secs
, c_old
, c
),
716 TP_PROTO(char *rcutorturename
, struct rcu_head
*rhp
),
718 TP_ARGS(rcutorturename
, rhp
),
722 __string(rcutorturename
, rcutorturename
)
723 __field(struct rcu_head
*, rhp
)
724 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
725 __field(unsigned long, secs
)
726 __field(unsigned long, c_old
)
727 __field(unsigned long, c
)
732 tp_strcpy(rcutorturename
, rcutorturename
)
734 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
735 tp_assign(secs
, secs
)
736 tp_assign(c_old
, c_old
)
741 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
742 TP_printk("%s torture read %p %luus c: %lu %lu",
743 __entry
->rcutorturename
, __entry
->rhp
,
744 __entry
->secs
, __entry
->c_old
, __entry
->c
)
746 TP_printk("%s torture read %p",
747 __get_str(rcutorturename
), __entry
->rhp
)
752 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
754 * Tracepoint for _rcu_barrier() execution. The string "s" describes
755 * the _rcu_barrier phase:
756 * "Begin": rcu_barrier_callback() started.
757 * "Check": rcu_barrier_callback() checking for piggybacking.
758 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
759 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
760 * "Offline": rcu_barrier_callback() found offline CPU
761 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
762 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
763 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
764 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
765 * "LastCB": An rcu_barrier_callback() invoked the last callback.
766 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
767 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
768 * is the count of remaining callbacks, and "done" is the piggybacking count.
770 LTTNG_TRACEPOINT_EVENT(rcu_barrier
,
772 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
773 TP_PROTO(const char *rcuname
, const char *s
, int cpu
, int cnt
, unsigned long done
),
774 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
775 TP_PROTO(char *rcuname
, char *s
, int cpu
, int cnt
, unsigned long done
),
776 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
778 TP_ARGS(rcuname
, s
, cpu
, cnt
, done
),
781 __string(rcuname
, rcuname
)
785 __field(unsigned long, done
)
789 tp_strcpy(rcuname
, rcuname
)
793 tp_assign(done
, done
)
796 TP_printk("%s %s cpu %d remaining %d # %lu",
797 __get_str(rcuname
), __get_str(s
), __entry
->cpu
, __entry
->cnt
,
802 #else /* #ifdef CONFIG_RCU_TRACE */
804 #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
805 #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
806 qsmask) do { } while (0)
807 #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
808 #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
809 #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
810 grplo, grphi, gp_tasks) do { } \
812 #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
813 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
814 #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
816 #define trace_rcu_dyntick(polarity) do { } while (0)
818 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
819 #define trace_rcu_prep_idle(reason) do { } while (0)
821 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
822 #define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
823 #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
825 #define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
828 #define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0)
829 #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0)
830 #define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0)
832 #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
833 #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
834 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
835 #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
838 #define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0)
840 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
841 #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
843 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
844 #define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0)
846 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
847 #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
849 #endif /* #else #ifdef CONFIG_RCU_TRACE */
851 #endif /* LTTNG_TRACE_RCU_H */
853 /* This part must be outside protection */
854 #include "../../../probes/define_trace.h"