1
2#undef TRACE_SYSTEM
3#define TRACE_SYSTEM rcu
4
5#if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_RCU_H
7
8#include <linux/tracepoint.h>
9
10
11
12
13
14
15
16
17
18
19
20
21TRACE_EVENT(rcu_utilization,
22
23 TP_PROTO(const char *s),
24
25 TP_ARGS(s),
26
27 TP_STRUCT__entry(
28 __field(const char *, s)
29 ),
30
31 TP_fast_assign(
32 __entry->s = s;
33 ),
34
35 TP_printk("%s", __entry->s)
36);
37
38#ifdef CONFIG_RCU_TRACE
39
40#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65TRACE_EVENT(rcu_grace_period,
66
67 TP_PROTO(const char *rcuname, unsigned long gp_seq, const char *gpevent),
68
69 TP_ARGS(rcuname, gp_seq, gpevent),
70
71 TP_STRUCT__entry(
72 __field(const char *, rcuname)
73 __field(unsigned long, gp_seq)
74 __field(const char *, gpevent)
75 ),
76
77 TP_fast_assign(
78 __entry->rcuname = rcuname;
79 __entry->gp_seq = gp_seq;
80 __entry->gpevent = gpevent;
81 ),
82
83 TP_printk("%s %lu %s",
84 __entry->rcuname, __entry->gp_seq, __entry->gpevent)
85);
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104TRACE_EVENT(rcu_future_grace_period,
105
106 TP_PROTO(const char *rcuname, unsigned long gp_seq,
107 unsigned long gp_seq_req, u8 level, int grplo, int grphi,
108 const char *gpevent),
109
110 TP_ARGS(rcuname, gp_seq, gp_seq_req, level, grplo, grphi, gpevent),
111
112 TP_STRUCT__entry(
113 __field(const char *, rcuname)
114 __field(unsigned long, gp_seq)
115 __field(unsigned long, gp_seq_req)
116 __field(u8, level)
117 __field(int, grplo)
118 __field(int, grphi)
119 __field(const char *, gpevent)
120 ),
121
122 TP_fast_assign(
123 __entry->rcuname = rcuname;
124 __entry->gp_seq = gp_seq;
125 __entry->gp_seq_req = gp_seq_req;
126 __entry->level = level;
127 __entry->grplo = grplo;
128 __entry->grphi = grphi;
129 __entry->gpevent = gpevent;
130 ),
131
132 TP_printk("%s %lu %lu %u %d %d %s",
133 __entry->rcuname, __entry->gp_seq, __entry->gp_seq_req, __entry->level,
134 __entry->grplo, __entry->grphi, __entry->gpevent)
135);
136
137
138
139
140
141
142
143
144TRACE_EVENT(rcu_grace_period_init,
145
146 TP_PROTO(const char *rcuname, unsigned long gp_seq, u8 level,
147 int grplo, int grphi, unsigned long qsmask),
148
149 TP_ARGS(rcuname, gp_seq, level, grplo, grphi, qsmask),
150
151 TP_STRUCT__entry(
152 __field(const char *, rcuname)
153 __field(unsigned long, gp_seq)
154 __field(u8, level)
155 __field(int, grplo)
156 __field(int, grphi)
157 __field(unsigned long, qsmask)
158 ),
159
160 TP_fast_assign(
161 __entry->rcuname = rcuname;
162 __entry->gp_seq = gp_seq;
163 __entry->level = level;
164 __entry->grplo = grplo;
165 __entry->grphi = grphi;
166 __entry->qsmask = qsmask;
167 ),
168
169 TP_printk("%s %lu %u %d %d %lx",
170 __entry->rcuname, __entry->gp_seq, __entry->level,
171 __entry->grplo, __entry->grphi, __entry->qsmask)
172);
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189TRACE_EVENT(rcu_exp_grace_period,
190
191 TP_PROTO(const char *rcuname, unsigned long gpseq, const char *gpevent),
192
193 TP_ARGS(rcuname, gpseq, gpevent),
194
195 TP_STRUCT__entry(
196 __field(const char *, rcuname)
197 __field(unsigned long, gpseq)
198 __field(const char *, gpevent)
199 ),
200
201 TP_fast_assign(
202 __entry->rcuname = rcuname;
203 __entry->gpseq = gpseq;
204 __entry->gpevent = gpevent;
205 ),
206
207 TP_printk("%s %lu %s",
208 __entry->rcuname, __entry->gpseq, __entry->gpevent)
209);
210
211
212
213
214
215
216
217
218
219
220
221TRACE_EVENT(rcu_exp_funnel_lock,
222
223 TP_PROTO(const char *rcuname, u8 level, int grplo, int grphi,
224 const char *gpevent),
225
226 TP_ARGS(rcuname, level, grplo, grphi, gpevent),
227
228 TP_STRUCT__entry(
229 __field(const char *, rcuname)
230 __field(u8, level)
231 __field(int, grplo)
232 __field(int, grphi)
233 __field(const char *, gpevent)
234 ),
235
236 TP_fast_assign(
237 __entry->rcuname = rcuname;
238 __entry->level = level;
239 __entry->grplo = grplo;
240 __entry->grphi = grphi;
241 __entry->gpevent = gpevent;
242 ),
243
244 TP_printk("%s %d %d %d %s",
245 __entry->rcuname, __entry->level, __entry->grplo,
246 __entry->grphi, __entry->gpevent)
247);
248
249#ifdef CONFIG_RCU_NOCB_CPU
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272TRACE_EVENT(rcu_nocb_wake,
273
274 TP_PROTO(const char *rcuname, int cpu, const char *reason),
275
276 TP_ARGS(rcuname, cpu, reason),
277
278 TP_STRUCT__entry(
279 __field(const char *, rcuname)
280 __field(int, cpu)
281 __field(const char *, reason)
282 ),
283
284 TP_fast_assign(
285 __entry->rcuname = rcuname;
286 __entry->cpu = cpu;
287 __entry->reason = reason;
288 ),
289
290 TP_printk("%s %d %s", __entry->rcuname, __entry->cpu, __entry->reason)
291);
292#endif
293
294
295
296
297
298
299
300TRACE_EVENT(rcu_preempt_task,
301
302 TP_PROTO(const char *rcuname, int pid, unsigned long gp_seq),
303
304 TP_ARGS(rcuname, pid, gp_seq),
305
306 TP_STRUCT__entry(
307 __field(const char *, rcuname)
308 __field(unsigned long, gp_seq)
309 __field(int, pid)
310 ),
311
312 TP_fast_assign(
313 __entry->rcuname = rcuname;
314 __entry->gp_seq = gp_seq;
315 __entry->pid = pid;
316 ),
317
318 TP_printk("%s %lu %d",
319 __entry->rcuname, __entry->gp_seq, __entry->pid)
320);
321
322
323
324
325
326
327TRACE_EVENT(rcu_unlock_preempted_task,
328
329 TP_PROTO(const char *rcuname, unsigned long gp_seq, int pid),
330
331 TP_ARGS(rcuname, gp_seq, pid),
332
333 TP_STRUCT__entry(
334 __field(const char *, rcuname)
335 __field(unsigned long, gp_seq)
336 __field(int, pid)
337 ),
338
339 TP_fast_assign(
340 __entry->rcuname = rcuname;
341 __entry->gp_seq = gp_seq;
342 __entry->pid = pid;
343 ),
344
345 TP_printk("%s %lu %d", __entry->rcuname, __entry->gp_seq, __entry->pid)
346);
347
348
349
350
351
352
353
354
355
356TRACE_EVENT(rcu_quiescent_state_report,
357
358 TP_PROTO(const char *rcuname, unsigned long gp_seq,
359 unsigned long mask, unsigned long qsmask,
360 u8 level, int grplo, int grphi, int gp_tasks),
361
362 TP_ARGS(rcuname, gp_seq, mask, qsmask, level, grplo, grphi, gp_tasks),
363
364 TP_STRUCT__entry(
365 __field(const char *, rcuname)
366 __field(unsigned long, gp_seq)
367 __field(unsigned long, mask)
368 __field(unsigned long, qsmask)
369 __field(u8, level)
370 __field(int, grplo)
371 __field(int, grphi)
372 __field(u8, gp_tasks)
373 ),
374
375 TP_fast_assign(
376 __entry->rcuname = rcuname;
377 __entry->gp_seq = gp_seq;
378 __entry->mask = mask;
379 __entry->qsmask = qsmask;
380 __entry->level = level;
381 __entry->grplo = grplo;
382 __entry->grphi = grphi;
383 __entry->gp_tasks = gp_tasks;
384 ),
385
386 TP_printk("%s %lu %lx>%lx %u %d %d %u",
387 __entry->rcuname, __entry->gp_seq,
388 __entry->mask, __entry->qsmask, __entry->level,
389 __entry->grplo, __entry->grphi, __entry->gp_tasks)
390);
391
392
393
394
395
396
397
398
399TRACE_EVENT(rcu_fqs,
400
401 TP_PROTO(const char *rcuname, unsigned long gp_seq, int cpu, const char *qsevent),
402
403 TP_ARGS(rcuname, gp_seq, cpu, qsevent),
404
405 TP_STRUCT__entry(
406 __field(const char *, rcuname)
407 __field(unsigned long, gp_seq)
408 __field(int, cpu)
409 __field(const char *, qsevent)
410 ),
411
412 TP_fast_assign(
413 __entry->rcuname = rcuname;
414 __entry->gp_seq = gp_seq;
415 __entry->cpu = cpu;
416 __entry->qsevent = qsevent;
417 ),
418
419 TP_printk("%s %lu %d %s",
420 __entry->rcuname, __entry->gp_seq,
421 __entry->cpu, __entry->qsevent)
422);
423
424#endif
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439TRACE_EVENT(rcu_dyntick,
440
441 TP_PROTO(const char *polarity, long oldnesting, long newnesting, atomic_t dynticks),
442
443 TP_ARGS(polarity, oldnesting, newnesting, dynticks),
444
445 TP_STRUCT__entry(
446 __field(const char *, polarity)
447 __field(long, oldnesting)
448 __field(long, newnesting)
449 __field(int, dynticks)
450 ),
451
452 TP_fast_assign(
453 __entry->polarity = polarity;
454 __entry->oldnesting = oldnesting;
455 __entry->newnesting = newnesting;
456 __entry->dynticks = atomic_read(&dynticks);
457 ),
458
459 TP_printk("%s %lx %lx %#3x", __entry->polarity,
460 __entry->oldnesting, __entry->newnesting,
461 __entry->dynticks & 0xfff)
462);
463
464
465
466
467
468
469
470
471TRACE_EVENT(rcu_callback,
472
473 TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
474 long qlen),
475
476 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
477
478 TP_STRUCT__entry(
479 __field(const char *, rcuname)
480 __field(void *, rhp)
481 __field(void *, func)
482 __field(long, qlen_lazy)
483 __field(long, qlen)
484 ),
485
486 TP_fast_assign(
487 __entry->rcuname = rcuname;
488 __entry->rhp = rhp;
489 __entry->func = rhp->func;
490 __entry->qlen_lazy = qlen_lazy;
491 __entry->qlen = qlen;
492 ),
493
494 TP_printk("%s rhp=%p func=%pf %ld/%ld",
495 __entry->rcuname, __entry->rhp, __entry->func,
496 __entry->qlen_lazy, __entry->qlen)
497);
498
499
500
501
502
503
504
505
506
507TRACE_EVENT(rcu_kfree_callback,
508
509 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
510 long qlen_lazy, long qlen),
511
512 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
513
514 TP_STRUCT__entry(
515 __field(const char *, rcuname)
516 __field(void *, rhp)
517 __field(unsigned long, offset)
518 __field(long, qlen_lazy)
519 __field(long, qlen)
520 ),
521
522 TP_fast_assign(
523 __entry->rcuname = rcuname;
524 __entry->rhp = rhp;
525 __entry->offset = offset;
526 __entry->qlen_lazy = qlen_lazy;
527 __entry->qlen = qlen;
528 ),
529
530 TP_printk("%s rhp=%p func=%ld %ld/%ld",
531 __entry->rcuname, __entry->rhp, __entry->offset,
532 __entry->qlen_lazy, __entry->qlen)
533);
534
535
536
537
538
539
540
541
542TRACE_EVENT(rcu_batch_start,
543
544 TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
545
546 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
547
548 TP_STRUCT__entry(
549 __field(const char *, rcuname)
550 __field(long, qlen_lazy)
551 __field(long, qlen)
552 __field(long, blimit)
553 ),
554
555 TP_fast_assign(
556 __entry->rcuname = rcuname;
557 __entry->qlen_lazy = qlen_lazy;
558 __entry->qlen = qlen;
559 __entry->blimit = blimit;
560 ),
561
562 TP_printk("%s CBs=%ld/%ld bl=%ld",
563 __entry->rcuname, __entry->qlen_lazy, __entry->qlen,
564 __entry->blimit)
565);
566
567
568
569
570
571
572TRACE_EVENT(rcu_invoke_callback,
573
574 TP_PROTO(const char *rcuname, struct rcu_head *rhp),
575
576 TP_ARGS(rcuname, rhp),
577
578 TP_STRUCT__entry(
579 __field(const char *, rcuname)
580 __field(void *, rhp)
581 __field(void *, func)
582 ),
583
584 TP_fast_assign(
585 __entry->rcuname = rcuname;
586 __entry->rhp = rhp;
587 __entry->func = rhp->func;
588 ),
589
590 TP_printk("%s rhp=%p func=%pf",
591 __entry->rcuname, __entry->rhp, __entry->func)
592);
593
594
595
596
597
598
599
600
601TRACE_EVENT(rcu_invoke_kfree_callback,
602
603 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
604
605 TP_ARGS(rcuname, rhp, offset),
606
607 TP_STRUCT__entry(
608 __field(const char *, rcuname)
609 __field(void *, rhp)
610 __field(unsigned long, offset)
611 ),
612
613 TP_fast_assign(
614 __entry->rcuname = rcuname;
615 __entry->rhp = rhp;
616 __entry->offset = offset;
617 ),
618
619 TP_printk("%s rhp=%p func=%ld",
620 __entry->rcuname, __entry->rhp, __entry->offset)
621);
622
623
624
625
626
627
628
629
630
631
632
633
634TRACE_EVENT(rcu_batch_end,
635
636 TP_PROTO(const char *rcuname, int callbacks_invoked,
637 char cb, char nr, char iit, char risk),
638
639 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
640
641 TP_STRUCT__entry(
642 __field(const char *, rcuname)
643 __field(int, callbacks_invoked)
644 __field(char, cb)
645 __field(char, nr)
646 __field(char, iit)
647 __field(char, risk)
648 ),
649
650 TP_fast_assign(
651 __entry->rcuname = rcuname;
652 __entry->callbacks_invoked = callbacks_invoked;
653 __entry->cb = cb;
654 __entry->nr = nr;
655 __entry->iit = iit;
656 __entry->risk = risk;
657 ),
658
659 TP_printk("%s CBs-invoked=%d idle=%c%c%c%c",
660 __entry->rcuname, __entry->callbacks_invoked,
661 __entry->cb ? 'C' : '.',
662 __entry->nr ? 'S' : '.',
663 __entry->iit ? 'I' : '.',
664 __entry->risk ? 'R' : '.')
665);
666
667
668
669
670
671
672
673
674
675#define RCUTORTURENAME_LEN 8
676TRACE_EVENT(rcu_torture_read,
677
678 TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
679 unsigned long secs, unsigned long c_old, unsigned long c),
680
681 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
682
683 TP_STRUCT__entry(
684 __field(char, rcutorturename[RCUTORTURENAME_LEN])
685 __field(struct rcu_head *, rhp)
686 __field(unsigned long, secs)
687 __field(unsigned long, c_old)
688 __field(unsigned long, c)
689 ),
690
691 TP_fast_assign(
692 strncpy(__entry->rcutorturename, rcutorturename,
693 RCUTORTURENAME_LEN);
694 __entry->rcutorturename[RCUTORTURENAME_LEN - 1] = 0;
695 __entry->rhp = rhp;
696 __entry->secs = secs;
697 __entry->c_old = c_old;
698 __entry->c = c;
699 ),
700
701 TP_printk("%s torture read %p %luus c: %lu %lu",
702 __entry->rcutorturename, __entry->rhp,
703 __entry->secs, __entry->c_old, __entry->c)
704);
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724TRACE_EVENT(rcu_barrier,
725
726 TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
727
728 TP_ARGS(rcuname, s, cpu, cnt, done),
729
730 TP_STRUCT__entry(
731 __field(const char *, rcuname)
732 __field(const char *, s)
733 __field(int, cpu)
734 __field(int, cnt)
735 __field(unsigned long, done)
736 ),
737
738 TP_fast_assign(
739 __entry->rcuname = rcuname;
740 __entry->s = s;
741 __entry->cpu = cpu;
742 __entry->cnt = cnt;
743 __entry->done = done;
744 ),
745
746 TP_printk("%s %s cpu %d remaining %d # %lu",
747 __entry->rcuname, __entry->s, __entry->cpu, __entry->cnt,
748 __entry->done)
749);
750
751#else
752
753#define trace_rcu_grace_period(rcuname, gp_seq, gpevent) do { } while (0)
754#define trace_rcu_future_grace_period(rcuname, gp_seq, gp_seq_req, \
755 level, grplo, grphi, event) \
756 do { } while (0)
757#define trace_rcu_grace_period_init(rcuname, gp_seq, level, grplo, grphi, \
758 qsmask) do { } while (0)
759#define trace_rcu_exp_grace_period(rcuname, gqseq, gpevent) \
760 do { } while (0)
761#define trace_rcu_exp_funnel_lock(rcuname, level, grplo, grphi, gpevent) \
762 do { } while (0)
763#define trace_rcu_nocb_wake(rcuname, cpu, reason) do { } while (0)
764#define trace_rcu_preempt_task(rcuname, pid, gp_seq) do { } while (0)
765#define trace_rcu_unlock_preempted_task(rcuname, gp_seq, pid) do { } while (0)
766#define trace_rcu_quiescent_state_report(rcuname, gp_seq, mask, qsmask, level, \
767 grplo, grphi, gp_tasks) do { } \
768 while (0)
769#define trace_rcu_fqs(rcuname, gp_seq, cpu, qsevent) do { } while (0)
770#define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0)
771#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
772#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
773 do { } while (0)
774#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
775 do { } while (0)
776#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
777#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
778#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
779 do { } while (0)
780#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
781 do { } while (0)
782#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
783
784#endif
785
786#endif
787
788
789#include <trace/define_trace.h>
790