2 #define TRACE_SYSTEM rcu
4 #if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/tracepoint.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 TRACE_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) || defined(CONFIG_TREE_PREEMPT_RCU)
47 * Tracepoint for grace-period events: starting and ending a grace
48 * period ("start" and "end", respectively), a CPU noting the start
49 * of a new grace period or the end of an old grace period ("cpustart"
50 * and "cpuend", respectively), a CPU passing through a quiescent
51 * state ("cpuqs"), a CPU coming online or going offline ("cpuonl"
52 * and "cpuofl", respectively), and a CPU being kicked for being too
53 * long in dyntick-idle mode ("kick").
55 TRACE_EVENT(rcu_grace_period
,
57 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
58 TP_PROTO(const char *rcuname
, unsigned long gpnum
, const char *gpevent
),
59 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
60 TP_PROTO(char *rcuname
, unsigned long gpnum
, char *gpevent
),
61 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
63 TP_ARGS(rcuname
, gpnum
, gpevent
),
66 __string(rcuname
, rcuname
)
67 __field(unsigned long, gpnum
)
68 __string(gpevent
, gpevent
)
72 tp_strcpy(rcuname
, rcuname
)
73 tp_assign(gpnum
, gpnum
)
74 tp_strcpy(gpevent
, gpevent
)
77 TP_printk("%s %lu %s",
78 __get_str(rcuname
), __entry
->gpnum
, __get_str(gpevent
))
82 * Tracepoint for grace-period-initialization events. These are
83 * distinguished by the type of RCU, the new grace-period number, the
84 * rcu_node structure level, the starting and ending CPU covered by the
85 * rcu_node structure, and the mask of CPUs that will be waited for.
86 * All but the type of RCU are extracted from the rcu_node structure.
88 TRACE_EVENT(rcu_grace_period_init
,
90 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
91 TP_PROTO(const char *rcuname
, unsigned long gpnum
, u8 level
,
92 int grplo
, int grphi
, unsigned long qsmask
),
93 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
94 TP_PROTO(char *rcuname
, unsigned long gpnum
, u8 level
,
95 int grplo
, int grphi
, unsigned long qsmask
),
96 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
98 TP_ARGS(rcuname
, gpnum
, level
, grplo
, grphi
, qsmask
),
101 __string(rcuname
, rcuname
)
102 __field(unsigned long, gpnum
)
106 __field(unsigned long, qsmask
)
110 tp_strcpy(rcuname
, rcuname
)
111 tp_assign(gpnum
, gpnum
)
112 tp_assign(level
, level
)
113 tp_assign(grplo
, grplo
)
114 tp_assign(grphi
, grphi
)
115 tp_assign(qsmask
, qsmask
)
118 TP_printk("%s %lu %u %d %d %lx",
119 __get_str(rcuname
), __entry
->gpnum
, __entry
->level
,
120 __entry
->grplo
, __entry
->grphi
, __entry
->qsmask
)
124 * Tracepoint for tasks blocking within preemptible-RCU read-side
125 * critical sections. Track the type of RCU (which one day might
126 * include SRCU), the grace-period number that the task is blocking
127 * (the current or the next), and the task's PID.
129 TRACE_EVENT(rcu_preempt_task
,
131 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
132 TP_PROTO(const char *rcuname
, int pid
, unsigned long gpnum
),
133 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
134 TP_PROTO(char *rcuname
, int pid
, unsigned long gpnum
),
135 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
137 TP_ARGS(rcuname
, pid
, gpnum
),
140 __string(rcuname
, rcuname
)
141 __field(unsigned long, gpnum
)
146 tp_strcpy(rcuname
, rcuname
)
147 tp_assign(gpnum
, gpnum
)
151 TP_printk("%s %lu %d",
152 __get_str(rcuname
), __entry
->gpnum
, __entry
->pid
)
156 * Tracepoint for tasks that blocked within a given preemptible-RCU
157 * read-side critical section exiting that critical section. Track the
158 * type of RCU (which one day might include SRCU) and the task's PID.
160 TRACE_EVENT(rcu_unlock_preempted_task
,
162 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
163 TP_PROTO(const char *rcuname
, unsigned long gpnum
, int pid
),
164 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
165 TP_PROTO(char *rcuname
, unsigned long gpnum
, int pid
),
166 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
168 TP_ARGS(rcuname
, gpnum
, pid
),
171 __string(rcuname
, rcuname
)
172 __field(unsigned long, gpnum
)
177 tp_strcpy(rcuname
, rcuname
)
178 tp_assign(gpnum
, gpnum
)
182 TP_printk("%s %lu %d", __get_str(rcuname
), __entry
->gpnum
, __entry
->pid
)
186 * Tracepoint for quiescent-state-reporting events. These are
187 * distinguished by the type of RCU, the grace-period number, the
188 * mask of quiescent lower-level entities, the rcu_node structure level,
189 * the starting and ending CPU covered by the rcu_node structure, and
190 * whether there are any blocked tasks blocking the current grace period.
191 * All but the type of RCU are extracted from the rcu_node structure.
193 TRACE_EVENT(rcu_quiescent_state_report
,
195 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
196 TP_PROTO(const char *rcuname
, unsigned long gpnum
,
197 unsigned long mask
, unsigned long qsmask
,
198 u8 level
, int grplo
, int grphi
, int gp_tasks
),
199 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
200 TP_PROTO(char *rcuname
, unsigned long gpnum
,
201 unsigned long mask
, unsigned long qsmask
,
202 u8 level
, int grplo
, int grphi
, int gp_tasks
),
203 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
205 TP_ARGS(rcuname
, gpnum
, mask
, qsmask
, level
, grplo
, grphi
, gp_tasks
),
208 __string(rcuname
, rcuname
)
209 __field(unsigned long, gpnum
)
210 __field(unsigned long, mask
)
211 __field(unsigned long, qsmask
)
215 __field(u8
, gp_tasks
)
219 tp_strcpy(rcuname
, rcuname
)
220 tp_assign(gpnum
, gpnum
)
221 tp_assign(mask
, mask
)
222 tp_assign(qsmask
, qsmask
)
223 tp_assign(level
, level
)
224 tp_assign(grplo
, grplo
)
225 tp_assign(grphi
, grphi
)
226 tp_assign(gp_tasks
, gp_tasks
)
229 TP_printk("%s %lu %lx>%lx %u %d %d %u",
230 __get_str(rcuname
), __entry
->gpnum
,
231 __entry
->mask
, __entry
->qsmask
, __entry
->level
,
232 __entry
->grplo
, __entry
->grphi
, __entry
->gp_tasks
)
236 * Tracepoint for quiescent states detected by force_quiescent_state().
237 * These trace events include the type of RCU, the grace-period number
238 * that was blocked by the CPU, the CPU itself, and the type of quiescent
239 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
240 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
245 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
246 TP_PROTO(const char *rcuname
, unsigned long gpnum
, int cpu
, const char *qsevent
),
247 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
248 TP_PROTO(char *rcuname
, unsigned long gpnum
, int cpu
, char *qsevent
),
249 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
251 TP_ARGS(rcuname
, gpnum
, cpu
, qsevent
),
254 __string(rcuname
, rcuname
)
255 __field(unsigned long, gpnum
)
257 __string(qsevent
, qsevent
)
261 tp_strcpy(rcuname
, rcuname
)
262 tp_assign(gpnum
, gpnum
)
264 tp_strcpy(qsevent
, qsevent
)
267 TP_printk("%s %lu %d %s",
268 __get_str(rcuname
), __entry
->gpnum
,
269 __entry
->cpu
, __get_str(qsevent
))
272 #endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) */
275 * Tracepoint for dyntick-idle entry/exit events. These take a string
276 * as argument: "Start" for entering dyntick-idle mode, "End" for
277 * leaving it, "--=" for events moving towards idle, and "++=" for events
278 * moving away from idle. "Error on entry: not idle task" and "Error on
279 * exit: not idle task" indicate that a non-idle task is erroneously
280 * toying with the idle loop.
282 * These events also take a pair of numbers, which indicate the nesting
283 * depth before and after the event of interest. Note that task-related
284 * events use the upper bits of each number, while interrupt-related
285 * events use the lower bits.
287 TRACE_EVENT(rcu_dyntick
,
290 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
291 TP_PROTO(const char *polarity
, long long oldnesting
, long long newnesting
),
293 TP_ARGS(polarity
, oldnesting
, newnesting
),
294 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
295 TP_PROTO(char *polarity
, long long oldnesting
, long long newnesting
),
297 TP_ARGS(polarity
, oldnesting
, newnesting
),
299 TP_PROTO(char *polarity
),
305 __string(polarity
, polarity
)
306 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
307 __field(long long, oldnesting
)
308 __field(long long, newnesting
)
313 tp_strcpy(polarity
, polarity
)
314 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
315 tp_assign(oldnesting
, oldnesting
)
316 tp_assign(newnesting
, newnesting
)
320 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
321 TP_printk("%s %llx %llx", __get_str(polarity
),
322 __entry
->oldnesting
, __entry
->newnesting
)
324 TP_printk("%s", __get_str(polarity
))
328 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
330 * Tracepoint for RCU preparation for idle, the goal being to get RCU
331 * processing done so that the current CPU can shut off its scheduling
332 * clock and enter dyntick-idle mode. One way to accomplish this is
333 * to drain all RCU callbacks from this CPU, and the other is to have
334 * done everything RCU requires for the current grace period. In this
335 * latter case, the CPU will be awakened at the end of the current grace
336 * period in order to process the remainder of its callbacks.
338 * These tracepoints take a string as argument:
340 * "No callbacks": Nothing to do, no callbacks on this CPU.
341 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
342 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
343 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
344 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
345 * "More callbacks": Still more callbacks, try again to clear them out.
346 * "Callbacks drained": All callbacks processed, off to dyntick idle!
347 * "Timer": Timer fired to cause CPU to continue processing callbacks.
348 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
349 * "Cleanup after idle": Idle exited, timer canceled.
351 TRACE_EVENT(rcu_prep_idle
,
353 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
354 TP_PROTO(const char *reason
),
355 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
356 TP_PROTO(char *reason
),
357 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
362 __string(reason
, reason
)
366 tp_strcpy(reason
, reason
)
369 TP_printk("%s", __get_str(reason
))
374 * Tracepoint for the registration of a single RCU callback function.
375 * The first argument is the type of RCU, the second argument is
376 * a pointer to the RCU callback itself, the third element is the
377 * number of lazy callbacks queued, and the fourth element is the
378 * total number of callbacks queued.
380 TRACE_EVENT(rcu_callback
,
382 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
383 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, long qlen_lazy
,
386 TP_ARGS(rcuname
, rhp
, qlen_lazy
, qlen
),
387 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
388 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, long qlen_lazy
,
391 TP_ARGS(rcuname
, rhp
, qlen_lazy
, qlen
),
393 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, long qlen
),
395 TP_ARGS(rcuname
, rhp
, qlen
),
399 __string(rcuname
, rcuname
)
401 __field(void *, func
)
402 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
403 __field(long, qlen_lazy
)
409 tp_strcpy(rcuname
, rcuname
)
411 tp_assign(func
, rhp
->func
)
412 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
413 tp_assign(qlen_lazy
, qlen_lazy
)
415 tp_assign(qlen
, qlen
)
418 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
419 TP_printk("%s rhp=%p func=%pf %ld/%ld",
420 __get_str(rcuname
), __entry
->rhp
, __entry
->func
,
421 __entry
->qlen_lazy
, __entry
->qlen
)
423 TP_printk("%s rhp=%p func=%pf %ld",
424 __get_str(rcuname
), __entry
->rhp
, __entry
->func
,
430 * Tracepoint for the registration of a single RCU callback of the special
431 * kfree() form. The first argument is the RCU type, the second argument
432 * is a pointer to the RCU callback, the third argument is the offset
433 * of the callback within the enclosing RCU-protected data structure,
434 * the fourth argument is the number of lazy callbacks queued, and the
435 * fifth argument is the total number of callbacks queued.
437 TRACE_EVENT(rcu_kfree_callback
,
440 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
441 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
442 long qlen_lazy
, long qlen
),
444 TP_ARGS(rcuname
, rhp
, offset
, qlen_lazy
, qlen
),
445 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
446 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
447 long qlen_lazy
, long qlen
),
449 TP_ARGS(rcuname
, rhp
, offset
, qlen_lazy
, qlen
),
451 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
,
454 TP_ARGS(rcuname
, rhp
, offset
, qlen
),
458 __string(rcuname
, rcuname
)
460 __field(unsigned long, offset
)
461 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
462 __field(long, qlen_lazy
)
468 tp_strcpy(rcuname
, rcuname
)
470 tp_assign(offset
, offset
)
471 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
472 tp_assign(qlen_lazy
, qlen_lazy
)
474 tp_assign(qlen
, qlen
)
477 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
478 TP_printk("%s rhp=%p func=%ld %ld/%ld",
479 __get_str(rcuname
), __entry
->rhp
, __entry
->offset
,
480 __entry
->qlen_lazy
, __entry
->qlen
)
482 TP_printk("%s rhp=%p func=%ld %ld",
483 __get_str(rcuname
), __entry
->rhp
, __entry
->offset
,
489 * Tracepoint for marking the beginning rcu_do_batch, performed to start
490 * RCU callback invocation. The first argument is the RCU flavor,
491 * the second is the number of lazy callbacks queued, the third is
492 * the total number of callbacks queued, and the fourth argument is
493 * the current RCU-callback batch limit.
495 TRACE_EVENT(rcu_batch_start
,
497 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
498 TP_PROTO(const char *rcuname
, long qlen_lazy
, long qlen
, long blimit
),
500 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
501 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
502 TP_PROTO(char *rcuname
, long qlen_lazy
, long qlen
, long blimit
),
504 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
505 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
506 TP_PROTO(char *rcuname
, long qlen_lazy
, long qlen
, int blimit
),
508 TP_ARGS(rcuname
, qlen_lazy
, qlen
, blimit
),
510 TP_PROTO(char *rcuname
, long qlen
, int blimit
),
512 TP_ARGS(rcuname
, qlen
, blimit
),
516 __string(rcuname
, rcuname
)
517 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
518 __field(long, qlen_lazy
)
521 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
522 __field(long, blimit
)
529 tp_strcpy(rcuname
, rcuname
)
530 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
531 tp_assign(qlen_lazy
, qlen_lazy
)
533 tp_assign(qlen
, qlen
)
534 tp_assign(blimit
, blimit
)
537 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
538 TP_printk("%s CBs=%ld/%ld bl=%ld",
539 __get_str(rcuname
), __entry
->qlen_lazy
, __entry
->qlen
,
541 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
542 TP_printk("%s CBs=%ld/%ld bl=%d",
543 __get_str(rcuname
), __entry
->qlen_lazy
, __entry
->qlen
,
546 TP_printk("%s CBs=%ld bl=%d",
547 __get_str(rcuname
), __entry
->qlen
, __entry
->blimit
)
552 * Tracepoint for the invocation of a single RCU callback function.
553 * The first argument is the type of RCU, and the second argument is
554 * a pointer to the RCU callback itself.
556 TRACE_EVENT(rcu_invoke_callback
,
558 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
559 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
),
560 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
561 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
),
562 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
564 TP_ARGS(rcuname
, rhp
),
567 __string(rcuname
, rcuname
)
569 __field(void *, func
)
573 tp_strcpy(rcuname
, rcuname
)
575 tp_assign(func
, rhp
->func
)
578 TP_printk("%s rhp=%p func=%pf",
579 __get_str(rcuname
), __entry
->rhp
, __entry
->func
)
583 * Tracepoint for the invocation of a single RCU callback of the special
584 * kfree() form. The first argument is the RCU flavor, the second
585 * argument is a pointer to the RCU callback, and the third argument
586 * is the offset of the callback within the enclosing RCU-protected
589 TRACE_EVENT(rcu_invoke_kfree_callback
,
591 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
592 TP_PROTO(const char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
),
593 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
594 TP_PROTO(char *rcuname
, struct rcu_head
*rhp
, unsigned long offset
),
595 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
597 TP_ARGS(rcuname
, rhp
, offset
),
600 __string(rcuname
, rcuname
)
602 __field(unsigned long, offset
)
606 tp_strcpy(rcuname
, rcuname
)
608 tp_assign(offset
, offset
)
611 TP_printk("%s rhp=%p func=%ld",
612 __get_str(rcuname
), __entry
->rhp
, __entry
->offset
)
616 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
617 * invoked. The first argument is the name of the RCU flavor,
618 * the second argument is number of callbacks actually invoked,
619 * the third argument (cb) is whether or not any of the callbacks that
620 * were ready to invoke at the beginning of this batch are still
621 * queued, the fourth argument (nr) is the return value of need_resched(),
622 * the fifth argument (iit) is 1 if the current task is the idle task,
623 * and the sixth argument (risk) is the return value from
624 * rcu_is_callbacks_kthread().
626 TRACE_EVENT(rcu_batch_end
,
628 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
629 TP_PROTO(const char *rcuname
, int callbacks_invoked
,
630 char cb
, char nr
, char iit
, char risk
),
632 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
633 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
634 TP_PROTO(const char *rcuname
, int callbacks_invoked
,
635 bool cb
, bool nr
, bool iit
, bool risk
),
637 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
638 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
639 TP_PROTO(char *rcuname
, int callbacks_invoked
,
640 bool cb
, bool nr
, bool iit
, bool risk
),
642 TP_ARGS(rcuname
, callbacks_invoked
, cb
, nr
, iit
, risk
),
644 TP_PROTO(char *rcuname
, int callbacks_invoked
),
646 TP_ARGS(rcuname
, callbacks_invoked
),
650 __string(rcuname
, rcuname
)
651 __field(int, callbacks_invoked
)
652 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
657 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
666 tp_strcpy(rcuname
, rcuname
)
667 tp_assign(callbacks_invoked
, callbacks_invoked
)
668 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
672 tp_assign(risk
, risk
)
676 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
677 TP_printk("%s CBs-invoked=%d idle=%c%c%c%c",
678 __get_str(rcuname
), __entry
->callbacks_invoked
,
679 __entry
->cb
? 'C' : '.',
680 __entry
->nr
? 'S' : '.',
681 __entry
->iit
? 'I' : '.',
682 __entry
->risk
? 'R' : '.')
684 TP_printk("%s CBs-invoked=%d",
685 __get_str(rcuname
), __entry
->callbacks_invoked
)
689 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
691 * Tracepoint for rcutorture readers. The first argument is the name
692 * of the RCU flavor from rcutorture's viewpoint and the second argument
693 * is the callback address.
695 TRACE_EVENT(rcu_torture_read
,
697 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
698 TP_PROTO(const char *rcutorturename
, struct rcu_head
*rhp
,
699 unsigned long secs
, unsigned long c_old
, unsigned long c
),
701 TP_ARGS(rcutorturename
, rhp
, secs
, c_old
, c
),
702 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
703 TP_PROTO(char *rcutorturename
, struct rcu_head
*rhp
,
704 unsigned long secs
, unsigned long c_old
, unsigned long c
),
706 TP_ARGS(rcutorturename
, rhp
, secs
, c_old
, c
),
708 TP_PROTO(char *rcutorturename
, struct rcu_head
*rhp
),
710 TP_ARGS(rcutorturename
, rhp
),
714 __string(rcutorturename
, rcutorturename
)
715 __field(struct rcu_head
*, rhp
)
716 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
717 __field(unsigned long, secs
)
718 __field(unsigned long, c_old
)
719 __field(unsigned long, c
)
724 tp_strcpy(rcutorturename
, rcutorturename
)
726 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
727 tp_assign(secs
, secs
)
728 tp_assign(c_old
, c_old
)
733 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
734 TP_printk("%s torture read %p %luus c: %lu %lu",
735 __entry
->rcutorturename
, __entry
->rhp
,
736 __entry
->secs
, __entry
->c_old
, __entry
->c
)
738 TP_printk("%s torture read %p",
739 __get_str(rcutorturename
), __entry
->rhp
)
744 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
746 * Tracepoint for _rcu_barrier() execution. The string "s" describes
747 * the _rcu_barrier phase:
748 * "Begin": rcu_barrier_callback() started.
749 * "Check": rcu_barrier_callback() checking for piggybacking.
750 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
751 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
752 * "Offline": rcu_barrier_callback() found offline CPU
753 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
754 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
755 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
756 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
757 * "LastCB": An rcu_barrier_callback() invoked the last callback.
758 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
759 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
760 * is the count of remaining callbacks, and "done" is the piggybacking count.
762 TRACE_EVENT(rcu_barrier
,
764 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
765 TP_PROTO(const char *rcuname
, const char *s
, int cpu
, int cnt
, unsigned long done
),
766 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
767 TP_PROTO(char *rcuname
, char *s
, int cpu
, int cnt
, unsigned long done
),
768 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
770 TP_ARGS(rcuname
, s
, cpu
, cnt
, done
),
773 __string(rcuname
, rcuname
)
777 __field(unsigned long, done
)
781 tp_strcpy(rcuname
, rcuname
)
785 tp_assign(done
, done
)
788 TP_printk("%s %s cpu %d remaining %d # %lu",
789 __get_str(rcuname
), __get_str(s
), __entry
->cpu
, __entry
->cnt
,
794 #else /* #ifdef CONFIG_RCU_TRACE */
796 #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
797 #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
798 qsmask) do { } while (0)
799 #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
800 #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
801 #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
802 grplo, grphi, gp_tasks) do { } \
804 #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
805 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
806 #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
808 #define trace_rcu_dyntick(polarity) do { } while (0)
810 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
811 #define trace_rcu_prep_idle(reason) do { } while (0)
813 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
814 #define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
815 #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
817 #define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
820 #define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0)
821 #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0)
822 #define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0)
824 #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
825 #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
826 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
827 #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
830 #define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0)
832 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
833 #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
835 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
836 #define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0)
838 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
839 #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
841 #endif /* #else #ifdef CONFIG_RCU_TRACE */
843 #endif /* _TRACE_RCU_H */
845 /* This part must be outside protection */
846 #include "../../../probes/define_trace.h"