rcu: update to 3.9 rc kernel instrumentation
[lttng-modules.git] / instrumentation / events / lttng-module / rcu.h
CommitLineData
b87700e3
AG
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM rcu
3
4#if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_RCU_H
6
7#include <linux/tracepoint.h>
8#include <linux/version.h>
9
10/*
11 * Tracepoint for start/end markers used for utilization calculations.
12 * By convention, the string is of the following forms:
13 *
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.
17 *
18 * An "@" character within "<activity>" is a comment character: Data
19 * reduction scripts will ignore the "@" and the remainder of the line.
20 */
21TRACE_EVENT(rcu_utilization,
22
23 TP_PROTO(char *s),
24
25 TP_ARGS(s),
26
27 TP_STRUCT__entry(
28 __string(s, s)
29 ),
30
31 TP_fast_assign(
32 tp_strcpy(s, s)
33 ),
34
35 TP_printk("%s", __get_str(s))
36)
37
38#ifdef CONFIG_RCU_TRACE
39
40#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
41
42/*
43 * Tracepoint for grace-period events: starting and ending a grace
44 * period ("start" and "end", respectively), a CPU noting the start
45 * of a new grace period or the end of an old grace period ("cpustart"
46 * and "cpuend", respectively), a CPU passing through a quiescent
47 * state ("cpuqs"), a CPU coming online or going offline ("cpuonl"
48 * and "cpuofl", respectively), and a CPU being kicked for being too
49 * long in dyntick-idle mode ("kick").
50 */
51TRACE_EVENT(rcu_grace_period,
52
53 TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent),
54
55 TP_ARGS(rcuname, gpnum, gpevent),
56
57 TP_STRUCT__entry(
58 __string(rcuname, rcuname)
59 __field(unsigned long, gpnum)
60 __string(gpevent, gpevent)
61 ),
62
63 TP_fast_assign(
64 tp_strcpy(rcuname, rcuname)
65 tp_assign(gpnum, gpnum)
66 tp_strcpy(gpevent, gpevent)
67 ),
68
69 TP_printk("%s %lu %s",
70 __get_str(rcuname), __entry->gpnum, __get_str(gpevent))
71)
72
73/*
74 * Tracepoint for grace-period-initialization events. These are
75 * distinguished by the type of RCU, the new grace-period number, the
76 * rcu_node structure level, the starting and ending CPU covered by the
77 * rcu_node structure, and the mask of CPUs that will be waited for.
78 * All but the type of RCU are extracted from the rcu_node structure.
79 */
80TRACE_EVENT(rcu_grace_period_init,
81
82 TP_PROTO(char *rcuname, unsigned long gpnum, u8 level,
83 int grplo, int grphi, unsigned long qsmask),
84
85 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
86
87 TP_STRUCT__entry(
88 __string(rcuname, rcuname)
89 __field(unsigned long, gpnum)
90 __field(u8, level)
91 __field(int, grplo)
92 __field(int, grphi)
93 __field(unsigned long, qsmask)
94 ),
95
96 TP_fast_assign(
97 tp_strcpy(rcuname, rcuname)
98 tp_assign(gpnum, gpnum)
99 tp_assign(level, level)
100 tp_assign(grplo, grplo)
101 tp_assign(grphi, grphi)
102 tp_assign(qsmask, qsmask)
103 ),
104
105 TP_printk("%s %lu %u %d %d %lx",
106 __get_str(rcuname), __entry->gpnum, __entry->level,
107 __entry->grplo, __entry->grphi, __entry->qsmask)
108)
109
110/*
111 * Tracepoint for tasks blocking within preemptible-RCU read-side
112 * critical sections. Track the type of RCU (which one day might
113 * include SRCU), the grace-period number that the task is blocking
114 * (the current or the next), and the task's PID.
115 */
116TRACE_EVENT(rcu_preempt_task,
117
118 TP_PROTO(char *rcuname, int pid, unsigned long gpnum),
119
120 TP_ARGS(rcuname, pid, gpnum),
121
122 TP_STRUCT__entry(
123 __string(rcuname, rcuname)
124 __field(unsigned long, gpnum)
125 __field(int, pid)
126 ),
127
128 TP_fast_assign(
129 tp_strcpy(rcuname, rcuname)
130 tp_assign(gpnum, gpnum)
131 tp_assign(pid, pid)
132 ),
133
134 TP_printk("%s %lu %d",
135 __get_str(rcuname), __entry->gpnum, __entry->pid)
136)
137
138/*
139 * Tracepoint for tasks that blocked within a given preemptible-RCU
140 * read-side critical section exiting that critical section. Track the
141 * type of RCU (which one day might include SRCU) and the task's PID.
142 */
143TRACE_EVENT(rcu_unlock_preempted_task,
144
145 TP_PROTO(char *rcuname, unsigned long gpnum, int pid),
146
147 TP_ARGS(rcuname, gpnum, pid),
148
149 TP_STRUCT__entry(
150 __string(rcuname, rcuname)
151 __field(unsigned long, gpnum)
152 __field(int, pid)
153 ),
154
155 TP_fast_assign(
156 tp_strcpy(rcuname, rcuname)
157 tp_assign(gpnum, gpnum)
158 tp_assign(pid, pid)
159 ),
160
161 TP_printk("%s %lu %d", __get_str(rcuname), __entry->gpnum, __entry->pid)
162)
163
164/*
165 * Tracepoint for quiescent-state-reporting events. These are
166 * distinguished by the type of RCU, the grace-period number, the
167 * mask of quiescent lower-level entities, the rcu_node structure level,
168 * the starting and ending CPU covered by the rcu_node structure, and
169 * whether there are any blocked tasks blocking the current grace period.
170 * All but the type of RCU are extracted from the rcu_node structure.
171 */
172TRACE_EVENT(rcu_quiescent_state_report,
173
174 TP_PROTO(char *rcuname, unsigned long gpnum,
175 unsigned long mask, unsigned long qsmask,
176 u8 level, int grplo, int grphi, int gp_tasks),
177
178 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
179
180 TP_STRUCT__entry(
181 __string(rcuname, rcuname)
182 __field(unsigned long, gpnum)
183 __field(unsigned long, mask)
184 __field(unsigned long, qsmask)
185 __field(u8, level)
186 __field(int, grplo)
187 __field(int, grphi)
188 __field(u8, gp_tasks)
189 ),
190
191 TP_fast_assign(
192 tp_strcpy(rcuname, rcuname)
193 tp_assign(gpnum, gpnum)
194 tp_assign(mask, mask)
195 tp_assign(qsmask, qsmask)
196 tp_assign(level, level)
197 tp_assign(grplo, grplo)
198 tp_assign(grphi, grphi)
199 tp_assign(gp_tasks, gp_tasks)
200 ),
201
202 TP_printk("%s %lu %lx>%lx %u %d %d %u",
203 __get_str(rcuname), __entry->gpnum,
204 __entry->mask, __entry->qsmask, __entry->level,
205 __entry->grplo, __entry->grphi, __entry->gp_tasks)
206)
207
208/*
209 * Tracepoint for quiescent states detected by force_quiescent_state().
210 * These trace events include the type of RCU, the grace-period number
211 * that was blocked by the CPU, the CPU itself, and the type of quiescent
212 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
213 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
214 * too long.
215 */
216TRACE_EVENT(rcu_fqs,
217
218 TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent),
219
220 TP_ARGS(rcuname, gpnum, cpu, qsevent),
221
222 TP_STRUCT__entry(
223 __string(rcuname, rcuname)
224 __field(unsigned long, gpnum)
225 __field(int, cpu)
226 __string(qsevent, qsevent)
227 ),
228
229 TP_fast_assign(
230 tp_strcpy(rcuname, rcuname)
231 tp_assign(gpnum, gpnum)
232 tp_assign(cpu, cpu)
233 tp_strcpy(qsevent, qsevent)
234 ),
235
236 TP_printk("%s %lu %d %s",
237 __get_str(rcuname), __entry->gpnum,
238 __entry->cpu, __get_str(qsevent))
239)
240
241#endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) */
242
243/*
244 * Tracepoint for dyntick-idle entry/exit events. These take a string
245 * as argument: "Start" for entering dyntick-idle mode, "End" for
246 * leaving it, "--=" for events moving towards idle, and "++=" for events
247 * moving away from idle. "Error on entry: not idle task" and "Error on
248 * exit: not idle task" indicate that a non-idle task is erroneously
249 * toying with the idle loop.
250 *
251 * These events also take a pair of numbers, which indicate the nesting
252 * depth before and after the event of interest. Note that task-related
253 * events use the upper bits of each number, while interrupt-related
254 * events use the lower bits.
255 */
256TRACE_EVENT(rcu_dyntick,
257
258#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
259 TP_PROTO(char *polarity, long long oldnesting, long long newnesting),
260
261 TP_ARGS(polarity, oldnesting, newnesting),
262#else
263 TP_PROTO(char *polarity),
264
265 TP_ARGS(polarity),
266#endif
267
268 TP_STRUCT__entry(
269 __string(polarity, polarity)
270#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
271 __field(long long, oldnesting)
272 __field(long long, newnesting)
273#endif
274 ),
275
276 TP_fast_assign(
277 tp_strcpy(polarity, polarity)
278#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
279 tp_assign(oldnesting, oldnesting)
280 tp_assign(newnesting, newnesting)
281#endif
282 ),
283
284#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
285 TP_printk("%s %llx %llx", __get_str(polarity),
286 __entry->oldnesting, __entry->newnesting)
287#else
288 TP_printk("%s", __get_str(polarity))
289#endif
290)
291
292#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
293/*
294 * Tracepoint for RCU preparation for idle, the goal being to get RCU
295 * processing done so that the current CPU can shut off its scheduling
296 * clock and enter dyntick-idle mode. One way to accomplish this is
297 * to drain all RCU callbacks from this CPU, and the other is to have
298 * done everything RCU requires for the current grace period. In this
299 * latter case, the CPU will be awakened at the end of the current grace
300 * period in order to process the remainder of its callbacks.
301 *
302 * These tracepoints take a string as argument:
303 *
304 * "No callbacks": Nothing to do, no callbacks on this CPU.
305 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
306 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
307 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
308 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
309 * "More callbacks": Still more callbacks, try again to clear them out.
310 * "Callbacks drained": All callbacks processed, off to dyntick idle!
311 * "Timer": Timer fired to cause CPU to continue processing callbacks.
312 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
313 * "Cleanup after idle": Idle exited, timer canceled.
314 */
315TRACE_EVENT(rcu_prep_idle,
316
317 TP_PROTO(char *reason),
318
319 TP_ARGS(reason),
320
321 TP_STRUCT__entry(
322 __string(reason, reason)
323 ),
324
325 TP_fast_assign(
326 tp_strcpy(reason, reason)
327 ),
328
329 TP_printk("%s", __get_str(reason))
330)
331#endif
332
333/*
334 * Tracepoint for the registration of a single RCU callback function.
335 * The first argument is the type of RCU, the second argument is
336 * a pointer to the RCU callback itself, the third element is the
337 * number of lazy callbacks queued, and the fourth element is the
338 * total number of callbacks queued.
339 */
340TRACE_EVENT(rcu_callback,
341
342#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
343 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy,
344 long qlen),
345
346 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
347#else
348 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen),
349
350 TP_ARGS(rcuname, rhp, qlen),
351#endif
352
353 TP_STRUCT__entry(
354 __string(rcuname, rcuname)
355 __field(void *, rhp)
356 __field(void *, func)
357#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
358 __field(long, qlen_lazy)
359#endif
360 __field(long, qlen)
361 ),
362
363 TP_fast_assign(
364 tp_strcpy(rcuname, rcuname)
365 tp_assign(rhp, rhp)
366 tp_assign(func, rhp->func)
367#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
368 tp_assign(qlen_lazy, qlen_lazy)
369#endif
370 tp_assign(qlen, qlen)
371 ),
372
373#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
374 TP_printk("%s rhp=%p func=%pf %ld/%ld",
375 __get_str(rcuname), __entry->rhp, __entry->func,
376 __entry->qlen_lazy, __entry->qlen)
377#else
378 TP_printk("%s rhp=%p func=%pf %ld",
379 __get_str(rcuname), __entry->rhp, __entry->func,
380 __entry->qlen)
381#endif
382)
383
384/*
385 * Tracepoint for the registration of a single RCU callback of the special
386 * kfree() form. The first argument is the RCU type, the second argument
387 * is a pointer to the RCU callback, the third argument is the offset
388 * of the callback within the enclosing RCU-protected data structure,
389 * the fourth argument is the number of lazy callbacks queued, and the
390 * fifth argument is the total number of callbacks queued.
391 */
392TRACE_EVENT(rcu_kfree_callback,
393
394#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
395 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
396 long qlen_lazy, long qlen),
397
398 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
399#else
400 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
401 long qlen),
402
403 TP_ARGS(rcuname, rhp, offset, qlen),
404#endif
405
406 TP_STRUCT__entry(
407 __string(rcuname, rcuname)
408 __field(void *, rhp)
409 __field(unsigned long, offset)
410#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
411 __field(long, qlen_lazy)
412#endif
413 __field(long, qlen)
414 ),
415
416 TP_fast_assign(
417 tp_strcpy(rcuname, rcuname)
418 tp_assign(rhp, rhp)
419 tp_assign(offset, offset)
420#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
421 tp_assign(qlen_lazy, qlen_lazy)
422#endif
423 tp_assign(qlen, qlen)
424 ),
425
426#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
427 TP_printk("%s rhp=%p func=%ld %ld/%ld",
428 __get_str(rcuname), __entry->rhp, __entry->offset,
429 __entry->qlen_lazy, __entry->qlen)
430#else
431 TP_printk("%s rhp=%p func=%ld %ld",
432 __get_str(rcuname), __entry->rhp, __entry->offset,
433 __entry->qlen)
434#endif
435)
436
437/*
438 * Tracepoint for marking the beginning rcu_do_batch, performed to start
439 * RCU callback invocation. The first argument is the RCU flavor,
440 * the second is the number of lazy callbacks queued, the third is
441 * the total number of callbacks queued, and the fourth argument is
442 * the current RCU-callback batch limit.
443 */
444TRACE_EVENT(rcu_batch_start,
445
446#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
447 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit),
448
449 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
450#else
451 TP_PROTO(char *rcuname, long qlen, int blimit),
452
453 TP_ARGS(rcuname, qlen, blimit),
454#endif
455
456 TP_STRUCT__entry(
457 __string(rcuname, rcuname)
458#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
459 __field(long, qlen_lazy)
460#endif
461 __field(long, qlen)
462 __field(int, blimit)
463 ),
464
465 TP_fast_assign(
466 tp_strcpy(rcuname, rcuname)
467#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
468 tp_assign(qlen_lazy, qlen_lazy)
469#endif
470 tp_assign(qlen, qlen)
471 tp_assign(blimit, blimit)
472 ),
473
474#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
475 TP_printk("%s CBs=%ld/%ld bl=%d",
476 __get_str(rcuname), __entry->qlen_lazy, __entry->qlen,
477 __entry->blimit)
478#else
479 TP_printk("%s CBs=%ld bl=%d",
480 __get_str(rcuname), __entry->qlen, __entry->blimit)
481#endif
482)
483
484/*
485 * Tracepoint for the invocation of a single RCU callback function.
486 * The first argument is the type of RCU, and the second argument is
487 * a pointer to the RCU callback itself.
488 */
489TRACE_EVENT(rcu_invoke_callback,
490
491 TP_PROTO(char *rcuname, struct rcu_head *rhp),
492
493 TP_ARGS(rcuname, rhp),
494
495 TP_STRUCT__entry(
496 __string(rcuname, rcuname)
497 __field(void *, rhp)
498 __field(void *, func)
499 ),
500
501 TP_fast_assign(
502 tp_strcpy(rcuname, rcuname)
503 tp_assign(rhp, rhp)
504 tp_assign(func, rhp->func)
505 ),
506
507 TP_printk("%s rhp=%p func=%pf",
508 __get_str(rcuname), __entry->rhp, __entry->func)
509)
510
511/*
512 * Tracepoint for the invocation of a single RCU callback of the special
513 * kfree() form. The first argument is the RCU flavor, the second
514 * argument is a pointer to the RCU callback, and the third argument
515 * is the offset of the callback within the enclosing RCU-protected
516 * data structure.
517 */
518TRACE_EVENT(rcu_invoke_kfree_callback,
519
520 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset),
521
522 TP_ARGS(rcuname, rhp, offset),
523
524 TP_STRUCT__entry(
525 __string(rcuname, rcuname)
526 __field(void *, rhp)
527 __field(unsigned long, offset)
528 ),
529
530 TP_fast_assign(
531 tp_strcpy(rcuname, rcuname)
532 tp_assign(rhp, rhp)
533 tp_assign(offset, offset)
534 ),
535
536 TP_printk("%s rhp=%p func=%ld",
537 __get_str(rcuname), __entry->rhp, __entry->offset)
538)
539
540/*
541 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
542 * invoked. The first argument is the name of the RCU flavor,
543 * the second argument is number of callbacks actually invoked,
544 * the third argument (cb) is whether or not any of the callbacks that
545 * were ready to invoke at the beginning of this batch are still
546 * queued, the fourth argument (nr) is the return value of need_resched(),
547 * the fifth argument (iit) is 1 if the current task is the idle task,
548 * and the sixth argument (risk) is the return value from
549 * rcu_is_callbacks_kthread().
550 */
551TRACE_EVENT(rcu_batch_end,
552
553#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
554 TP_PROTO(char *rcuname, int callbacks_invoked,
555 bool cb, bool nr, bool iit, bool risk),
556
557 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
558#else
559 TP_PROTO(char *rcuname, int callbacks_invoked),
560
561 TP_ARGS(rcuname, callbacks_invoked),
562#endif
563
564 TP_STRUCT__entry(
565 __string(rcuname, rcuname)
566 __field(int, callbacks_invoked)
567#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
568 __field(bool, cb)
569 __field(bool, nr)
570 __field(bool, iit)
571 __field(bool, risk)
572#endif
573 ),
574
575 TP_fast_assign(
576 tp_strcpy(rcuname, rcuname)
577 tp_assign(callbacks_invoked, callbacks_invoked)
578#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
579 tp_assign(cb, cb)
580 tp_assign(nr, nr)
581 tp_assign(iit, iit)
582 tp_assign(risk, risk)
583#endif
584 ),
585
586#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
587 TP_printk("%s CBs-invoked=%d idle=%c%c%c%c",
588 __get_str(rcuname), __entry->callbacks_invoked,
589 __entry->cb ? 'C' : '.',
590 __entry->nr ? 'S' : '.',
591 __entry->iit ? 'I' : '.',
592 __entry->risk ? 'R' : '.')
593#else
594 TP_printk("%s CBs-invoked=%d",
595 __get_str(rcuname), __entry->callbacks_invoked)
596#endif
597)
598
599#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
600/*
601 * Tracepoint for rcutorture readers. The first argument is the name
602 * of the RCU flavor from rcutorture's viewpoint and the second argument
603 * is the callback address.
604 */
605TRACE_EVENT(rcu_torture_read,
606
a828b9d5
MD
607#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
608 TP_PROTO(char *rcutorturename, struct rcu_head *rhp,
609 unsigned long secs, unsigned long c_old, unsigned long c),
610
611 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
612#else
b87700e3
AG
613 TP_PROTO(char *rcutorturename, struct rcu_head *rhp),
614
615 TP_ARGS(rcutorturename, rhp),
a828b9d5 616#endif
b87700e3
AG
617
618 TP_STRUCT__entry(
619 __string(rcutorturename, rcutorturename)
620 __field(struct rcu_head *, rhp)
a828b9d5
MD
621#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
622 __field(unsigned long, secs)
623 __field(unsigned long, c_old)
624 __field(unsigned long, c)
625#endif
b87700e3
AG
626 ),
627
628 TP_fast_assign(
629 tp_strcpy(rcutorturename, rcutorturename)
630 tp_assign(rhp, rhp)
a828b9d5
MD
631#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
632 tp_assign(secs, secs)
633 tp_assign(c_old, c_old)
634 tp_assign(c, c)
635#endif
b87700e3
AG
636 ),
637
a828b9d5
MD
638#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
639 TP_printk("%s torture read %p %luus c: %lu %lu",
640 __entry->rcutorturename, __entry->rhp,
641 __entry->secs, __entry->c_old, __entry->c)
642#else
b87700e3
AG
643 TP_printk("%s torture read %p",
644 __get_str(rcutorturename), __entry->rhp)
a828b9d5 645#endif
b87700e3
AG
646)
647#endif
648
649#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
650/*
651 * Tracepoint for _rcu_barrier() execution. The string "s" describes
652 * the _rcu_barrier phase:
653 * "Begin": rcu_barrier_callback() started.
654 * "Check": rcu_barrier_callback() checking for piggybacking.
655 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
656 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
657 * "Offline": rcu_barrier_callback() found offline CPU
658 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
659 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
660 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
661 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
662 * "LastCB": An rcu_barrier_callback() invoked the last callback.
663 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
664 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
665 * is the count of remaining callbacks, and "done" is the piggybacking count.
666 */
667TRACE_EVENT(rcu_barrier,
668
669 TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done),
670
671 TP_ARGS(rcuname, s, cpu, cnt, done),
672
673 TP_STRUCT__entry(
674 __string(rcuname, rcuname)
675 __string(s, s)
676 __field(int, cpu)
677 __field(int, cnt)
678 __field(unsigned long, done)
679 ),
680
681 TP_fast_assign(
682 tp_strcpy(rcuname, rcuname)
683 tp_strcpy(s, s)
684 tp_assign(cpu, cpu)
685 tp_assign(cnt, cnt)
686 tp_assign(done, done)
687 ),
688
689 TP_printk("%s %s cpu %d remaining %d # %lu",
690 __get_str(rcuname), __get_str(s), __entry->cpu, __entry->cnt,
691 __entry->done)
692)
693#endif
694
695#else /* #ifdef CONFIG_RCU_TRACE */
696
697#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
698#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
699 qsmask) do { } while (0)
700#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
701#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
702#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
703 grplo, grphi, gp_tasks) do { } \
704 while (0)
705#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
706#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
707#define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
708#else
709#define trace_rcu_dyntick(polarity) do { } while (0)
710#endif
711#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
712#define trace_rcu_prep_idle(reason) do { } while (0)
713#endif
714#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
715#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
716#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
717 do { } while (0)
718#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
719 do { } while (0)
720#else
721#define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0)
722#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0)
723#define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0)
724#endif
725#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
726#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
727#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
728#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
729 do { } while (0)
730#else
731#define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0)
732#endif
a828b9d5
MD
733#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
734#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
735 do { } while (0)
736#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
b87700e3
AG
737#define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0)
738#endif
739#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
740#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
741#endif
742#endif /* #else #ifdef CONFIG_RCU_TRACE */
743
744#endif /* _TRACE_RCU_H */
745
746/* This part must be outside protection */
747#include "../../../probes/define_trace.h"
This page took 0.050805 seconds and 4 git commands to generate.