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