blob: 59ebcc89f148ba85789581cda7f233ab2374ed92 [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
Paul E. McKenney300df912011-06-18 22:26:31 -070022 TP_PROTO(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(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070027 __field(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/*
42 * Tracepoint for grace-period events: starting and ending a grace
43 * period ("start" and "end", respectively), a CPU noting the start
44 * of a new grace period or the end of an old grace period ("cpustart"
45 * and "cpuend", respectively), a CPU passing through a quiescent
46 * state ("cpuqs"), a CPU coming online or going offline ("cpuonl"
Paul E. McKenney6d4b4182012-11-27 16:55:44 -080047 * and "cpuofl", respectively), a CPU being kicked for being too
48 * long in dyntick-idle mode ("kick"), a CPU accelerating its new
49 * callbacks to RCU_NEXT_READY_TAIL ("AccReadyCB"), and a CPU
50 * accelerating its new callbacks to RCU_WAIT_TAIL ("AccWaitCB").
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -070051 */
52TRACE_EVENT(rcu_grace_period,
53
54 TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent),
55
56 TP_ARGS(rcuname, gpnum, gpevent),
57
58 TP_STRUCT__entry(
59 __field(char *, rcuname)
60 __field(unsigned long, gpnum)
61 __field(char *, gpevent)
62 ),
63
64 TP_fast_assign(
65 __entry->rcuname = rcuname;
66 __entry->gpnum = gpnum;
67 __entry->gpevent = gpevent;
68 ),
69
70 TP_printk("%s %lu %s",
71 __entry->rcuname, __entry->gpnum, __entry->gpevent)
72);
73
74/*
Paul E. McKenneybd9f0682012-12-29 21:51:20 -080075 * Tracepoint for future grace-period events, including those for no-callbacks
76 * CPUs. The caller should pull the data from the rcu_node structure,
77 * other than rcuname, which comes from the rcu_state structure, and event,
78 * which is one of the following:
Paul E. McKenney09c7b892013-02-08 15:55:02 -080079 *
80 * "Startleaf": Request a nocb grace period based on leaf-node data.
81 * "Startedleaf": Leaf-node start proved sufficient.
82 * "Startedleafroot": Leaf-node start proved sufficient after checking root.
83 * "Startedroot": Requested a nocb grace period based on root-node data.
84 * "StartWait": Start waiting for the requested grace period.
85 * "ResumeWait": Resume waiting after signal.
86 * "EndWait": Complete wait.
87 * "Cleanup": Clean up rcu_node structure after previous GP.
88 * "CleanupMore": Clean up, and another no-CB GP is needed.
89 */
Paul E. McKenneybd9f0682012-12-29 21:51:20 -080090TRACE_EVENT(rcu_future_grace_period,
Paul E. McKenney09c7b892013-02-08 15:55:02 -080091
92 TP_PROTO(char *rcuname, unsigned long gpnum, unsigned long completed,
93 unsigned long c, u8 level, int grplo, int grphi,
94 char *gpevent),
95
96 TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent),
97
98 TP_STRUCT__entry(
99 __field(char *, rcuname)
100 __field(unsigned long, gpnum)
101 __field(unsigned long, completed)
102 __field(unsigned long, c)
103 __field(u8, level)
104 __field(int, grplo)
105 __field(int, grphi)
106 __field(char *, gpevent)
107 ),
108
109 TP_fast_assign(
110 __entry->rcuname = rcuname;
111 __entry->gpnum = gpnum;
112 __entry->completed = completed;
113 __entry->c = c;
114 __entry->level = level;
115 __entry->grplo = grplo;
116 __entry->grphi = grphi;
117 __entry->gpevent = gpevent;
118 ),
119
120 TP_printk("%s %lu %lu %lu %u %d %d %s",
121 __entry->rcuname, __entry->gpnum, __entry->completed,
122 __entry->c, __entry->level, __entry->grplo, __entry->grphi,
123 __entry->gpevent)
124);
125
126/*
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700127 * Tracepoint for grace-period-initialization events. These are
128 * distinguished by the type of RCU, the new grace-period number, the
129 * rcu_node structure level, the starting and ending CPU covered by the
130 * rcu_node structure, and the mask of CPUs that will be waited for.
131 * All but the type of RCU are extracted from the rcu_node structure.
132 */
133TRACE_EVENT(rcu_grace_period_init,
134
135 TP_PROTO(char *rcuname, unsigned long gpnum, u8 level,
136 int grplo, int grphi, unsigned long qsmask),
137
138 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
139
140 TP_STRUCT__entry(
141 __field(char *, rcuname)
142 __field(unsigned long, gpnum)
143 __field(u8, level)
144 __field(int, grplo)
145 __field(int, grphi)
146 __field(unsigned long, qsmask)
147 ),
148
149 TP_fast_assign(
150 __entry->rcuname = rcuname;
151 __entry->gpnum = gpnum;
152 __entry->level = level;
153 __entry->grplo = grplo;
154 __entry->grphi = grphi;
155 __entry->qsmask = qsmask;
156 ),
157
158 TP_printk("%s %lu %u %d %d %lx",
159 __entry->rcuname, __entry->gpnum, __entry->level,
160 __entry->grplo, __entry->grphi, __entry->qsmask)
161);
162
163/*
164 * Tracepoint for tasks blocking within preemptible-RCU read-side
165 * critical sections. Track the type of RCU (which one day might
166 * include SRCU), the grace-period number that the task is blocking
167 * (the current or the next), and the task's PID.
168 */
169TRACE_EVENT(rcu_preempt_task,
170
171 TP_PROTO(char *rcuname, int pid, unsigned long gpnum),
172
173 TP_ARGS(rcuname, pid, gpnum),
174
175 TP_STRUCT__entry(
176 __field(char *, rcuname)
177 __field(unsigned long, gpnum)
178 __field(int, pid)
179 ),
180
181 TP_fast_assign(
182 __entry->rcuname = rcuname;
183 __entry->gpnum = gpnum;
184 __entry->pid = pid;
185 ),
186
187 TP_printk("%s %lu %d",
188 __entry->rcuname, __entry->gpnum, __entry->pid)
189);
190
191/*
192 * Tracepoint for tasks that blocked within a given preemptible-RCU
193 * read-side critical section exiting that critical section. Track the
194 * type of RCU (which one day might include SRCU) and the task's PID.
195 */
196TRACE_EVENT(rcu_unlock_preempted_task,
197
198 TP_PROTO(char *rcuname, unsigned long gpnum, int pid),
199
200 TP_ARGS(rcuname, gpnum, pid),
201
202 TP_STRUCT__entry(
203 __field(char *, rcuname)
204 __field(unsigned long, gpnum)
205 __field(int, pid)
206 ),
207
208 TP_fast_assign(
209 __entry->rcuname = rcuname;
210 __entry->gpnum = gpnum;
211 __entry->pid = pid;
212 ),
213
214 TP_printk("%s %lu %d", __entry->rcuname, __entry->gpnum, __entry->pid)
215);
216
217/*
218 * Tracepoint for quiescent-state-reporting events. These are
219 * distinguished by the type of RCU, the grace-period number, the
220 * mask of quiescent lower-level entities, the rcu_node structure level,
221 * the starting and ending CPU covered by the rcu_node structure, and
222 * whether there are any blocked tasks blocking the current grace period.
223 * All but the type of RCU are extracted from the rcu_node structure.
224 */
225TRACE_EVENT(rcu_quiescent_state_report,
226
227 TP_PROTO(char *rcuname, unsigned long gpnum,
228 unsigned long mask, unsigned long qsmask,
229 u8 level, int grplo, int grphi, int gp_tasks),
230
231 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
232
233 TP_STRUCT__entry(
234 __field(char *, rcuname)
235 __field(unsigned long, gpnum)
236 __field(unsigned long, mask)
237 __field(unsigned long, qsmask)
238 __field(u8, level)
239 __field(int, grplo)
240 __field(int, grphi)
241 __field(u8, gp_tasks)
242 ),
243
244 TP_fast_assign(
245 __entry->rcuname = rcuname;
246 __entry->gpnum = gpnum;
247 __entry->mask = mask;
248 __entry->qsmask = qsmask;
249 __entry->level = level;
250 __entry->grplo = grplo;
251 __entry->grphi = grphi;
252 __entry->gp_tasks = gp_tasks;
253 ),
254
255 TP_printk("%s %lu %lx>%lx %u %d %d %u",
256 __entry->rcuname, __entry->gpnum,
257 __entry->mask, __entry->qsmask, __entry->level,
258 __entry->grplo, __entry->grphi, __entry->gp_tasks)
259);
260
261/*
262 * Tracepoint for quiescent states detected by force_quiescent_state().
263 * These trace events include the type of RCU, the grace-period number
264 * that was blocked by the CPU, the CPU itself, and the type of quiescent
265 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
266 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
267 * too long.
268 */
269TRACE_EVENT(rcu_fqs,
270
271 TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent),
272
273 TP_ARGS(rcuname, gpnum, cpu, qsevent),
274
275 TP_STRUCT__entry(
276 __field(char *, rcuname)
277 __field(unsigned long, gpnum)
278 __field(int, cpu)
279 __field(char *, qsevent)
280 ),
281
282 TP_fast_assign(
283 __entry->rcuname = rcuname;
284 __entry->gpnum = gpnum;
285 __entry->cpu = cpu;
286 __entry->qsevent = qsevent;
287 ),
288
289 TP_printk("%s %lu %d %s",
290 __entry->rcuname, __entry->gpnum,
291 __entry->cpu, __entry->qsevent)
292);
293
294#endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) */
295
296/*
297 * Tracepoint for dyntick-idle entry/exit events. These take a string
Paul E. McKenney045fb932011-11-22 12:13:03 -0800298 * as argument: "Start" for entering dyntick-idle mode, "End" for
299 * leaving it, "--=" for events moving towards idle, and "++=" for events
300 * moving away from idle. "Error on entry: not idle task" and "Error on
301 * exit: not idle task" indicate that a non-idle task is erroneously
302 * toying with the idle loop.
303 *
304 * These events also take a pair of numbers, which indicate the nesting
305 * depth before and after the event of interest. Note that task-related
306 * events use the upper bits of each number, while interrupt-related
307 * events use the lower bits.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700308 */
309TRACE_EVENT(rcu_dyntick,
310
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700311 TP_PROTO(char *polarity, long long oldnesting, long long newnesting),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700312
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700313 TP_ARGS(polarity, oldnesting, newnesting),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700314
315 TP_STRUCT__entry(
316 __field(char *, polarity)
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700317 __field(long long, oldnesting)
318 __field(long long, newnesting)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700319 ),
320
321 TP_fast_assign(
322 __entry->polarity = polarity;
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700323 __entry->oldnesting = oldnesting;
324 __entry->newnesting = newnesting;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700325 ),
326
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700327 TP_printk("%s %llx %llx", __entry->polarity,
328 __entry->oldnesting, __entry->newnesting)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700329);
330
331/*
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800332 * Tracepoint for RCU preparation for idle, the goal being to get RCU
333 * processing done so that the current CPU can shut off its scheduling
334 * clock and enter dyntick-idle mode. One way to accomplish this is
335 * to drain all RCU callbacks from this CPU, and the other is to have
336 * done everything RCU requires for the current grace period. In this
337 * latter case, the CPU will be awakened at the end of the current grace
338 * period in order to process the remainder of its callbacks.
339 *
340 * These tracepoints take a string as argument:
341 *
342 * "No callbacks": Nothing to do, no callbacks on this CPU.
343 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800344 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
Paul E. McKenney7cb92492011-11-28 12:28:34 -0800345 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
Paul E. McKenneyfd4b3522012-05-05 19:10:35 -0700346 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800347 * "More callbacks": Still more callbacks, try again to clear them out.
348 * "Callbacks drained": All callbacks processed, off to dyntick idle!
Paul E. McKenney7cb92492011-11-28 12:28:34 -0800349 * "Timer": Timer fired to cause CPU to continue processing callbacks.
Paul E. McKenney21e52e12012-04-30 14:16:19 -0700350 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
Paul E. McKenney2fdbb312012-02-23 15:58:29 -0800351 * "Cleanup after idle": Idle exited, timer canceled.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800352 */
353TRACE_EVENT(rcu_prep_idle,
354
355 TP_PROTO(char *reason),
356
357 TP_ARGS(reason),
358
359 TP_STRUCT__entry(
360 __field(char *, reason)
361 ),
362
363 TP_fast_assign(
364 __entry->reason = reason;
365 ),
366
367 TP_printk("%s", __entry->reason)
368);
369
370/*
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700371 * Tracepoint for the registration of a single RCU callback function.
372 * The first argument is the type of RCU, the second argument is
Paul E. McKenney486e2592012-01-06 14:11:30 -0800373 * a pointer to the RCU callback itself, the third element is the
374 * number of lazy callbacks queued, and the fourth element is the
375 * total number of callbacks queued.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700376 */
377TRACE_EVENT(rcu_callback,
378
Paul E. McKenney486e2592012-01-06 14:11:30 -0800379 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy,
380 long qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700381
Paul E. McKenney486e2592012-01-06 14:11:30 -0800382 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700383
384 TP_STRUCT__entry(
385 __field(char *, rcuname)
386 __field(void *, rhp)
387 __field(void *, func)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800388 __field(long, qlen_lazy)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700389 __field(long, qlen)
390 ),
391
392 TP_fast_assign(
393 __entry->rcuname = rcuname;
394 __entry->rhp = rhp;
395 __entry->func = rhp->func;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800396 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700397 __entry->qlen = qlen;
398 ),
399
Paul E. McKenney486e2592012-01-06 14:11:30 -0800400 TP_printk("%s rhp=%p func=%pf %ld/%ld",
401 __entry->rcuname, __entry->rhp, __entry->func,
402 __entry->qlen_lazy, __entry->qlen)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700403);
404
405/*
406 * Tracepoint for the registration of a single RCU callback of the special
407 * kfree() form. The first argument is the RCU type, the second argument
408 * is a pointer to the RCU callback, the third argument is the offset
409 * of the callback within the enclosing RCU-protected data structure,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800410 * the fourth argument is the number of lazy callbacks queued, and the
411 * fifth argument is the total number of callbacks queued.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700412 */
413TRACE_EVENT(rcu_kfree_callback,
414
415 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800416 long qlen_lazy, long qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700417
Paul E. McKenney486e2592012-01-06 14:11:30 -0800418 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700419
420 TP_STRUCT__entry(
421 __field(char *, rcuname)
422 __field(void *, rhp)
423 __field(unsigned long, offset)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800424 __field(long, qlen_lazy)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700425 __field(long, qlen)
426 ),
427
428 TP_fast_assign(
429 __entry->rcuname = rcuname;
430 __entry->rhp = rhp;
431 __entry->offset = offset;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800432 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700433 __entry->qlen = qlen;
434 ),
435
Paul E. McKenney486e2592012-01-06 14:11:30 -0800436 TP_printk("%s rhp=%p func=%ld %ld/%ld",
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700437 __entry->rcuname, __entry->rhp, __entry->offset,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800438 __entry->qlen_lazy, __entry->qlen)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700439);
440
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700441/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700442 * Tracepoint for marking the beginning rcu_do_batch, performed to start
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700443 * RCU callback invocation. The first argument is the RCU flavor,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800444 * the second is the number of lazy callbacks queued, the third is
445 * the total number of callbacks queued, and the fourth argument is
446 * the current RCU-callback batch limit.
Paul E. McKenney300df912011-06-18 22:26:31 -0700447 */
448TRACE_EVENT(rcu_batch_start,
449
Paul E. McKenney3aac7a82012-11-14 14:37:29 -0800450 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -0700451
Paul E. McKenney486e2592012-01-06 14:11:30 -0800452 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -0700453
454 TP_STRUCT__entry(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700455 __field(char *, rcuname)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800456 __field(long, qlen_lazy)
Paul E. McKenney300df912011-06-18 22:26:31 -0700457 __field(long, qlen)
Paul E. McKenney3aac7a82012-11-14 14:37:29 -0800458 __field(long, blimit)
Paul E. McKenney300df912011-06-18 22:26:31 -0700459 ),
460
461 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700462 __entry->rcuname = rcuname;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800463 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenney300df912011-06-18 22:26:31 -0700464 __entry->qlen = qlen;
465 __entry->blimit = blimit;
466 ),
467
Paul E. McKenney3aac7a82012-11-14 14:37:29 -0800468 TP_printk("%s CBs=%ld/%ld bl=%ld",
Paul E. McKenney486e2592012-01-06 14:11:30 -0800469 __entry->rcuname, __entry->qlen_lazy, __entry->qlen,
470 __entry->blimit)
Paul E. McKenney300df912011-06-18 22:26:31 -0700471);
472
473/*
474 * Tracepoint for the invocation of a single RCU callback function.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700475 * The first argument is the type of RCU, and the second argument is
476 * a pointer to the RCU callback itself.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700477 */
478TRACE_EVENT(rcu_invoke_callback,
479
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700480 TP_PROTO(char *rcuname, struct rcu_head *rhp),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700481
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700482 TP_ARGS(rcuname, rhp),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700483
484 TP_STRUCT__entry(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700485 __field(char *, rcuname)
486 __field(void *, rhp)
487 __field(void *, func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700488 ),
489
490 TP_fast_assign(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700491 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700492 __entry->rhp = rhp;
493 __entry->func = rhp->func;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700494 ),
495
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700496 TP_printk("%s rhp=%p func=%pf",
497 __entry->rcuname, __entry->rhp, __entry->func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700498);
499
500/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700501 * Tracepoint for the invocation of a single RCU callback of the special
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700502 * kfree() form. The first argument is the RCU flavor, the second
503 * argument is a pointer to the RCU callback, and the third argument
504 * is the offset of the callback within the enclosing RCU-protected
505 * data structure.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700506 */
507TRACE_EVENT(rcu_invoke_kfree_callback,
508
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700509 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700510
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700511 TP_ARGS(rcuname, rhp, offset),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700512
513 TP_STRUCT__entry(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700514 __field(char *, rcuname)
515 __field(void *, rhp)
Paul E. McKenney300df912011-06-18 22:26:31 -0700516 __field(unsigned long, offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700517 ),
518
519 TP_fast_assign(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700520 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700521 __entry->rhp = rhp;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700522 __entry->offset = offset;
523 ),
524
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700525 TP_printk("%s rhp=%p func=%ld",
526 __entry->rcuname, __entry->rhp, __entry->offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700527);
528
529/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700530 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
Paul E. McKenney4968c302011-12-07 16:32:40 -0800531 * invoked. The first argument is the name of the RCU flavor,
532 * the second argument is number of callbacks actually invoked,
533 * the third argument (cb) is whether or not any of the callbacks that
534 * were ready to invoke at the beginning of this batch are still
535 * queued, the fourth argument (nr) is the return value of need_resched(),
536 * the fifth argument (iit) is 1 if the current task is the idle task,
537 * and the sixth argument (risk) is the return value from
538 * rcu_is_callbacks_kthread().
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700539 */
540TRACE_EVENT(rcu_batch_end,
541
Paul E. McKenney4968c302011-12-07 16:32:40 -0800542 TP_PROTO(char *rcuname, int callbacks_invoked,
543 bool cb, bool nr, bool iit, bool risk),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700544
Paul E. McKenney4968c302011-12-07 16:32:40 -0800545 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700546
547 TP_STRUCT__entry(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700548 __field(char *, rcuname)
Paul E. McKenney300df912011-06-18 22:26:31 -0700549 __field(int, callbacks_invoked)
Paul E. McKenney4968c302011-12-07 16:32:40 -0800550 __field(bool, cb)
551 __field(bool, nr)
552 __field(bool, iit)
553 __field(bool, risk)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700554 ),
555
556 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700557 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700558 __entry->callbacks_invoked = callbacks_invoked;
Paul E. McKenney4968c302011-12-07 16:32:40 -0800559 __entry->cb = cb;
560 __entry->nr = nr;
561 __entry->iit = iit;
562 __entry->risk = risk;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700563 ),
564
Paul E. McKenney4968c302011-12-07 16:32:40 -0800565 TP_printk("%s CBs-invoked=%d idle=%c%c%c%c",
566 __entry->rcuname, __entry->callbacks_invoked,
567 __entry->cb ? 'C' : '.',
568 __entry->nr ? 'S' : '.',
569 __entry->iit ? 'I' : '.',
570 __entry->risk ? 'R' : '.')
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700571);
572
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700573/*
574 * Tracepoint for rcutorture readers. The first argument is the name
575 * of the RCU flavor from rcutorture's viewpoint and the second argument
576 * is the callback address.
577 */
578TRACE_EVENT(rcu_torture_read,
579
Paul E. McKenney52494532012-11-14 16:26:40 -0800580 TP_PROTO(char *rcutorturename, struct rcu_head *rhp,
581 unsigned long secs, unsigned long c_old, unsigned long c),
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700582
Paul E. McKenney52494532012-11-14 16:26:40 -0800583 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700584
585 TP_STRUCT__entry(
586 __field(char *, rcutorturename)
587 __field(struct rcu_head *, rhp)
Paul E. McKenney52494532012-11-14 16:26:40 -0800588 __field(unsigned long, secs)
589 __field(unsigned long, c_old)
590 __field(unsigned long, c)
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700591 ),
592
593 TP_fast_assign(
594 __entry->rcutorturename = rcutorturename;
595 __entry->rhp = rhp;
Paul E. McKenney52494532012-11-14 16:26:40 -0800596 __entry->secs = secs;
597 __entry->c_old = c_old;
598 __entry->c = c;
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700599 ),
600
Paul E. McKenney52494532012-11-14 16:26:40 -0800601 TP_printk("%s torture read %p %luus c: %lu %lu",
602 __entry->rcutorturename, __entry->rhp,
603 __entry->secs, __entry->c_old, __entry->c)
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700604);
605
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700606/*
607 * Tracepoint for _rcu_barrier() execution. The string "s" describes
608 * the _rcu_barrier phase:
609 * "Begin": rcu_barrier_callback() started.
610 * "Check": rcu_barrier_callback() checking for piggybacking.
611 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
612 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
613 * "Offline": rcu_barrier_callback() found offline CPU
Paul E. McKenney3fbfbf72012-08-19 21:35:53 -0700614 * "OnlineNoCB": rcu_barrier_callback() found online no-CBs CPU.
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700615 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
616 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
617 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
618 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
619 * "LastCB": An rcu_barrier_callback() invoked the last callback.
620 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
621 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
622 * is the count of remaining callbacks, and "done" is the piggybacking count.
623 */
624TRACE_EVENT(rcu_barrier,
625
626 TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done),
627
628 TP_ARGS(rcuname, s, cpu, cnt, done),
629
630 TP_STRUCT__entry(
631 __field(char *, rcuname)
632 __field(char *, s)
633 __field(int, cpu)
634 __field(int, cnt)
635 __field(unsigned long, done)
636 ),
637
638 TP_fast_assign(
639 __entry->rcuname = rcuname;
640 __entry->s = s;
641 __entry->cpu = cpu;
642 __entry->cnt = cnt;
643 __entry->done = done;
644 ),
645
646 TP_printk("%s %s cpu %d remaining %d # %lu",
647 __entry->rcuname, __entry->s, __entry->cpu, __entry->cnt,
648 __entry->done)
649);
650
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700651#else /* #ifdef CONFIG_RCU_TRACE */
652
653#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800654#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
655 qsmask) do { } while (0)
Paul E. McKenneybd9f0682012-12-29 21:51:20 -0800656#define trace_rcu_future_grace_period(rcuname, gpnum, completed, c, \
657 level, grplo, grphi, event) \
658 do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700659#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
660#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800661#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
662 grplo, grphi, gp_tasks) do { } \
663 while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700664#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700665#define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800666#define trace_rcu_prep_idle(reason) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800667#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
668#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
669 do { } while (0)
670#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
671 do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700672#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
673#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
Paul E. McKenney4968c302011-12-07 16:32:40 -0800674#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
675 do { } while (0)
Paul E. McKenney52494532012-11-14 16:26:40 -0800676#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
677 do { } while (0)
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700678#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700679
680#endif /* #else #ifdef CONFIG_RCU_TRACE */
681
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700682#endif /* _TRACE_RCU_H */
683
684/* This part must be outside protection */
685#include <trace/define_trace.h>