blob: 60077e12093cc5056b054e0653d8573052f538e2 [file] [log] [blame]
Paul E. McKenney29c00b42011-06-17 15:53:19 -07001#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/*
Paul E. McKenney300df912011-06-18 22:26:31 -070010 * 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.
Paul E. McKenney385680a2011-06-21 22:43:26 -070016 *
17 * An "@" character within "<activity>" is a comment character: Data
18 * reduction scripts will ignore the "@" and the remainder of the line.
Paul E. McKenney29c00b42011-06-17 15:53:19 -070019 */
Paul E. McKenney300df912011-06-18 22:26:31 -070020TRACE_EVENT(rcu_utilization,
Paul E. McKenney29c00b42011-06-17 15:53:19 -070021
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -040022 TP_PROTO(const char *s),
Paul E. McKenney29c00b42011-06-17 15:53:19 -070023
Paul E. McKenney300df912011-06-18 22:26:31 -070024 TP_ARGS(s),
Paul E. McKenney29c00b42011-06-17 15:53:19 -070025
26 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -040027 __field(const char *, s)
Paul E. McKenney29c00b42011-06-17 15:53:19 -070028 ),
29
30 TP_fast_assign(
Paul E. McKenney300df912011-06-18 22:26:31 -070031 __entry->s = s;
Paul E. McKenney29c00b42011-06-17 15:53:19 -070032 ),
33
Paul E. McKenney300df912011-06-18 22:26:31 -070034 TP_printk("%s", __entry->s)
Paul E. McKenney29c00b42011-06-17 15:53:19 -070035);
36
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070037#ifdef CONFIG_RCU_TRACE
38
39#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
40
41/*
Paul E. McKenney63c4db72013-08-09 12:19:29 -070042 * 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.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070061 */
62TRACE_EVENT(rcu_grace_period,
63
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -040064 TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070065
66 TP_ARGS(rcuname, gpnum, gpevent),
67
68 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -040069 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070070 __field(unsigned long, gpnum)
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -040071 __field(const char *, gpevent)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070072 ),
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/*
Paul E. McKenneybd9f0682012-12-29 21:51:20 -080085 * 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:
Paul E. McKenney09c7b892013-02-08 15:55:02 -080089 *
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 */
Paul E. McKenneybd9f0682012-12-29 21:51:20 -0800100TRACE_EVENT(rcu_future_grace_period,
Paul E. McKenney09c7b892013-02-08 15:55:02 -0800101
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400102 TP_PROTO(const char *rcuname, unsigned long gpnum, unsigned long completed,
Paul E. McKenney09c7b892013-02-08 15:55:02 -0800103 unsigned long c, u8 level, int grplo, int grphi,
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400104 const char *gpevent),
Paul E. McKenney09c7b892013-02-08 15:55:02 -0800105
106 TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent),
107
108 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400109 __field(const char *, rcuname)
Paul E. McKenney09c7b892013-02-08 15:55:02 -0800110 __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)
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400116 __field(const char *, gpevent)
Paul E. McKenney09c7b892013-02-08 15:55:02 -0800117 ),
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/*
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700137 * 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
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400145 TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level,
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700146 int grplo, int grphi, unsigned long qsmask),
147
148 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
149
150 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400151 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700152 __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
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400181 TP_PROTO(const char *rcuname, int pid, unsigned long gpnum),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700182
183 TP_ARGS(rcuname, pid, gpnum),
184
185 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400186 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700187 __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
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400208 TP_PROTO(const char *rcuname, unsigned long gpnum, int pid),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700209
210 TP_ARGS(rcuname, gpnum, pid),
211
212 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400213 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700214 __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
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400237 TP_PROTO(const char *rcuname, unsigned long gpnum,
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700238 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(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400244 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700245 __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
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400281 TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700282
283 TP_ARGS(rcuname, gpnum, cpu, qsevent),
284
285 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400286 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700287 __field(unsigned long, gpnum)
288 __field(int, cpu)
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400289 __field(const char *, qsevent)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700290 ),
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
Paul E. McKenney045fb932011-11-22 12:13:03 -0800308 * 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.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700318 */
319TRACE_EVENT(rcu_dyntick,
320
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400321 TP_PROTO(const char *polarity, long long oldnesting, long long newnesting),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700322
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700323 TP_ARGS(polarity, oldnesting, newnesting),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700324
325 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400326 __field(const char *, polarity)
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700327 __field(long long, oldnesting)
328 __field(long long, newnesting)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700329 ),
330
331 TP_fast_assign(
332 __entry->polarity = polarity;
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700333 __entry->oldnesting = oldnesting;
334 __entry->newnesting = newnesting;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700335 ),
336
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700337 TP_printk("%s %llx %llx", __entry->polarity,
338 __entry->oldnesting, __entry->newnesting)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700339);
340
341/*
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800342 * 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.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800354 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
Paul E. McKenney7cb92492011-11-28 12:28:34 -0800355 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
Paul E. McKenneyfd4b3522012-05-05 19:10:35 -0700356 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800357 * "More callbacks": Still more callbacks, try again to clear them out.
358 * "Callbacks drained": All callbacks processed, off to dyntick idle!
Paul E. McKenney7cb92492011-11-28 12:28:34 -0800359 * "Timer": Timer fired to cause CPU to continue processing callbacks.
Paul E. McKenney21e52e12012-04-30 14:16:19 -0700360 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
Paul E. McKenney2fdbb312012-02-23 15:58:29 -0800361 * "Cleanup after idle": Idle exited, timer canceled.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800362 */
363TRACE_EVENT(rcu_prep_idle,
364
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400365 TP_PROTO(const char *reason),
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800366
367 TP_ARGS(reason),
368
369 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400370 __field(const char *, reason)
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800371 ),
372
373 TP_fast_assign(
374 __entry->reason = reason;
375 ),
376
377 TP_printk("%s", __entry->reason)
378);
379
380/*
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700381 * Tracepoint for the registration of a single RCU callback function.
382 * The first argument is the type of RCU, the second argument is
Paul E. McKenney486e2592012-01-06 14:11:30 -0800383 * 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.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700386 */
387TRACE_EVENT(rcu_callback,
388
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400389 TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800390 long qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700391
Paul E. McKenney486e2592012-01-06 14:11:30 -0800392 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700393
394 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400395 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700396 __field(void *, rhp)
397 __field(void *, func)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800398 __field(long, qlen_lazy)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700399 __field(long, qlen)
400 ),
401
402 TP_fast_assign(
403 __entry->rcuname = rcuname;
404 __entry->rhp = rhp;
405 __entry->func = rhp->func;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800406 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700407 __entry->qlen = qlen;
408 ),
409
Paul E. McKenney486e2592012-01-06 14:11:30 -0800410 TP_printk("%s rhp=%p func=%pf %ld/%ld",
411 __entry->rcuname, __entry->rhp, __entry->func,
412 __entry->qlen_lazy, __entry->qlen)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700413);
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,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800420 * the fourth argument is the number of lazy callbacks queued, and the
421 * fifth argument is the total number of callbacks queued.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700422 */
423TRACE_EVENT(rcu_kfree_callback,
424
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400425 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800426 long qlen_lazy, long qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700427
Paul E. McKenney486e2592012-01-06 14:11:30 -0800428 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700429
430 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400431 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700432 __field(void *, rhp)
433 __field(unsigned long, offset)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800434 __field(long, qlen_lazy)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700435 __field(long, qlen)
436 ),
437
438 TP_fast_assign(
439 __entry->rcuname = rcuname;
440 __entry->rhp = rhp;
441 __entry->offset = offset;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800442 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700443 __entry->qlen = qlen;
444 ),
445
Paul E. McKenney486e2592012-01-06 14:11:30 -0800446 TP_printk("%s rhp=%p func=%ld %ld/%ld",
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700447 __entry->rcuname, __entry->rhp, __entry->offset,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800448 __entry->qlen_lazy, __entry->qlen)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700449);
450
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700451/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700452 * Tracepoint for marking the beginning rcu_do_batch, performed to start
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700453 * RCU callback invocation. The first argument is the RCU flavor,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800454 * 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.
Paul E. McKenney300df912011-06-18 22:26:31 -0700457 */
458TRACE_EVENT(rcu_batch_start,
459
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400460 TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -0700461
Paul E. McKenney486e2592012-01-06 14:11:30 -0800462 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -0700463
464 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400465 __field(const char *, rcuname)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800466 __field(long, qlen_lazy)
Paul E. McKenney300df912011-06-18 22:26:31 -0700467 __field(long, qlen)
Paul E. McKenney3aac7a82012-11-14 14:37:29 -0800468 __field(long, blimit)
Paul E. McKenney300df912011-06-18 22:26:31 -0700469 ),
470
471 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700472 __entry->rcuname = rcuname;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800473 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenney300df912011-06-18 22:26:31 -0700474 __entry->qlen = qlen;
475 __entry->blimit = blimit;
476 ),
477
Paul E. McKenney3aac7a82012-11-14 14:37:29 -0800478 TP_printk("%s CBs=%ld/%ld bl=%ld",
Paul E. McKenney486e2592012-01-06 14:11:30 -0800479 __entry->rcuname, __entry->qlen_lazy, __entry->qlen,
480 __entry->blimit)
Paul E. McKenney300df912011-06-18 22:26:31 -0700481);
482
483/*
484 * Tracepoint for the invocation of a single RCU callback function.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700485 * The first argument is the type of RCU, and the second argument is
486 * a pointer to the RCU callback itself.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700487 */
488TRACE_EVENT(rcu_invoke_callback,
489
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400490 TP_PROTO(const char *rcuname, struct rcu_head *rhp),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700491
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700492 TP_ARGS(rcuname, rhp),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700493
494 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400495 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700496 __field(void *, rhp)
497 __field(void *, func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700498 ),
499
500 TP_fast_assign(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700501 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700502 __entry->rhp = rhp;
503 __entry->func = rhp->func;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700504 ),
505
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700506 TP_printk("%s rhp=%p func=%pf",
507 __entry->rcuname, __entry->rhp, __entry->func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700508);
509
510/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700511 * Tracepoint for the invocation of a single RCU callback of the special
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700512 * 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.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700516 */
517TRACE_EVENT(rcu_invoke_kfree_callback,
518
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400519 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700520
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700521 TP_ARGS(rcuname, rhp, offset),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700522
523 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400524 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700525 __field(void *, rhp)
Paul E. McKenney300df912011-06-18 22:26:31 -0700526 __field(unsigned long, offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700527 ),
528
529 TP_fast_assign(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700530 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700531 __entry->rhp = rhp;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700532 __entry->offset = offset;
533 ),
534
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700535 TP_printk("%s rhp=%p func=%ld",
536 __entry->rcuname, __entry->rhp, __entry->offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700537);
538
539/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700540 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
Paul E. McKenney4968c302011-12-07 16:32:40 -0800541 * 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().
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700549 */
550TRACE_EVENT(rcu_batch_end,
551
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400552 TP_PROTO(const char *rcuname, int callbacks_invoked,
Paul E. McKenney4968c302011-12-07 16:32:40 -0800553 bool cb, bool nr, bool iit, bool risk),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700554
Paul E. McKenney4968c302011-12-07 16:32:40 -0800555 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700556
557 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400558 __field(const char *, rcuname)
Paul E. McKenney300df912011-06-18 22:26:31 -0700559 __field(int, callbacks_invoked)
Paul E. McKenney4968c302011-12-07 16:32:40 -0800560 __field(bool, cb)
561 __field(bool, nr)
562 __field(bool, iit)
563 __field(bool, risk)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700564 ),
565
566 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700567 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700568 __entry->callbacks_invoked = callbacks_invoked;
Paul E. McKenney4968c302011-12-07 16:32:40 -0800569 __entry->cb = cb;
570 __entry->nr = nr;
571 __entry->iit = iit;
572 __entry->risk = risk;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700573 ),
574
Paul E. McKenney4968c302011-12-07 16:32:40 -0800575 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' : '.')
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700581);
582
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700583/*
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
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400590 TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
Paul E. McKenney52494532012-11-14 16:26:40 -0800591 unsigned long secs, unsigned long c_old, unsigned long c),
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700592
Paul E. McKenney52494532012-11-14 16:26:40 -0800593 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700594
595 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400596 __field(const char *, rcutorturename)
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700597 __field(struct rcu_head *, rhp)
Paul E. McKenney52494532012-11-14 16:26:40 -0800598 __field(unsigned long, secs)
599 __field(unsigned long, c_old)
600 __field(unsigned long, c)
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700601 ),
602
603 TP_fast_assign(
604 __entry->rcutorturename = rcutorturename;
605 __entry->rhp = rhp;
Paul E. McKenney52494532012-11-14 16:26:40 -0800606 __entry->secs = secs;
607 __entry->c_old = c_old;
608 __entry->c = c;
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700609 ),
610
Paul E. McKenney52494532012-11-14 16:26:40 -0800611 TP_printk("%s torture read %p %luus c: %lu %lu",
612 __entry->rcutorturename, __entry->rhp,
613 __entry->secs, __entry->c_old, __entry->c)
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700614);
615
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700616/*
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
Paul E. McKenney3fbfbf72012-08-19 21:35:53 -0700624 * "OnlineNoCB": rcu_barrier_callback() found online no-CBs CPU.
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700625 * "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
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400636 TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700637
638 TP_ARGS(rcuname, s, cpu, cnt, done),
639
640 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400641 __field(const char *, rcuname)
642 __field(const char *, s)
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700643 __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
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700661#else /* #ifdef CONFIG_RCU_TRACE */
662
663#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800664#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
665 qsmask) do { } while (0)
Paul E. McKenneybd9f0682012-12-29 21:51:20 -0800666#define trace_rcu_future_grace_period(rcuname, gpnum, completed, c, \
667 level, grplo, grphi, event) \
668 do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700669#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
670#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800671#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
672 grplo, grphi, gp_tasks) do { } \
673 while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700674#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700675#define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800676#define trace_rcu_prep_idle(reason) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800677#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)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700682#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
683#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
Paul E. McKenney4968c302011-12-07 16:32:40 -0800684#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
685 do { } while (0)
Paul E. McKenney52494532012-11-14 16:26:40 -0800686#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
687 do { } while (0)
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700688#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700689
690#endif /* #else #ifdef CONFIG_RCU_TRACE */
691
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700692#endif /* _TRACE_RCU_H */
693
694/* This part must be outside protection */
695#include <trace/define_trace.h>