rcu: Add tracing to rcu_gp_kthread()
[platform/adaptation/renesas_rcar/renesas_kernel.git] / include / trace / events / 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
9 /*
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.
16  *
17  * An "@" character within "<activity>" is a comment character: Data
18  * reduction scripts will ignore the "@" and the remainder of the line.
19  */
20 TRACE_EVENT(rcu_utilization,
21
22         TP_PROTO(const char *s),
23
24         TP_ARGS(s),
25
26         TP_STRUCT__entry(
27                 __field(const char *, s)
28         ),
29
30         TP_fast_assign(
31                 __entry->s = s;
32         ),
33
34         TP_printk("%s", __entry->s)
35 );
36
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.  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.
61  */
62 TRACE_EVENT(rcu_grace_period,
63
64         TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent),
65
66         TP_ARGS(rcuname, gpnum, gpevent),
67
68         TP_STRUCT__entry(
69                 __field(const char *, rcuname)
70                 __field(unsigned long, gpnum)
71                 __field(const char *, gpevent)
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
84 /*
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:
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  */
100 TRACE_EVENT(rcu_future_grace_period,
101
102         TP_PROTO(const char *rcuname, unsigned long gpnum, unsigned long completed,
103                  unsigned long c, u8 level, int grplo, int grphi,
104                  const char *gpevent),
105
106         TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent),
107
108         TP_STRUCT__entry(
109                 __field(const char *, rcuname)
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)
116                 __field(const char *, gpevent)
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
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  */
143 TRACE_EVENT(rcu_grace_period_init,
144
145         TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level,
146                  int grplo, int grphi, unsigned long qsmask),
147
148         TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
149
150         TP_STRUCT__entry(
151                 __field(const char *, rcuname)
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  */
179 TRACE_EVENT(rcu_preempt_task,
180
181         TP_PROTO(const char *rcuname, int pid, unsigned long gpnum),
182
183         TP_ARGS(rcuname, pid, gpnum),
184
185         TP_STRUCT__entry(
186                 __field(const char *, rcuname)
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  */
206 TRACE_EVENT(rcu_unlock_preempted_task,
207
208         TP_PROTO(const char *rcuname, unsigned long gpnum, int pid),
209
210         TP_ARGS(rcuname, gpnum, pid),
211
212         TP_STRUCT__entry(
213                 __field(const char *, rcuname)
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  */
235 TRACE_EVENT(rcu_quiescent_state_report,
236
237         TP_PROTO(const char *rcuname, unsigned long gpnum,
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(
244                 __field(const char *, rcuname)
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  */
279 TRACE_EVENT(rcu_fqs,
280
281         TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent),
282
283         TP_ARGS(rcuname, gpnum, cpu, qsevent),
284
285         TP_STRUCT__entry(
286                 __field(const char *, rcuname)
287                 __field(unsigned long, gpnum)
288                 __field(int, cpu)
289                 __field(const char *, qsevent)
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
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.
318  */
319 TRACE_EVENT(rcu_dyntick,
320
321         TP_PROTO(const char *polarity, long long oldnesting, long long newnesting),
322
323         TP_ARGS(polarity, oldnesting, newnesting),
324
325         TP_STRUCT__entry(
326                 __field(const char *, polarity)
327                 __field(long long, oldnesting)
328                 __field(long long, newnesting)
329         ),
330
331         TP_fast_assign(
332                 __entry->polarity = polarity;
333                 __entry->oldnesting = oldnesting;
334                 __entry->newnesting = newnesting;
335         ),
336
337         TP_printk("%s %llx %llx", __entry->polarity,
338                   __entry->oldnesting, __entry->newnesting)
339 );
340
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.
354  *      "Begin holdoff": Attempt failed, don't retry until next jiffy.
355  *      "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
356  *      "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
357  *      "More callbacks": Still more callbacks, try again to clear them out.
358  *      "Callbacks drained": All callbacks processed, off to dyntick idle!
359  *      "Timer": Timer fired to cause CPU to continue processing callbacks.
360  *      "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
361  *      "Cleanup after idle": Idle exited, timer canceled.
362  */
363 TRACE_EVENT(rcu_prep_idle,
364
365         TP_PROTO(const char *reason),
366
367         TP_ARGS(reason),
368
369         TP_STRUCT__entry(
370                 __field(const char *, reason)
371         ),
372
373         TP_fast_assign(
374                 __entry->reason = reason;
375         ),
376
377         TP_printk("%s", __entry->reason)
378 );
379
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
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.
386  */
387 TRACE_EVENT(rcu_callback,
388
389         TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
390                  long qlen),
391
392         TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
393
394         TP_STRUCT__entry(
395                 __field(const char *, rcuname)
396                 __field(void *, rhp)
397                 __field(void *, func)
398                 __field(long, qlen_lazy)
399                 __field(long, qlen)
400         ),
401
402         TP_fast_assign(
403                 __entry->rcuname = rcuname;
404                 __entry->rhp = rhp;
405                 __entry->func = rhp->func;
406                 __entry->qlen_lazy = qlen_lazy;
407                 __entry->qlen = qlen;
408         ),
409
410         TP_printk("%s rhp=%p func=%pf %ld/%ld",
411                   __entry->rcuname, __entry->rhp, __entry->func,
412                   __entry->qlen_lazy, __entry->qlen)
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,
420  * the fourth argument is the number of lazy callbacks queued, and the
421  * fifth argument is the total number of callbacks queued.
422  */
423 TRACE_EVENT(rcu_kfree_callback,
424
425         TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
426                  long qlen_lazy, long qlen),
427
428         TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
429
430         TP_STRUCT__entry(
431                 __field(const char *, rcuname)
432                 __field(void *, rhp)
433                 __field(unsigned long, offset)
434                 __field(long, qlen_lazy)
435                 __field(long, qlen)
436         ),
437
438         TP_fast_assign(
439                 __entry->rcuname = rcuname;
440                 __entry->rhp = rhp;
441                 __entry->offset = offset;
442                 __entry->qlen_lazy = qlen_lazy;
443                 __entry->qlen = qlen;
444         ),
445
446         TP_printk("%s rhp=%p func=%ld %ld/%ld",
447                   __entry->rcuname, __entry->rhp, __entry->offset,
448                   __entry->qlen_lazy, __entry->qlen)
449 );
450
451 /*
452  * Tracepoint for marking the beginning rcu_do_batch, performed to start
453  * RCU callback invocation.  The first argument is the RCU flavor,
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.
457  */
458 TRACE_EVENT(rcu_batch_start,
459
460         TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
461
462         TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
463
464         TP_STRUCT__entry(
465                 __field(const char *, rcuname)
466                 __field(long, qlen_lazy)
467                 __field(long, qlen)
468                 __field(long, blimit)
469         ),
470
471         TP_fast_assign(
472                 __entry->rcuname = rcuname;
473                 __entry->qlen_lazy = qlen_lazy;
474                 __entry->qlen = qlen;
475                 __entry->blimit = blimit;
476         ),
477
478         TP_printk("%s CBs=%ld/%ld bl=%ld",
479                   __entry->rcuname, __entry->qlen_lazy, __entry->qlen,
480                   __entry->blimit)
481 );
482
483 /*
484  * Tracepoint for the invocation of a single RCU callback function.
485  * The first argument is the type of RCU, and the second argument is
486  * a pointer to the RCU callback itself.
487  */
488 TRACE_EVENT(rcu_invoke_callback,
489
490         TP_PROTO(const char *rcuname, struct rcu_head *rhp),
491
492         TP_ARGS(rcuname, rhp),
493
494         TP_STRUCT__entry(
495                 __field(const char *, rcuname)
496                 __field(void *, rhp)
497                 __field(void *, func)
498         ),
499
500         TP_fast_assign(
501                 __entry->rcuname = rcuname;
502                 __entry->rhp = rhp;
503                 __entry->func = rhp->func;
504         ),
505
506         TP_printk("%s rhp=%p func=%pf",
507                   __entry->rcuname, __entry->rhp, __entry->func)
508 );
509
510 /*
511  * Tracepoint for the invocation of a single RCU callback of the special
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.
516  */
517 TRACE_EVENT(rcu_invoke_kfree_callback,
518
519         TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
520
521         TP_ARGS(rcuname, rhp, offset),
522
523         TP_STRUCT__entry(
524                 __field(const char *, rcuname)
525                 __field(void *, rhp)
526                 __field(unsigned long, offset)
527         ),
528
529         TP_fast_assign(
530                 __entry->rcuname = rcuname;
531                 __entry->rhp = rhp;
532                 __entry->offset = offset;
533         ),
534
535         TP_printk("%s rhp=%p func=%ld",
536                   __entry->rcuname, __entry->rhp, __entry->offset)
537 );
538
539 /*
540  * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
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().
549  */
550 TRACE_EVENT(rcu_batch_end,
551
552         TP_PROTO(const char *rcuname, int callbacks_invoked,
553                  bool cb, bool nr, bool iit, bool risk),
554
555         TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
556
557         TP_STRUCT__entry(
558                 __field(const char *, rcuname)
559                 __field(int, callbacks_invoked)
560                 __field(bool, cb)
561                 __field(bool, nr)
562                 __field(bool, iit)
563                 __field(bool, risk)
564         ),
565
566         TP_fast_assign(
567                 __entry->rcuname = rcuname;
568                 __entry->callbacks_invoked = callbacks_invoked;
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' : '.')
581 );
582
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  */
588 TRACE_EVENT(rcu_torture_read,
589
590         TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
591                  unsigned long secs, unsigned long c_old, unsigned long c),
592
593         TP_ARGS(rcutorturename, rhp, secs, c_old, c),
594
595         TP_STRUCT__entry(
596                 __field(const char *, rcutorturename)
597                 __field(struct rcu_head *, rhp)
598                 __field(unsigned long, secs)
599                 __field(unsigned long, c_old)
600                 __field(unsigned long, c)
601         ),
602
603         TP_fast_assign(
604                 __entry->rcutorturename = rcutorturename;
605                 __entry->rhp = rhp;
606                 __entry->secs = secs;
607                 __entry->c_old = c_old;
608                 __entry->c = c;
609         ),
610
611         TP_printk("%s torture read %p %luus c: %lu %lu",
612                   __entry->rcutorturename, __entry->rhp,
613                   __entry->secs, __entry->c_old, __entry->c)
614 );
615
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
624  *      "OnlineNoCB": rcu_barrier_callback() found online no-CBs CPU.
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  */
634 TRACE_EVENT(rcu_barrier,
635
636         TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
637
638         TP_ARGS(rcuname, s, cpu, cnt, done),
639
640         TP_STRUCT__entry(
641                 __field(const char *, rcuname)
642                 __field(const char *, s)
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
661 #else /* #ifdef CONFIG_RCU_TRACE */
662
663 #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
664 #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
665                                     qsmask) do { } while (0)
666 #define trace_rcu_future_grace_period(rcuname, gpnum, completed, c, \
667                                       level, grplo, grphi, event) \
668                                       do { } while (0)
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)
671 #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
672                                          grplo, grphi, gp_tasks) do { } \
673         while (0)
674 #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
675 #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
676 #define trace_rcu_prep_idle(reason) do { } while (0)
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)
682 #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
683 #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
684 #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
685         do { } while (0)
686 #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
687         do { } while (0)
688 #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
689
690 #endif /* #else #ifdef CONFIG_RCU_TRACE */
691
692 #endif /* _TRACE_RCU_H */
693
694 /* This part must be outside protection */
695 #include <trace/define_trace.h>