blob: 98466c618ebc229a214cc34d4425efbeb73e667f [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.
Paul E. McKenneybb311ec2013-08-09 16:02:09 -070048 * "newreq": Request a new grace period.
Paul E. McKenney63c4db72013-08-09 12:19:29 -070049 * "start": Start a grace period.
50 * "cpustart": CPU first notices a grace-period start.
51 * "cpuqs": CPU passes through a quiescent state.
52 * "cpuonl": CPU comes online.
53 * "cpuofl": CPU goes offline.
54 * "reqwait": GP kthread sleeps waiting for grace-period request.
55 * "reqwaitsig": GP kthread awakened by signal from reqwait state.
56 * "fqswait": GP kthread waiting until time to force quiescent states.
57 * "fqsstart": GP kthread starts forcing quiescent states.
58 * "fqsend": GP kthread done forcing quiescent states.
59 * "fqswaitsig": GP kthread awakened by signal from fqswait state.
60 * "end": End a grace period.
61 * "cpuend": CPU first notices a grace-period end.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070062 */
63TRACE_EVENT(rcu_grace_period,
64
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -040065 TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070066
67 TP_ARGS(rcuname, gpnum, gpevent),
68
69 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -040070 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070071 __field(unsigned long, gpnum)
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -040072 __field(const char *, gpevent)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070073 ),
74
75 TP_fast_assign(
76 __entry->rcuname = rcuname;
77 __entry->gpnum = gpnum;
78 __entry->gpevent = gpevent;
79 ),
80
81 TP_printk("%s %lu %s",
82 __entry->rcuname, __entry->gpnum, __entry->gpevent)
83);
84
85/*
Paul E. McKenneybd9f0682012-12-29 21:51:20 -080086 * Tracepoint for future grace-period events, including those for no-callbacks
87 * CPUs. The caller should pull the data from the rcu_node structure,
88 * other than rcuname, which comes from the rcu_state structure, and event,
89 * which is one of the following:
Paul E. McKenney09c7b892013-02-08 15:55:02 -080090 *
91 * "Startleaf": Request a nocb grace period based on leaf-node data.
92 * "Startedleaf": Leaf-node start proved sufficient.
93 * "Startedleafroot": Leaf-node start proved sufficient after checking root.
94 * "Startedroot": Requested a nocb grace period based on root-node data.
95 * "StartWait": Start waiting for the requested grace period.
96 * "ResumeWait": Resume waiting after signal.
97 * "EndWait": Complete wait.
98 * "Cleanup": Clean up rcu_node structure after previous GP.
99 * "CleanupMore": Clean up, and another no-CB GP is needed.
100 */
Paul E. McKenneybd9f0682012-12-29 21:51:20 -0800101TRACE_EVENT(rcu_future_grace_period,
Paul E. McKenney09c7b892013-02-08 15:55:02 -0800102
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400103 TP_PROTO(const char *rcuname, unsigned long gpnum, unsigned long completed,
Paul E. McKenney09c7b892013-02-08 15:55:02 -0800104 unsigned long c, u8 level, int grplo, int grphi,
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400105 const char *gpevent),
Paul E. McKenney09c7b892013-02-08 15:55:02 -0800106
107 TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent),
108
109 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400110 __field(const char *, rcuname)
Paul E. McKenney09c7b892013-02-08 15:55:02 -0800111 __field(unsigned long, gpnum)
112 __field(unsigned long, completed)
113 __field(unsigned long, c)
114 __field(u8, level)
115 __field(int, grplo)
116 __field(int, grphi)
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400117 __field(const char *, gpevent)
Paul E. McKenney09c7b892013-02-08 15:55:02 -0800118 ),
119
120 TP_fast_assign(
121 __entry->rcuname = rcuname;
122 __entry->gpnum = gpnum;
123 __entry->completed = completed;
124 __entry->c = c;
125 __entry->level = level;
126 __entry->grplo = grplo;
127 __entry->grphi = grphi;
128 __entry->gpevent = gpevent;
129 ),
130
131 TP_printk("%s %lu %lu %lu %u %d %d %s",
132 __entry->rcuname, __entry->gpnum, __entry->completed,
133 __entry->c, __entry->level, __entry->grplo, __entry->grphi,
134 __entry->gpevent)
135);
136
137/*
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700138 * Tracepoint for grace-period-initialization events. These are
139 * distinguished by the type of RCU, the new grace-period number, the
140 * rcu_node structure level, the starting and ending CPU covered by the
141 * rcu_node structure, and the mask of CPUs that will be waited for.
142 * All but the type of RCU are extracted from the rcu_node structure.
143 */
144TRACE_EVENT(rcu_grace_period_init,
145
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400146 TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level,
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700147 int grplo, int grphi, unsigned long qsmask),
148
149 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
150
151 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400152 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700153 __field(unsigned long, gpnum)
154 __field(u8, level)
155 __field(int, grplo)
156 __field(int, grphi)
157 __field(unsigned long, qsmask)
158 ),
159
160 TP_fast_assign(
161 __entry->rcuname = rcuname;
162 __entry->gpnum = gpnum;
163 __entry->level = level;
164 __entry->grplo = grplo;
165 __entry->grphi = grphi;
166 __entry->qsmask = qsmask;
167 ),
168
169 TP_printk("%s %lu %u %d %d %lx",
170 __entry->rcuname, __entry->gpnum, __entry->level,
171 __entry->grplo, __entry->grphi, __entry->qsmask)
172);
173
174/*
175 * Tracepoint for tasks blocking within preemptible-RCU read-side
176 * critical sections. Track the type of RCU (which one day might
177 * include SRCU), the grace-period number that the task is blocking
178 * (the current or the next), and the task's PID.
179 */
180TRACE_EVENT(rcu_preempt_task,
181
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400182 TP_PROTO(const char *rcuname, int pid, unsigned long gpnum),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700183
184 TP_ARGS(rcuname, pid, gpnum),
185
186 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400187 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700188 __field(unsigned long, gpnum)
189 __field(int, pid)
190 ),
191
192 TP_fast_assign(
193 __entry->rcuname = rcuname;
194 __entry->gpnum = gpnum;
195 __entry->pid = pid;
196 ),
197
198 TP_printk("%s %lu %d",
199 __entry->rcuname, __entry->gpnum, __entry->pid)
200);
201
202/*
203 * Tracepoint for tasks that blocked within a given preemptible-RCU
204 * read-side critical section exiting that critical section. Track the
205 * type of RCU (which one day might include SRCU) and the task's PID.
206 */
207TRACE_EVENT(rcu_unlock_preempted_task,
208
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400209 TP_PROTO(const char *rcuname, unsigned long gpnum, int pid),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700210
211 TP_ARGS(rcuname, gpnum, pid),
212
213 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400214 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700215 __field(unsigned long, gpnum)
216 __field(int, pid)
217 ),
218
219 TP_fast_assign(
220 __entry->rcuname = rcuname;
221 __entry->gpnum = gpnum;
222 __entry->pid = pid;
223 ),
224
225 TP_printk("%s %lu %d", __entry->rcuname, __entry->gpnum, __entry->pid)
226);
227
228/*
229 * Tracepoint for quiescent-state-reporting events. These are
230 * distinguished by the type of RCU, the grace-period number, the
231 * mask of quiescent lower-level entities, the rcu_node structure level,
232 * the starting and ending CPU covered by the rcu_node structure, and
233 * whether there are any blocked tasks blocking the current grace period.
234 * All but the type of RCU are extracted from the rcu_node structure.
235 */
236TRACE_EVENT(rcu_quiescent_state_report,
237
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400238 TP_PROTO(const char *rcuname, unsigned long gpnum,
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700239 unsigned long mask, unsigned long qsmask,
240 u8 level, int grplo, int grphi, int gp_tasks),
241
242 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
243
244 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400245 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700246 __field(unsigned long, gpnum)
247 __field(unsigned long, mask)
248 __field(unsigned long, qsmask)
249 __field(u8, level)
250 __field(int, grplo)
251 __field(int, grphi)
252 __field(u8, gp_tasks)
253 ),
254
255 TP_fast_assign(
256 __entry->rcuname = rcuname;
257 __entry->gpnum = gpnum;
258 __entry->mask = mask;
259 __entry->qsmask = qsmask;
260 __entry->level = level;
261 __entry->grplo = grplo;
262 __entry->grphi = grphi;
263 __entry->gp_tasks = gp_tasks;
264 ),
265
266 TP_printk("%s %lu %lx>%lx %u %d %d %u",
267 __entry->rcuname, __entry->gpnum,
268 __entry->mask, __entry->qsmask, __entry->level,
269 __entry->grplo, __entry->grphi, __entry->gp_tasks)
270);
271
272/*
273 * Tracepoint for quiescent states detected by force_quiescent_state().
274 * These trace events include the type of RCU, the grace-period number
275 * that was blocked by the CPU, the CPU itself, and the type of quiescent
276 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
277 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
278 * too long.
279 */
280TRACE_EVENT(rcu_fqs,
281
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400282 TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700283
284 TP_ARGS(rcuname, gpnum, cpu, qsevent),
285
286 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400287 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700288 __field(unsigned long, gpnum)
289 __field(int, cpu)
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400290 __field(const char *, qsevent)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700291 ),
292
293 TP_fast_assign(
294 __entry->rcuname = rcuname;
295 __entry->gpnum = gpnum;
296 __entry->cpu = cpu;
297 __entry->qsevent = qsevent;
298 ),
299
300 TP_printk("%s %lu %d %s",
301 __entry->rcuname, __entry->gpnum,
302 __entry->cpu, __entry->qsevent)
303);
304
305#endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) */
306
307/*
308 * Tracepoint for dyntick-idle entry/exit events. These take a string
Paul E. McKenney045fb932011-11-22 12:13:03 -0800309 * as argument: "Start" for entering dyntick-idle mode, "End" for
310 * leaving it, "--=" for events moving towards idle, and "++=" for events
311 * moving away from idle. "Error on entry: not idle task" and "Error on
312 * exit: not idle task" indicate that a non-idle task is erroneously
313 * toying with the idle loop.
314 *
315 * These events also take a pair of numbers, which indicate the nesting
316 * depth before and after the event of interest. Note that task-related
317 * events use the upper bits of each number, while interrupt-related
318 * events use the lower bits.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700319 */
320TRACE_EVENT(rcu_dyntick,
321
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400322 TP_PROTO(const char *polarity, long long oldnesting, long long newnesting),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700323
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700324 TP_ARGS(polarity, oldnesting, newnesting),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700325
326 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400327 __field(const char *, polarity)
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700328 __field(long long, oldnesting)
329 __field(long long, newnesting)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700330 ),
331
332 TP_fast_assign(
333 __entry->polarity = polarity;
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700334 __entry->oldnesting = oldnesting;
335 __entry->newnesting = newnesting;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700336 ),
337
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700338 TP_printk("%s %llx %llx", __entry->polarity,
339 __entry->oldnesting, __entry->newnesting)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700340);
341
342/*
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800343 * Tracepoint for RCU preparation for idle, the goal being to get RCU
344 * processing done so that the current CPU can shut off its scheduling
345 * clock and enter dyntick-idle mode. One way to accomplish this is
346 * to drain all RCU callbacks from this CPU, and the other is to have
347 * done everything RCU requires for the current grace period. In this
348 * latter case, the CPU will be awakened at the end of the current grace
349 * period in order to process the remainder of its callbacks.
350 *
351 * These tracepoints take a string as argument:
352 *
353 * "No callbacks": Nothing to do, no callbacks on this CPU.
354 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800355 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
Paul E. McKenney7cb92492011-11-28 12:28:34 -0800356 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
Paul E. McKenneyfd4b3522012-05-05 19:10:35 -0700357 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800358 * "More callbacks": Still more callbacks, try again to clear them out.
359 * "Callbacks drained": All callbacks processed, off to dyntick idle!
Paul E. McKenney7cb92492011-11-28 12:28:34 -0800360 * "Timer": Timer fired to cause CPU to continue processing callbacks.
Paul E. McKenney21e52e12012-04-30 14:16:19 -0700361 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
Paul E. McKenney2fdbb312012-02-23 15:58:29 -0800362 * "Cleanup after idle": Idle exited, timer canceled.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800363 */
364TRACE_EVENT(rcu_prep_idle,
365
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400366 TP_PROTO(const char *reason),
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800367
368 TP_ARGS(reason),
369
370 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400371 __field(const char *, reason)
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800372 ),
373
374 TP_fast_assign(
375 __entry->reason = reason;
376 ),
377
378 TP_printk("%s", __entry->reason)
379);
380
381/*
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700382 * Tracepoint for the registration of a single RCU callback function.
383 * The first argument is the type of RCU, the second argument is
Paul E. McKenney486e2592012-01-06 14:11:30 -0800384 * a pointer to the RCU callback itself, the third element is the
385 * number of lazy callbacks queued, and the fourth element is the
386 * total number of callbacks queued.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700387 */
388TRACE_EVENT(rcu_callback,
389
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400390 TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800391 long qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700392
Paul E. McKenney486e2592012-01-06 14:11:30 -0800393 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700394
395 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400396 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700397 __field(void *, rhp)
398 __field(void *, func)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800399 __field(long, qlen_lazy)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700400 __field(long, qlen)
401 ),
402
403 TP_fast_assign(
404 __entry->rcuname = rcuname;
405 __entry->rhp = rhp;
406 __entry->func = rhp->func;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800407 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700408 __entry->qlen = qlen;
409 ),
410
Paul E. McKenney486e2592012-01-06 14:11:30 -0800411 TP_printk("%s rhp=%p func=%pf %ld/%ld",
412 __entry->rcuname, __entry->rhp, __entry->func,
413 __entry->qlen_lazy, __entry->qlen)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700414);
415
416/*
417 * Tracepoint for the registration of a single RCU callback of the special
418 * kfree() form. The first argument is the RCU type, the second argument
419 * is a pointer to the RCU callback, the third argument is the offset
420 * of the callback within the enclosing RCU-protected data structure,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800421 * the fourth argument is the number of lazy callbacks queued, and the
422 * fifth argument is the total number of callbacks queued.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700423 */
424TRACE_EVENT(rcu_kfree_callback,
425
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400426 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800427 long qlen_lazy, long qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700428
Paul E. McKenney486e2592012-01-06 14:11:30 -0800429 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700430
431 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400432 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700433 __field(void *, rhp)
434 __field(unsigned long, offset)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800435 __field(long, qlen_lazy)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700436 __field(long, qlen)
437 ),
438
439 TP_fast_assign(
440 __entry->rcuname = rcuname;
441 __entry->rhp = rhp;
442 __entry->offset = offset;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800443 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700444 __entry->qlen = qlen;
445 ),
446
Paul E. McKenney486e2592012-01-06 14:11:30 -0800447 TP_printk("%s rhp=%p func=%ld %ld/%ld",
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700448 __entry->rcuname, __entry->rhp, __entry->offset,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800449 __entry->qlen_lazy, __entry->qlen)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700450);
451
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700452/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700453 * Tracepoint for marking the beginning rcu_do_batch, performed to start
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700454 * RCU callback invocation. The first argument is the RCU flavor,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800455 * the second is the number of lazy callbacks queued, the third is
456 * the total number of callbacks queued, and the fourth argument is
457 * the current RCU-callback batch limit.
Paul E. McKenney300df912011-06-18 22:26:31 -0700458 */
459TRACE_EVENT(rcu_batch_start,
460
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400461 TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -0700462
Paul E. McKenney486e2592012-01-06 14:11:30 -0800463 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -0700464
465 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400466 __field(const char *, rcuname)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800467 __field(long, qlen_lazy)
Paul E. McKenney300df912011-06-18 22:26:31 -0700468 __field(long, qlen)
Paul E. McKenney3aac7a82012-11-14 14:37:29 -0800469 __field(long, blimit)
Paul E. McKenney300df912011-06-18 22:26:31 -0700470 ),
471
472 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700473 __entry->rcuname = rcuname;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800474 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenney300df912011-06-18 22:26:31 -0700475 __entry->qlen = qlen;
476 __entry->blimit = blimit;
477 ),
478
Paul E. McKenney3aac7a82012-11-14 14:37:29 -0800479 TP_printk("%s CBs=%ld/%ld bl=%ld",
Paul E. McKenney486e2592012-01-06 14:11:30 -0800480 __entry->rcuname, __entry->qlen_lazy, __entry->qlen,
481 __entry->blimit)
Paul E. McKenney300df912011-06-18 22:26:31 -0700482);
483
484/*
485 * Tracepoint for the invocation of a single RCU callback function.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700486 * The first argument is the type of RCU, and the second argument is
487 * a pointer to the RCU callback itself.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700488 */
489TRACE_EVENT(rcu_invoke_callback,
490
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400491 TP_PROTO(const char *rcuname, struct rcu_head *rhp),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700492
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700493 TP_ARGS(rcuname, rhp),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700494
495 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400496 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700497 __field(void *, rhp)
498 __field(void *, func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700499 ),
500
501 TP_fast_assign(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700502 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700503 __entry->rhp = rhp;
504 __entry->func = rhp->func;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700505 ),
506
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700507 TP_printk("%s rhp=%p func=%pf",
508 __entry->rcuname, __entry->rhp, __entry->func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700509);
510
511/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700512 * Tracepoint for the invocation of a single RCU callback of the special
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700513 * kfree() form. The first argument is the RCU flavor, the second
514 * argument is a pointer to the RCU callback, and the third argument
515 * is the offset of the callback within the enclosing RCU-protected
516 * data structure.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700517 */
518TRACE_EVENT(rcu_invoke_kfree_callback,
519
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400520 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700521
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700522 TP_ARGS(rcuname, rhp, offset),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700523
524 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400525 __field(const char *, rcuname)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700526 __field(void *, rhp)
Paul E. McKenney300df912011-06-18 22:26:31 -0700527 __field(unsigned long, offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700528 ),
529
530 TP_fast_assign(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700531 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700532 __entry->rhp = rhp;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700533 __entry->offset = offset;
534 ),
535
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700536 TP_printk("%s rhp=%p func=%ld",
537 __entry->rcuname, __entry->rhp, __entry->offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700538);
539
540/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700541 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
Paul E. McKenney4968c302011-12-07 16:32:40 -0800542 * invoked. The first argument is the name of the RCU flavor,
543 * the second argument is number of callbacks actually invoked,
544 * the third argument (cb) is whether or not any of the callbacks that
545 * were ready to invoke at the beginning of this batch are still
546 * queued, the fourth argument (nr) is the return value of need_resched(),
547 * the fifth argument (iit) is 1 if the current task is the idle task,
548 * and the sixth argument (risk) is the return value from
549 * rcu_is_callbacks_kthread().
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700550 */
551TRACE_EVENT(rcu_batch_end,
552
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400553 TP_PROTO(const char *rcuname, int callbacks_invoked,
Paul E. McKenney4968c302011-12-07 16:32:40 -0800554 bool cb, bool nr, bool iit, bool risk),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700555
Paul E. McKenney4968c302011-12-07 16:32:40 -0800556 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700557
558 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400559 __field(const char *, rcuname)
Paul E. McKenney300df912011-06-18 22:26:31 -0700560 __field(int, callbacks_invoked)
Paul E. McKenney4968c302011-12-07 16:32:40 -0800561 __field(bool, cb)
562 __field(bool, nr)
563 __field(bool, iit)
564 __field(bool, risk)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700565 ),
566
567 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700568 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700569 __entry->callbacks_invoked = callbacks_invoked;
Paul E. McKenney4968c302011-12-07 16:32:40 -0800570 __entry->cb = cb;
571 __entry->nr = nr;
572 __entry->iit = iit;
573 __entry->risk = risk;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700574 ),
575
Paul E. McKenney4968c302011-12-07 16:32:40 -0800576 TP_printk("%s CBs-invoked=%d idle=%c%c%c%c",
577 __entry->rcuname, __entry->callbacks_invoked,
578 __entry->cb ? 'C' : '.',
579 __entry->nr ? 'S' : '.',
580 __entry->iit ? 'I' : '.',
581 __entry->risk ? 'R' : '.')
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700582);
583
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700584/*
585 * Tracepoint for rcutorture readers. The first argument is the name
586 * of the RCU flavor from rcutorture's viewpoint and the second argument
587 * is the callback address.
588 */
589TRACE_EVENT(rcu_torture_read,
590
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400591 TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
Paul E. McKenney52494532012-11-14 16:26:40 -0800592 unsigned long secs, unsigned long c_old, unsigned long c),
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700593
Paul E. McKenney52494532012-11-14 16:26:40 -0800594 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700595
596 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400597 __field(const char *, rcutorturename)
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700598 __field(struct rcu_head *, rhp)
Paul E. McKenney52494532012-11-14 16:26:40 -0800599 __field(unsigned long, secs)
600 __field(unsigned long, c_old)
601 __field(unsigned long, c)
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700602 ),
603
604 TP_fast_assign(
605 __entry->rcutorturename = rcutorturename;
606 __entry->rhp = rhp;
Paul E. McKenney52494532012-11-14 16:26:40 -0800607 __entry->secs = secs;
608 __entry->c_old = c_old;
609 __entry->c = c;
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700610 ),
611
Paul E. McKenney52494532012-11-14 16:26:40 -0800612 TP_printk("%s torture read %p %luus c: %lu %lu",
613 __entry->rcutorturename, __entry->rhp,
614 __entry->secs, __entry->c_old, __entry->c)
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700615);
616
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700617/*
618 * Tracepoint for _rcu_barrier() execution. The string "s" describes
619 * the _rcu_barrier phase:
620 * "Begin": rcu_barrier_callback() started.
621 * "Check": rcu_barrier_callback() checking for piggybacking.
622 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
623 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
624 * "Offline": rcu_barrier_callback() found offline CPU
Paul E. McKenney3fbfbf72012-08-19 21:35:53 -0700625 * "OnlineNoCB": rcu_barrier_callback() found online no-CBs CPU.
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700626 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
627 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
628 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
629 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
630 * "LastCB": An rcu_barrier_callback() invoked the last callback.
631 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
632 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
633 * is the count of remaining callbacks, and "done" is the piggybacking count.
634 */
635TRACE_EVENT(rcu_barrier,
636
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400637 TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700638
639 TP_ARGS(rcuname, s, cpu, cnt, done),
640
641 TP_STRUCT__entry(
Steven Rostedt (Red Hat)e66c33d2013-07-12 16:50:28 -0400642 __field(const char *, rcuname)
643 __field(const char *, s)
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700644 __field(int, cpu)
645 __field(int, cnt)
646 __field(unsigned long, done)
647 ),
648
649 TP_fast_assign(
650 __entry->rcuname = rcuname;
651 __entry->s = s;
652 __entry->cpu = cpu;
653 __entry->cnt = cnt;
654 __entry->done = done;
655 ),
656
657 TP_printk("%s %s cpu %d remaining %d # %lu",
658 __entry->rcuname, __entry->s, __entry->cpu, __entry->cnt,
659 __entry->done)
660);
661
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700662#else /* #ifdef CONFIG_RCU_TRACE */
663
664#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800665#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
666 qsmask) do { } while (0)
Paul E. McKenneybd9f0682012-12-29 21:51:20 -0800667#define trace_rcu_future_grace_period(rcuname, gpnum, completed, c, \
668 level, grplo, grphi, event) \
669 do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700670#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
671#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800672#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
673 grplo, grphi, gp_tasks) do { } \
674 while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700675#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700676#define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800677#define trace_rcu_prep_idle(reason) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800678#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
679#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
680 do { } while (0)
681#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
682 do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700683#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
684#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
Paul E. McKenney4968c302011-12-07 16:32:40 -0800685#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
686 do { } while (0)
Paul E. McKenney52494532012-11-14 16:26:40 -0800687#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
688 do { } while (0)
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700689#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700690
691#endif /* #else #ifdef CONFIG_RCU_TRACE */
692
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700693#endif /* _TRACE_RCU_H */
694
695/* This part must be outside protection */
696#include <trace/define_trace.h>