hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/include/trace/events/rcu.h
....@@ -7,6 +7,12 @@
77
88 #include <linux/tracepoint.h>
99
10
+#ifdef CONFIG_RCU_TRACE
11
+#define TRACE_EVENT_RCU TRACE_EVENT
12
+#else
13
+#define TRACE_EVENT_RCU TRACE_EVENT_NOP
14
+#endif
15
+
1016 /*
1117 * Tracepoint for start/end markers used for utilization calculations.
1218 * By convention, the string is of the following forms:
....@@ -35,9 +41,7 @@
3541 TP_printk("%s", __entry->s)
3642 );
3743
38
-#ifdef CONFIG_RCU_TRACE
39
-
40
-#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
44
+#if defined(CONFIG_TREE_RCU)
4145
4246 /*
4347 * Tracepoint for grace-period events. Takes a string identifying the
....@@ -62,7 +66,7 @@
6266 * "end": End a grace period.
6367 * "cpuend": CPU first notices a grace-period end.
6468 */
65
-TRACE_EVENT(rcu_grace_period,
69
+TRACE_EVENT_RCU(rcu_grace_period,
6670
6771 TP_PROTO(const char *rcuname, unsigned long gp_seq, const char *gpevent),
6872
....@@ -70,17 +74,17 @@
7074
7175 TP_STRUCT__entry(
7276 __field(const char *, rcuname)
73
- __field(unsigned long, gp_seq)
77
+ __field(long, gp_seq)
7478 __field(const char *, gpevent)
7579 ),
7680
7781 TP_fast_assign(
7882 __entry->rcuname = rcuname;
79
- __entry->gp_seq = gp_seq;
83
+ __entry->gp_seq = (long)gp_seq;
8084 __entry->gpevent = gpevent;
8185 ),
8286
83
- TP_printk("%s %lu %s",
87
+ TP_printk("%s %ld %s",
8488 __entry->rcuname, __entry->gp_seq, __entry->gpevent)
8589 );
8690
....@@ -89,19 +93,18 @@
8993 * the data from the rcu_node structure, other than rcuname, which comes
9094 * from the rcu_state structure, and event, which is one of the following:
9195 *
92
- * "Startleaf": Request a grace period based on leaf-node data.
96
+ * "Cleanup": Clean up rcu_node structure after previous GP.
97
+ * "CleanupMore": Clean up, and another GP is needed.
98
+ * "EndWait": Complete wait.
99
+ * "NoGPkthread": The RCU grace-period kthread has not yet started.
93100 * "Prestarted": Someone beat us to the request
94101 * "Startedleaf": Leaf node marked for future GP.
95102 * "Startedleafroot": All nodes from leaf to root marked for future GP.
96103 * "Startedroot": Requested a nocb grace period based on root-node data.
97
- * "NoGPkthread": The RCU grace-period kthread has not yet started.
104
+ * "Startleaf": Request a grace period based on leaf-node data.
98105 * "StartWait": Start waiting for the requested grace period.
99
- * "ResumeWait": Resume waiting after signal.
100
- * "EndWait": Complete wait.
101
- * "Cleanup": Clean up rcu_node structure after previous GP.
102
- * "CleanupMore": Clean up, and another GP is needed.
103106 */
104
-TRACE_EVENT(rcu_future_grace_period,
107
+TRACE_EVENT_RCU(rcu_future_grace_period,
105108
106109 TP_PROTO(const char *rcuname, unsigned long gp_seq,
107110 unsigned long gp_seq_req, u8 level, int grplo, int grphi,
....@@ -111,8 +114,8 @@
111114
112115 TP_STRUCT__entry(
113116 __field(const char *, rcuname)
114
- __field(unsigned long, gp_seq)
115
- __field(unsigned long, gp_seq_req)
117
+ __field(long, gp_seq)
118
+ __field(long, gp_seq_req)
116119 __field(u8, level)
117120 __field(int, grplo)
118121 __field(int, grphi)
....@@ -121,16 +124,16 @@
121124
122125 TP_fast_assign(
123126 __entry->rcuname = rcuname;
124
- __entry->gp_seq = gp_seq;
125
- __entry->gp_seq_req = gp_seq_req;
127
+ __entry->gp_seq = (long)gp_seq;
128
+ __entry->gp_seq_req = (long)gp_seq_req;
126129 __entry->level = level;
127130 __entry->grplo = grplo;
128131 __entry->grphi = grphi;
129132 __entry->gpevent = gpevent;
130133 ),
131134
132
- TP_printk("%s %lu %lu %u %d %d %s",
133
- __entry->rcuname, __entry->gp_seq, __entry->gp_seq_req, __entry->level,
135
+ TP_printk("%s %ld %ld %u %d %d %s",
136
+ __entry->rcuname, (long)__entry->gp_seq, (long)__entry->gp_seq_req, __entry->level,
134137 __entry->grplo, __entry->grphi, __entry->gpevent)
135138 );
136139
....@@ -141,7 +144,7 @@
141144 * rcu_node structure, and the mask of CPUs that will be waited for.
142145 * All but the type of RCU are extracted from the rcu_node structure.
143146 */
144
-TRACE_EVENT(rcu_grace_period_init,
147
+TRACE_EVENT_RCU(rcu_grace_period_init,
145148
146149 TP_PROTO(const char *rcuname, unsigned long gp_seq, u8 level,
147150 int grplo, int grphi, unsigned long qsmask),
....@@ -150,7 +153,7 @@
150153
151154 TP_STRUCT__entry(
152155 __field(const char *, rcuname)
153
- __field(unsigned long, gp_seq)
156
+ __field(long, gp_seq)
154157 __field(u8, level)
155158 __field(int, grplo)
156159 __field(int, grphi)
....@@ -159,14 +162,14 @@
159162
160163 TP_fast_assign(
161164 __entry->rcuname = rcuname;
162
- __entry->gp_seq = gp_seq;
165
+ __entry->gp_seq = (long)gp_seq;
163166 __entry->level = level;
164167 __entry->grplo = grplo;
165168 __entry->grphi = grphi;
166169 __entry->qsmask = qsmask;
167170 ),
168171
169
- TP_printk("%s %lu %u %d %d %lx",
172
+ TP_printk("%s %ld %u %d %d %lx",
170173 __entry->rcuname, __entry->gp_seq, __entry->level,
171174 __entry->grplo, __entry->grphi, __entry->qsmask)
172175 );
....@@ -186,7 +189,7 @@
186189 * "endwake": Woke piggybackers up.
187190 * "done": Someone else did the expedited grace period for us.
188191 */
189
-TRACE_EVENT(rcu_exp_grace_period,
192
+TRACE_EVENT_RCU(rcu_exp_grace_period,
190193
191194 TP_PROTO(const char *rcuname, unsigned long gpseq, const char *gpevent),
192195
....@@ -194,17 +197,17 @@
194197
195198 TP_STRUCT__entry(
196199 __field(const char *, rcuname)
197
- __field(unsigned long, gpseq)
200
+ __field(long, gpseq)
198201 __field(const char *, gpevent)
199202 ),
200203
201204 TP_fast_assign(
202205 __entry->rcuname = rcuname;
203
- __entry->gpseq = gpseq;
206
+ __entry->gpseq = (long)gpseq;
204207 __entry->gpevent = gpevent;
205208 ),
206209
207
- TP_printk("%s %lu %s",
210
+ TP_printk("%s %ld %s",
208211 __entry->rcuname, __entry->gpseq, __entry->gpevent)
209212 );
210213
....@@ -218,7 +221,7 @@
218221 * "nxtlvl": Advance to next level of rcu_node funnel
219222 * "wait": Wait for someone else to do expedited GP
220223 */
221
-TRACE_EVENT(rcu_exp_funnel_lock,
224
+TRACE_EVENT_RCU(rcu_exp_funnel_lock,
222225
223226 TP_PROTO(const char *rcuname, u8 level, int grplo, int grphi,
224227 const char *gpevent),
....@@ -255,21 +258,29 @@
255258 * the number of the offloaded CPU are extracted. The third and final
256259 * argument is a string as follows:
257260 *
258
- * "WakeEmpty": Wake rcuo kthread, first CB to empty list.
259
- * "WakeEmptyIsDeferred": Wake rcuo kthread later, first CB to empty list.
260
- * "WakeOvf": Wake rcuo kthread, CB list is huge.
261
- * "WakeOvfIsDeferred": Wake rcuo kthread later, CB list is huge.
262
- * "WakeNot": Don't wake rcuo kthread.
263
- * "WakeNotPoll": Don't wake rcuo kthread because it is polling.
264
- * "DeferredWake": Carried out the "IsDeferred" wakeup.
265
- * "Poll": Start of new polling cycle for rcu_nocb_poll.
266
- * "Sleep": Sleep waiting for CBs for !rcu_nocb_poll.
267
- * "WokeEmpty": rcuo kthread woke to find empty list.
268
- * "WokeNonEmpty": rcuo kthread woke to find non-empty list.
269
- * "WaitQueue": Enqueue partially done, timed wait for it to complete.
270
- * "WokeQueue": Partial enqueue now complete.
261
+ * "AlreadyAwake": The to-be-awakened rcuo kthread is already awake.
262
+ * "Bypass": rcuo GP kthread sees non-empty ->nocb_bypass.
263
+ * "CBSleep": rcuo CB kthread sleeping waiting for CBs.
264
+ * "Check": rcuo GP kthread checking specified CPU for work.
265
+ * "DeferredWake": Timer expired or polled check, time to wake.
266
+ * "DoWake": The to-be-awakened rcuo kthread needs to be awakened.
267
+ * "EndSleep": Done waiting for GP for !rcu_nocb_poll.
268
+ * "FirstBQ": New CB to empty ->nocb_bypass (->cblist maybe non-empty).
269
+ * "FirstBQnoWake": FirstBQ plus rcuo kthread need not be awakened.
270
+ * "FirstBQwake": FirstBQ plus rcuo kthread must be awakened.
271
+ * "FirstQ": New CB to empty ->cblist (->nocb_bypass maybe non-empty).
272
+ * "NeedWaitGP": rcuo GP kthread must wait on a grace period.
273
+ * "Poll": Start of new polling cycle for rcu_nocb_poll.
274
+ * "Sleep": Sleep waiting for GP for !rcu_nocb_poll.
275
+ * "Timer": Deferred-wake timer expired.
276
+ * "WakeEmptyIsDeferred": Wake rcuo kthread later, first CB to empty list.
277
+ * "WakeEmpty": Wake rcuo kthread, first CB to empty list.
278
+ * "WakeNot": Don't wake rcuo kthread.
279
+ * "WakeNotPoll": Don't wake rcuo kthread because it is polling.
280
+ * "WakeOvfIsDeferred": Wake rcuo kthread later, CB list is huge.
281
+ * "WokeEmpty": rcuo CB kthread woke to find empty list.
271282 */
272
-TRACE_EVENT(rcu_nocb_wake,
283
+TRACE_EVENT_RCU(rcu_nocb_wake,
273284
274285 TP_PROTO(const char *rcuname, int cpu, const char *reason),
275286
....@@ -297,7 +308,7 @@
297308 * include SRCU), the grace-period number that the task is blocking
298309 * (the current or the next), and the task's PID.
299310 */
300
-TRACE_EVENT(rcu_preempt_task,
311
+TRACE_EVENT_RCU(rcu_preempt_task,
301312
302313 TP_PROTO(const char *rcuname, int pid, unsigned long gp_seq),
303314
....@@ -305,17 +316,17 @@
305316
306317 TP_STRUCT__entry(
307318 __field(const char *, rcuname)
308
- __field(unsigned long, gp_seq)
319
+ __field(long, gp_seq)
309320 __field(int, pid)
310321 ),
311322
312323 TP_fast_assign(
313324 __entry->rcuname = rcuname;
314
- __entry->gp_seq = gp_seq;
325
+ __entry->gp_seq = (long)gp_seq;
315326 __entry->pid = pid;
316327 ),
317328
318
- TP_printk("%s %lu %d",
329
+ TP_printk("%s %ld %d",
319330 __entry->rcuname, __entry->gp_seq, __entry->pid)
320331 );
321332
....@@ -324,7 +335,7 @@
324335 * read-side critical section exiting that critical section. Track the
325336 * type of RCU (which one day might include SRCU) and the task's PID.
326337 */
327
-TRACE_EVENT(rcu_unlock_preempted_task,
338
+TRACE_EVENT_RCU(rcu_unlock_preempted_task,
328339
329340 TP_PROTO(const char *rcuname, unsigned long gp_seq, int pid),
330341
....@@ -332,17 +343,17 @@
332343
333344 TP_STRUCT__entry(
334345 __field(const char *, rcuname)
335
- __field(unsigned long, gp_seq)
346
+ __field(long, gp_seq)
336347 __field(int, pid)
337348 ),
338349
339350 TP_fast_assign(
340351 __entry->rcuname = rcuname;
341
- __entry->gp_seq = gp_seq;
352
+ __entry->gp_seq = (long)gp_seq;
342353 __entry->pid = pid;
343354 ),
344355
345
- TP_printk("%s %lu %d", __entry->rcuname, __entry->gp_seq, __entry->pid)
356
+ TP_printk("%s %ld %d", __entry->rcuname, __entry->gp_seq, __entry->pid)
346357 );
347358
348359 /*
....@@ -353,7 +364,7 @@
353364 * whether there are any blocked tasks blocking the current grace period.
354365 * All but the type of RCU are extracted from the rcu_node structure.
355366 */
356
-TRACE_EVENT(rcu_quiescent_state_report,
367
+TRACE_EVENT_RCU(rcu_quiescent_state_report,
357368
358369 TP_PROTO(const char *rcuname, unsigned long gp_seq,
359370 unsigned long mask, unsigned long qsmask,
....@@ -363,7 +374,7 @@
363374
364375 TP_STRUCT__entry(
365376 __field(const char *, rcuname)
366
- __field(unsigned long, gp_seq)
377
+ __field(long, gp_seq)
367378 __field(unsigned long, mask)
368379 __field(unsigned long, qsmask)
369380 __field(u8, level)
....@@ -374,7 +385,7 @@
374385
375386 TP_fast_assign(
376387 __entry->rcuname = rcuname;
377
- __entry->gp_seq = gp_seq;
388
+ __entry->gp_seq = (long)gp_seq;
378389 __entry->mask = mask;
379390 __entry->qsmask = qsmask;
380391 __entry->level = level;
....@@ -383,7 +394,7 @@
383394 __entry->gp_tasks = gp_tasks;
384395 ),
385396
386
- TP_printk("%s %lu %lx>%lx %u %d %d %u",
397
+ TP_printk("%s %ld %lx>%lx %u %d %d %u",
387398 __entry->rcuname, __entry->gp_seq,
388399 __entry->mask, __entry->qsmask, __entry->level,
389400 __entry->grplo, __entry->grphi, __entry->gp_tasks)
....@@ -393,11 +404,10 @@
393404 * Tracepoint for quiescent states detected by force_quiescent_state().
394405 * These trace events include the type of RCU, the grace-period number
395406 * that was blocked by the CPU, the CPU itself, and the type of quiescent
396
- * state, which can be "dti" for dyntick-idle mode, "kick" when kicking
397
- * a CPU that has been in dyntick-idle mode for too long, or "rqc" if the
398
- * CPU got a quiescent state via its rcu_qs_ctr.
407
+ * state, which can be "dti" for dyntick-idle mode or "kick" when kicking
408
+ * a CPU that has been in dyntick-idle mode for too long.
399409 */
400
-TRACE_EVENT(rcu_fqs,
410
+TRACE_EVENT_RCU(rcu_fqs,
401411
402412 TP_PROTO(const char *rcuname, unsigned long gp_seq, int cpu, const char *qsevent),
403413
....@@ -405,31 +415,60 @@
405415
406416 TP_STRUCT__entry(
407417 __field(const char *, rcuname)
408
- __field(unsigned long, gp_seq)
418
+ __field(long, gp_seq)
409419 __field(int, cpu)
410420 __field(const char *, qsevent)
411421 ),
412422
413423 TP_fast_assign(
414424 __entry->rcuname = rcuname;
415
- __entry->gp_seq = gp_seq;
425
+ __entry->gp_seq = (long)gp_seq;
416426 __entry->cpu = cpu;
417427 __entry->qsevent = qsevent;
418428 ),
419429
420
- TP_printk("%s %lu %d %s",
430
+ TP_printk("%s %ld %d %s",
421431 __entry->rcuname, __entry->gp_seq,
422432 __entry->cpu, __entry->qsevent)
423433 );
424434
425
-#endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) */
435
+/*
436
+ * Tracepoint for RCU stall events. Takes a string identifying the RCU flavor
437
+ * and a string identifying which function detected the RCU stall as follows:
438
+ *
439
+ * "StallDetected": Scheduler-tick detects other CPU's stalls.
440
+ * "SelfDetected": Scheduler-tick detects a current CPU's stall.
441
+ * "ExpeditedStall": Expedited grace period detects stalls.
442
+ */
443
+TRACE_EVENT(rcu_stall_warning,
444
+
445
+ TP_PROTO(const char *rcuname, const char *msg),
446
+
447
+ TP_ARGS(rcuname, msg),
448
+
449
+ TP_STRUCT__entry(
450
+ __field(const char *, rcuname)
451
+ __field(const char *, msg)
452
+ ),
453
+
454
+ TP_fast_assign(
455
+ __entry->rcuname = rcuname;
456
+ __entry->msg = msg;
457
+ ),
458
+
459
+ TP_printk("%s %s",
460
+ __entry->rcuname, __entry->msg)
461
+);
462
+
463
+#endif /* #if defined(CONFIG_TREE_RCU) */
426464
427465 /*
428
- * Tracepoint for dyntick-idle entry/exit events. These take a string
429
- * as argument: "Start" for entering dyntick-idle mode, "Startirq" for
430
- * entering it from irq/NMI, "End" for leaving it, "Endirq" for leaving it
431
- * to irq/NMI, "--=" for events moving towards idle, and "++=" for events
432
- * moving away from idle.
466
+ * Tracepoint for dyntick-idle entry/exit events. These take 2 strings
467
+ * as argument:
468
+ * polarity: "Start", "End", "StillNonIdle" for entering, exiting or still not
469
+ * being in dyntick-idle mode.
470
+ * context: "USER" or "IDLE" or "IRQ".
471
+ * NMIs nested in IRQs are inferred with dynticks_nesting > 1 in IRQ context.
433472 *
434473 * These events also take a pair of numbers, which indicate the nesting
435474 * depth before and after the event of interest, and a third number that is
....@@ -437,9 +476,9 @@
437476 * events use two separate counters, and that the "++=" and "--=" events
438477 * for irq/NMI will change the counter by two, otherwise by one.
439478 */
440
-TRACE_EVENT(rcu_dyntick,
479
+TRACE_EVENT_RCU(rcu_dyntick,
441480
442
- TP_PROTO(const char *polarity, long oldnesting, long newnesting, atomic_t dynticks),
481
+ TP_PROTO(const char *polarity, long oldnesting, long newnesting, int dynticks),
443482
444483 TP_ARGS(polarity, oldnesting, newnesting, dynticks),
445484
....@@ -454,7 +493,7 @@
454493 __entry->polarity = polarity;
455494 __entry->oldnesting = oldnesting;
456495 __entry->newnesting = newnesting;
457
- __entry->dynticks = atomic_read(&dynticks);
496
+ __entry->dynticks = dynticks;
458497 ),
459498
460499 TP_printk("%s %lx %lx %#3x", __entry->polarity,
....@@ -469,18 +508,16 @@
469508 * number of lazy callbacks queued, and the fourth element is the
470509 * total number of callbacks queued.
471510 */
472
-TRACE_EVENT(rcu_callback,
511
+TRACE_EVENT_RCU(rcu_callback,
473512
474
- TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
475
- long qlen),
513
+ TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen),
476514
477
- TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
515
+ TP_ARGS(rcuname, rhp, qlen),
478516
479517 TP_STRUCT__entry(
480518 __field(const char *, rcuname)
481519 __field(void *, rhp)
482520 __field(void *, func)
483
- __field(long, qlen_lazy)
484521 __field(long, qlen)
485522 ),
486523
....@@ -488,35 +525,33 @@
488525 __entry->rcuname = rcuname;
489526 __entry->rhp = rhp;
490527 __entry->func = rhp->func;
491
- __entry->qlen_lazy = qlen_lazy;
492528 __entry->qlen = qlen;
493529 ),
494530
495
- TP_printk("%s rhp=%p func=%pf %ld/%ld",
531
+ TP_printk("%s rhp=%p func=%ps %ld",
496532 __entry->rcuname, __entry->rhp, __entry->func,
497
- __entry->qlen_lazy, __entry->qlen)
533
+ __entry->qlen)
498534 );
499535
500536 /*
501537 * Tracepoint for the registration of a single RCU callback of the special
502
- * kfree() form. The first argument is the RCU type, the second argument
538
+ * kvfree() form. The first argument is the RCU type, the second argument
503539 * is a pointer to the RCU callback, the third argument is the offset
504540 * of the callback within the enclosing RCU-protected data structure,
505541 * the fourth argument is the number of lazy callbacks queued, and the
506542 * fifth argument is the total number of callbacks queued.
507543 */
508
-TRACE_EVENT(rcu_kfree_callback,
544
+TRACE_EVENT_RCU(rcu_kvfree_callback,
509545
510546 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
511
- long qlen_lazy, long qlen),
547
+ long qlen),
512548
513
- TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
549
+ TP_ARGS(rcuname, rhp, offset, qlen),
514550
515551 TP_STRUCT__entry(
516552 __field(const char *, rcuname)
517553 __field(void *, rhp)
518554 __field(unsigned long, offset)
519
- __field(long, qlen_lazy)
520555 __field(long, qlen)
521556 ),
522557
....@@ -524,13 +559,12 @@
524559 __entry->rcuname = rcuname;
525560 __entry->rhp = rhp;
526561 __entry->offset = offset;
527
- __entry->qlen_lazy = qlen_lazy;
528562 __entry->qlen = qlen;
529563 ),
530564
531
- TP_printk("%s rhp=%p func=%ld %ld/%ld",
565
+ TP_printk("%s rhp=%p func=%ld %ld",
532566 __entry->rcuname, __entry->rhp, __entry->offset,
533
- __entry->qlen_lazy, __entry->qlen)
567
+ __entry->qlen)
534568 );
535569
536570 /*
....@@ -540,29 +574,26 @@
540574 * the total number of callbacks queued, and the fourth argument is
541575 * the current RCU-callback batch limit.
542576 */
543
-TRACE_EVENT(rcu_batch_start,
577
+TRACE_EVENT_RCU(rcu_batch_start,
544578
545
- TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
579
+ TP_PROTO(const char *rcuname, long qlen, long blimit),
546580
547
- TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
581
+ TP_ARGS(rcuname, qlen, blimit),
548582
549583 TP_STRUCT__entry(
550584 __field(const char *, rcuname)
551
- __field(long, qlen_lazy)
552585 __field(long, qlen)
553586 __field(long, blimit)
554587 ),
555588
556589 TP_fast_assign(
557590 __entry->rcuname = rcuname;
558
- __entry->qlen_lazy = qlen_lazy;
559591 __entry->qlen = qlen;
560592 __entry->blimit = blimit;
561593 ),
562594
563
- TP_printk("%s CBs=%ld/%ld bl=%ld",
564
- __entry->rcuname, __entry->qlen_lazy, __entry->qlen,
565
- __entry->blimit)
595
+ TP_printk("%s CBs=%ld bl=%ld",
596
+ __entry->rcuname, __entry->qlen, __entry->blimit)
566597 );
567598
568599 /*
....@@ -570,7 +601,7 @@
570601 * The first argument is the type of RCU, and the second argument is
571602 * a pointer to the RCU callback itself.
572603 */
573
-TRACE_EVENT(rcu_invoke_callback,
604
+TRACE_EVENT_RCU(rcu_invoke_callback,
574605
575606 TP_PROTO(const char *rcuname, struct rcu_head *rhp),
576607
....@@ -588,18 +619,18 @@
588619 __entry->func = rhp->func;
589620 ),
590621
591
- TP_printk("%s rhp=%p func=%pf",
622
+ TP_printk("%s rhp=%p func=%ps",
592623 __entry->rcuname, __entry->rhp, __entry->func)
593624 );
594625
595626 /*
596627 * Tracepoint for the invocation of a single RCU callback of the special
597
- * kfree() form. The first argument is the RCU flavor, the second
628
+ * kvfree() form. The first argument is the RCU flavor, the second
598629 * argument is a pointer to the RCU callback, and the third argument
599630 * is the offset of the callback within the enclosing RCU-protected
600631 * data structure.
601632 */
602
-TRACE_EVENT(rcu_invoke_kfree_callback,
633
+TRACE_EVENT_RCU(rcu_invoke_kvfree_callback,
603634
604635 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
605636
....@@ -622,6 +653,34 @@
622653 );
623654
624655 /*
656
+ * Tracepoint for the invocation of a single RCU callback of the special
657
+ * kfree_bulk() form. The first argument is the RCU flavor, the second
658
+ * argument is a number of elements in array to free, the third is an
659
+ * address of the array holding nr_records entries.
660
+ */
661
+TRACE_EVENT_RCU(rcu_invoke_kfree_bulk_callback,
662
+
663
+ TP_PROTO(const char *rcuname, unsigned long nr_records, void **p),
664
+
665
+ TP_ARGS(rcuname, nr_records, p),
666
+
667
+ TP_STRUCT__entry(
668
+ __field(const char *, rcuname)
669
+ __field(unsigned long, nr_records)
670
+ __field(void **, p)
671
+ ),
672
+
673
+ TP_fast_assign(
674
+ __entry->rcuname = rcuname;
675
+ __entry->nr_records = nr_records;
676
+ __entry->p = p;
677
+ ),
678
+
679
+ TP_printk("%s bulk=0x%p nr_records=%lu",
680
+ __entry->rcuname, __entry->p, __entry->nr_records)
681
+);
682
+
683
+/*
625684 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
626685 * invoked. The first argument is the name of the RCU flavor,
627686 * the second argument is number of callbacks actually invoked,
....@@ -632,7 +691,7 @@
632691 * and the sixth argument (risk) is the return value from
633692 * rcu_is_callbacks_kthread().
634693 */
635
-TRACE_EVENT(rcu_batch_end,
694
+TRACE_EVENT_RCU(rcu_batch_end,
636695
637696 TP_PROTO(const char *rcuname, int callbacks_invoked,
638697 char cb, char nr, char iit, char risk),
....@@ -674,7 +733,7 @@
674733 * callback address can be NULL.
675734 */
676735 #define RCUTORTURENAME_LEN 8
677
-TRACE_EVENT(rcu_torture_read,
736
+TRACE_EVENT_RCU(rcu_torture_read,
678737
679738 TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
680739 unsigned long secs, unsigned long c_old, unsigned long c),
....@@ -705,24 +764,23 @@
705764 );
706765
707766 /*
708
- * Tracepoint for _rcu_barrier() execution. The string "s" describes
709
- * the _rcu_barrier phase:
710
- * "Begin": _rcu_barrier() started.
711
- * "EarlyExit": _rcu_barrier() piggybacked, thus early exit.
712
- * "Inc1": _rcu_barrier() piggyback check counter incremented.
713
- * "OfflineNoCB": _rcu_barrier() found callback on never-online CPU
714
- * "OnlineNoCB": _rcu_barrier() found online no-CBs CPU.
715
- * "OnlineQ": _rcu_barrier() found online CPU with callbacks.
716
- * "OnlineNQ": _rcu_barrier() found online CPU, no callbacks.
767
+ * Tracepoint for rcu_barrier() execution. The string "s" describes
768
+ * the rcu_barrier phase:
769
+ * "Begin": rcu_barrier() started.
770
+ * "EarlyExit": rcu_barrier() piggybacked, thus early exit.
771
+ * "Inc1": rcu_barrier() piggyback check counter incremented.
772
+ * "OfflineNoCBQ": rcu_barrier() found offline no-CBs CPU with callbacks.
773
+ * "OnlineQ": rcu_barrier() found online CPU with callbacks.
774
+ * "OnlineNQ": rcu_barrier() found online CPU, no callbacks.
717775 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
718776 * "IRQNQ": An rcu_barrier_callback() callback found no callbacks.
719777 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
720778 * "LastCB": An rcu_barrier_callback() invoked the last callback.
721
- * "Inc2": _rcu_barrier() piggyback check counter incremented.
779
+ * "Inc2": rcu_barrier() piggyback check counter incremented.
722780 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
723781 * is the count of remaining callbacks, and "done" is the piggybacking count.
724782 */
725
-TRACE_EVENT(rcu_barrier,
783
+TRACE_EVENT_RCU(rcu_barrier,
726784
727785 TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
728786
....@@ -748,41 +806,6 @@
748806 __entry->rcuname, __entry->s, __entry->cpu, __entry->cnt,
749807 __entry->done)
750808 );
751
-
752
-#else /* #ifdef CONFIG_RCU_TRACE */
753
-
754
-#define trace_rcu_grace_period(rcuname, gp_seq, gpevent) do { } while (0)
755
-#define trace_rcu_future_grace_period(rcuname, gp_seq, gp_seq_req, \
756
- level, grplo, grphi, event) \
757
- do { } while (0)
758
-#define trace_rcu_grace_period_init(rcuname, gp_seq, level, grplo, grphi, \
759
- qsmask) do { } while (0)
760
-#define trace_rcu_exp_grace_period(rcuname, gqseq, gpevent) \
761
- do { } while (0)
762
-#define trace_rcu_exp_funnel_lock(rcuname, level, grplo, grphi, gpevent) \
763
- do { } while (0)
764
-#define trace_rcu_nocb_wake(rcuname, cpu, reason) do { } while (0)
765
-#define trace_rcu_preempt_task(rcuname, pid, gp_seq) do { } while (0)
766
-#define trace_rcu_unlock_preempted_task(rcuname, gp_seq, pid) do { } while (0)
767
-#define trace_rcu_quiescent_state_report(rcuname, gp_seq, mask, qsmask, level, \
768
- grplo, grphi, gp_tasks) do { } \
769
- while (0)
770
-#define trace_rcu_fqs(rcuname, gp_seq, cpu, qsevent) do { } while (0)
771
-#define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0)
772
-#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
773
-#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
774
- do { } while (0)
775
-#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
776
- do { } while (0)
777
-#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
778
-#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
779
-#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
780
- do { } while (0)
781
-#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
782
- do { } while (0)
783
-#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
784
-
785
-#endif /* #else #ifdef CONFIG_RCU_TRACE */
786809
787810 #endif /* _TRACE_RCU_H */
788811