Update rcu instrumentation to 3.9.[0-4]
[lttng-modules.git] / instrumentation / events / lttng-module / rcu.h
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 */
21 TRACE_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 */
51 TRACE_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 */
80 TRACE_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 */
116 TRACE_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 */
143 TRACE_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 */
172 TRACE_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 */
216 TRACE_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 */
256 TRACE_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 */
315 TRACE_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 */
340 TRACE_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 */
392 TRACE_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 */
444 TRACE_EVENT(rcu_batch_start,
445
446 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
447 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit),
448
449 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
450 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
451 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit),
452
453 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
454 #else
455 TP_PROTO(char *rcuname, long qlen, int blimit),
456
457 TP_ARGS(rcuname, qlen, blimit),
458 #endif
459
460 TP_STRUCT__entry(
461 __string(rcuname, rcuname)
462 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
463 __field(long, qlen_lazy)
464 #endif
465 __field(long, qlen)
466 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
467 __field(long, blimit)
468 #else
469 __field(int, blimit)
470 #endif
471 ),
472
473 TP_fast_assign(
474 tp_strcpy(rcuname, rcuname)
475 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
476 tp_assign(qlen_lazy, qlen_lazy)
477 #endif
478 tp_assign(qlen, qlen)
479 tp_assign(blimit, blimit)
480 ),
481
482 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
483 TP_printk("%s CBs=%ld/%ld bl=%ld",
484 __get_str(rcuname), __entry->qlen_lazy, __entry->qlen,
485 __entry->blimit)
486 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
487 TP_printk("%s CBs=%ld/%ld bl=%d",
488 __get_str(rcuname), __entry->qlen_lazy, __entry->qlen,
489 __entry->blimit)
490 #else
491 TP_printk("%s CBs=%ld bl=%d",
492 __get_str(rcuname), __entry->qlen, __entry->blimit)
493 #endif
494 )
495
496 /*
497 * Tracepoint for the invocation of a single RCU callback function.
498 * The first argument is the type of RCU, and the second argument is
499 * a pointer to the RCU callback itself.
500 */
501 TRACE_EVENT(rcu_invoke_callback,
502
503 TP_PROTO(char *rcuname, struct rcu_head *rhp),
504
505 TP_ARGS(rcuname, rhp),
506
507 TP_STRUCT__entry(
508 __string(rcuname, rcuname)
509 __field(void *, rhp)
510 __field(void *, func)
511 ),
512
513 TP_fast_assign(
514 tp_strcpy(rcuname, rcuname)
515 tp_assign(rhp, rhp)
516 tp_assign(func, rhp->func)
517 ),
518
519 TP_printk("%s rhp=%p func=%pf",
520 __get_str(rcuname), __entry->rhp, __entry->func)
521 )
522
523 /*
524 * Tracepoint for the invocation of a single RCU callback of the special
525 * kfree() form. The first argument is the RCU flavor, the second
526 * argument is a pointer to the RCU callback, and the third argument
527 * is the offset of the callback within the enclosing RCU-protected
528 * data structure.
529 */
530 TRACE_EVENT(rcu_invoke_kfree_callback,
531
532 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset),
533
534 TP_ARGS(rcuname, rhp, offset),
535
536 TP_STRUCT__entry(
537 __string(rcuname, rcuname)
538 __field(void *, rhp)
539 __field(unsigned long, offset)
540 ),
541
542 TP_fast_assign(
543 tp_strcpy(rcuname, rcuname)
544 tp_assign(rhp, rhp)
545 tp_assign(offset, offset)
546 ),
547
548 TP_printk("%s rhp=%p func=%ld",
549 __get_str(rcuname), __entry->rhp, __entry->offset)
550 )
551
552 /*
553 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
554 * invoked. The first argument is the name of the RCU flavor,
555 * the second argument is number of callbacks actually invoked,
556 * the third argument (cb) is whether or not any of the callbacks that
557 * were ready to invoke at the beginning of this batch are still
558 * queued, the fourth argument (nr) is the return value of need_resched(),
559 * the fifth argument (iit) is 1 if the current task is the idle task,
560 * and the sixth argument (risk) is the return value from
561 * rcu_is_callbacks_kthread().
562 */
563 TRACE_EVENT(rcu_batch_end,
564
565 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
566 TP_PROTO(char *rcuname, int callbacks_invoked,
567 bool cb, bool nr, bool iit, bool risk),
568
569 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
570 #else
571 TP_PROTO(char *rcuname, int callbacks_invoked),
572
573 TP_ARGS(rcuname, callbacks_invoked),
574 #endif
575
576 TP_STRUCT__entry(
577 __string(rcuname, rcuname)
578 __field(int, callbacks_invoked)
579 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
580 __field(bool, cb)
581 __field(bool, nr)
582 __field(bool, iit)
583 __field(bool, risk)
584 #endif
585 ),
586
587 TP_fast_assign(
588 tp_strcpy(rcuname, rcuname)
589 tp_assign(callbacks_invoked, callbacks_invoked)
590 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
591 tp_assign(cb, cb)
592 tp_assign(nr, nr)
593 tp_assign(iit, iit)
594 tp_assign(risk, risk)
595 #endif
596 ),
597
598 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
599 TP_printk("%s CBs-invoked=%d idle=%c%c%c%c",
600 __get_str(rcuname), __entry->callbacks_invoked,
601 __entry->cb ? 'C' : '.',
602 __entry->nr ? 'S' : '.',
603 __entry->iit ? 'I' : '.',
604 __entry->risk ? 'R' : '.')
605 #else
606 TP_printk("%s CBs-invoked=%d",
607 __get_str(rcuname), __entry->callbacks_invoked)
608 #endif
609 )
610
611 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
612 /*
613 * Tracepoint for rcutorture readers. The first argument is the name
614 * of the RCU flavor from rcutorture's viewpoint and the second argument
615 * is the callback address.
616 */
617 TRACE_EVENT(rcu_torture_read,
618
619 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
620 TP_PROTO(char *rcutorturename, struct rcu_head *rhp,
621 unsigned long secs, unsigned long c_old, unsigned long c),
622
623 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
624 #else
625 TP_PROTO(char *rcutorturename, struct rcu_head *rhp),
626
627 TP_ARGS(rcutorturename, rhp),
628 #endif
629
630 TP_STRUCT__entry(
631 __string(rcutorturename, rcutorturename)
632 __field(struct rcu_head *, rhp)
633 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
634 __field(unsigned long, secs)
635 __field(unsigned long, c_old)
636 __field(unsigned long, c)
637 #endif
638 ),
639
640 TP_fast_assign(
641 tp_strcpy(rcutorturename, rcutorturename)
642 tp_assign(rhp, rhp)
643 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
644 tp_assign(secs, secs)
645 tp_assign(c_old, c_old)
646 tp_assign(c, c)
647 #endif
648 ),
649
650 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
651 TP_printk("%s torture read %p %luus c: %lu %lu",
652 __entry->rcutorturename, __entry->rhp,
653 __entry->secs, __entry->c_old, __entry->c)
654 #else
655 TP_printk("%s torture read %p",
656 __get_str(rcutorturename), __entry->rhp)
657 #endif
658 )
659 #endif
660
661 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
662 /*
663 * Tracepoint for _rcu_barrier() execution. The string "s" describes
664 * the _rcu_barrier phase:
665 * "Begin": rcu_barrier_callback() started.
666 * "Check": rcu_barrier_callback() checking for piggybacking.
667 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
668 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
669 * "Offline": rcu_barrier_callback() found offline CPU
670 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
671 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
672 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
673 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
674 * "LastCB": An rcu_barrier_callback() invoked the last callback.
675 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
676 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
677 * is the count of remaining callbacks, and "done" is the piggybacking count.
678 */
679 TRACE_EVENT(rcu_barrier,
680
681 TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done),
682
683 TP_ARGS(rcuname, s, cpu, cnt, done),
684
685 TP_STRUCT__entry(
686 __string(rcuname, rcuname)
687 __string(s, s)
688 __field(int, cpu)
689 __field(int, cnt)
690 __field(unsigned long, done)
691 ),
692
693 TP_fast_assign(
694 tp_strcpy(rcuname, rcuname)
695 tp_strcpy(s, s)
696 tp_assign(cpu, cpu)
697 tp_assign(cnt, cnt)
698 tp_assign(done, done)
699 ),
700
701 TP_printk("%s %s cpu %d remaining %d # %lu",
702 __get_str(rcuname), __get_str(s), __entry->cpu, __entry->cnt,
703 __entry->done)
704 )
705 #endif
706
707 #else /* #ifdef CONFIG_RCU_TRACE */
708
709 #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
710 #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
711 qsmask) do { } while (0)
712 #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
713 #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
714 #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
715 grplo, grphi, gp_tasks) do { } \
716 while (0)
717 #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
718 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
719 #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
720 #else
721 #define trace_rcu_dyntick(polarity) do { } while (0)
722 #endif
723 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
724 #define trace_rcu_prep_idle(reason) do { } while (0)
725 #endif
726 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
727 #define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
728 #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
729 do { } while (0)
730 #define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
731 do { } while (0)
732 #else
733 #define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0)
734 #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0)
735 #define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0)
736 #endif
737 #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
738 #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
739 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
740 #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
741 do { } while (0)
742 #else
743 #define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0)
744 #endif
745 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
746 #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
747 do { } while (0)
748 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
749 #define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0)
750 #endif
751 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
752 #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
753 #endif
754 #endif /* #else #ifdef CONFIG_RCU_TRACE */
755
756 #endif /* _TRACE_RCU_H */
757
758 /* This part must be outside protection */
759 #include "../../../probes/define_trace.h"
This page took 0.045268 seconds and 4 git commands to generate.