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