blob: 5678114073b5bef3b999f879d24c2bb90da72e1c [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/*
75 * Tracepoint for grace-period-initialization events. These are
76 * distinguished by the type of RCU, the new grace-period number, the
77 * rcu_node structure level, the starting and ending CPU covered by the
78 * rcu_node structure, and the mask of CPUs that will be waited for.
79 * All but the type of RCU are extracted from the rcu_node structure.
80 */
81TRACE_EVENT(rcu_grace_period_init,
82
83 TP_PROTO(char *rcuname, unsigned long gpnum, u8 level,
84 int grplo, int grphi, unsigned long qsmask),
85
86 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
87
88 TP_STRUCT__entry(
89 __field(char *, rcuname)
90 __field(unsigned long, gpnum)
91 __field(u8, level)
92 __field(int, grplo)
93 __field(int, grphi)
94 __field(unsigned long, qsmask)
95 ),
96
97 TP_fast_assign(
98 __entry->rcuname = rcuname;
99 __entry->gpnum = gpnum;
100 __entry->level = level;
101 __entry->grplo = grplo;
102 __entry->grphi = grphi;
103 __entry->qsmask = qsmask;
104 ),
105
106 TP_printk("%s %lu %u %d %d %lx",
107 __entry->rcuname, __entry->gpnum, __entry->level,
108 __entry->grplo, __entry->grphi, __entry->qsmask)
109);
110
111/*
112 * Tracepoint for tasks blocking within preemptible-RCU read-side
113 * critical sections. Track the type of RCU (which one day might
114 * include SRCU), the grace-period number that the task is blocking
115 * (the current or the next), and the task's PID.
116 */
117TRACE_EVENT(rcu_preempt_task,
118
119 TP_PROTO(char *rcuname, int pid, unsigned long gpnum),
120
121 TP_ARGS(rcuname, pid, gpnum),
122
123 TP_STRUCT__entry(
124 __field(char *, rcuname)
125 __field(unsigned long, gpnum)
126 __field(int, pid)
127 ),
128
129 TP_fast_assign(
130 __entry->rcuname = rcuname;
131 __entry->gpnum = gpnum;
132 __entry->pid = pid;
133 ),
134
135 TP_printk("%s %lu %d",
136 __entry->rcuname, __entry->gpnum, __entry->pid)
137);
138
139/*
140 * Tracepoint for tasks that blocked within a given preemptible-RCU
141 * read-side critical section exiting that critical section. Track the
142 * type of RCU (which one day might include SRCU) and the task's PID.
143 */
144TRACE_EVENT(rcu_unlock_preempted_task,
145
146 TP_PROTO(char *rcuname, unsigned long gpnum, int pid),
147
148 TP_ARGS(rcuname, gpnum, pid),
149
150 TP_STRUCT__entry(
151 __field(char *, rcuname)
152 __field(unsigned long, gpnum)
153 __field(int, pid)
154 ),
155
156 TP_fast_assign(
157 __entry->rcuname = rcuname;
158 __entry->gpnum = gpnum;
159 __entry->pid = pid;
160 ),
161
162 TP_printk("%s %lu %d", __entry->rcuname, __entry->gpnum, __entry->pid)
163);
164
165/*
166 * Tracepoint for quiescent-state-reporting events. These are
167 * distinguished by the type of RCU, the grace-period number, the
168 * mask of quiescent lower-level entities, the rcu_node structure level,
169 * the starting and ending CPU covered by the rcu_node structure, and
170 * whether there are any blocked tasks blocking the current grace period.
171 * All but the type of RCU are extracted from the rcu_node structure.
172 */
173TRACE_EVENT(rcu_quiescent_state_report,
174
175 TP_PROTO(char *rcuname, unsigned long gpnum,
176 unsigned long mask, unsigned long qsmask,
177 u8 level, int grplo, int grphi, int gp_tasks),
178
179 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
180
181 TP_STRUCT__entry(
182 __field(char *, rcuname)
183 __field(unsigned long, gpnum)
184 __field(unsigned long, mask)
185 __field(unsigned long, qsmask)
186 __field(u8, level)
187 __field(int, grplo)
188 __field(int, grphi)
189 __field(u8, gp_tasks)
190 ),
191
192 TP_fast_assign(
193 __entry->rcuname = rcuname;
194 __entry->gpnum = gpnum;
195 __entry->mask = mask;
196 __entry->qsmask = qsmask;
197 __entry->level = level;
198 __entry->grplo = grplo;
199 __entry->grphi = grphi;
200 __entry->gp_tasks = gp_tasks;
201 ),
202
203 TP_printk("%s %lu %lx>%lx %u %d %d %u",
204 __entry->rcuname, __entry->gpnum,
205 __entry->mask, __entry->qsmask, __entry->level,
206 __entry->grplo, __entry->grphi, __entry->gp_tasks)
207);
208
209/*
210 * Tracepoint for quiescent states detected by force_quiescent_state().
211 * These trace events include the type of RCU, the grace-period number
212 * that was blocked by the CPU, the CPU itself, and the type of quiescent
213 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
214 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
215 * too long.
216 */
217TRACE_EVENT(rcu_fqs,
218
219 TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent),
220
221 TP_ARGS(rcuname, gpnum, cpu, qsevent),
222
223 TP_STRUCT__entry(
224 __field(char *, rcuname)
225 __field(unsigned long, gpnum)
226 __field(int, cpu)
227 __field(char *, qsevent)
228 ),
229
230 TP_fast_assign(
231 __entry->rcuname = rcuname;
232 __entry->gpnum = gpnum;
233 __entry->cpu = cpu;
234 __entry->qsevent = qsevent;
235 ),
236
237 TP_printk("%s %lu %d %s",
238 __entry->rcuname, __entry->gpnum,
239 __entry->cpu, __entry->qsevent)
240);
241
242#endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) */
243
244/*
245 * Tracepoint for dyntick-idle entry/exit events. These take a string
Paul E. McKenney045fb932011-11-22 12:13:03 -0800246 * as argument: "Start" for entering dyntick-idle mode, "End" for
247 * leaving it, "--=" for events moving towards idle, and "++=" for events
248 * moving away from idle. "Error on entry: not idle task" and "Error on
249 * exit: not idle task" indicate that a non-idle task is erroneously
250 * toying with the idle loop.
251 *
252 * These events also take a pair of numbers, which indicate the nesting
253 * depth before and after the event of interest. Note that task-related
254 * events use the upper bits of each number, while interrupt-related
255 * events use the lower bits.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700256 */
257TRACE_EVENT(rcu_dyntick,
258
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700259 TP_PROTO(char *polarity, long long oldnesting, long long newnesting),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700260
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700261 TP_ARGS(polarity, oldnesting, newnesting),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700262
263 TP_STRUCT__entry(
264 __field(char *, polarity)
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700265 __field(long long, oldnesting)
266 __field(long long, newnesting)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700267 ),
268
269 TP_fast_assign(
270 __entry->polarity = polarity;
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700271 __entry->oldnesting = oldnesting;
272 __entry->newnesting = newnesting;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700273 ),
274
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700275 TP_printk("%s %llx %llx", __entry->polarity,
276 __entry->oldnesting, __entry->newnesting)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700277);
278
279/*
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800280 * Tracepoint for RCU preparation for idle, the goal being to get RCU
281 * processing done so that the current CPU can shut off its scheduling
282 * clock and enter dyntick-idle mode. One way to accomplish this is
283 * to drain all RCU callbacks from this CPU, and the other is to have
284 * done everything RCU requires for the current grace period. In this
285 * latter case, the CPU will be awakened at the end of the current grace
286 * period in order to process the remainder of its callbacks.
287 *
288 * These tracepoints take a string as argument:
289 *
290 * "No callbacks": Nothing to do, no callbacks on this CPU.
291 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800292 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
Paul E. McKenney7cb92492011-11-28 12:28:34 -0800293 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
Paul E. McKenneyfd4b3522012-05-05 19:10:35 -0700294 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800295 * "More callbacks": Still more callbacks, try again to clear them out.
296 * "Callbacks drained": All callbacks processed, off to dyntick idle!
Paul E. McKenney7cb92492011-11-28 12:28:34 -0800297 * "Timer": Timer fired to cause CPU to continue processing callbacks.
Paul E. McKenney21e52e12012-04-30 14:16:19 -0700298 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
Paul E. McKenney2fdbb312012-02-23 15:58:29 -0800299 * "Cleanup after idle": Idle exited, timer canceled.
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800300 */
301TRACE_EVENT(rcu_prep_idle,
302
303 TP_PROTO(char *reason),
304
305 TP_ARGS(reason),
306
307 TP_STRUCT__entry(
308 __field(char *, reason)
309 ),
310
311 TP_fast_assign(
312 __entry->reason = reason;
313 ),
314
315 TP_printk("%s", __entry->reason)
316);
317
318/*
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700319 * Tracepoint for the registration of a single RCU callback function.
320 * The first argument is the type of RCU, the second argument is
Paul E. McKenney486e2592012-01-06 14:11:30 -0800321 * a pointer to the RCU callback itself, the third element is the
322 * number of lazy callbacks queued, and the fourth element is the
323 * total number of callbacks queued.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700324 */
325TRACE_EVENT(rcu_callback,
326
Paul E. McKenney486e2592012-01-06 14:11:30 -0800327 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy,
328 long qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700329
Paul E. McKenney486e2592012-01-06 14:11:30 -0800330 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700331
332 TP_STRUCT__entry(
333 __field(char *, rcuname)
334 __field(void *, rhp)
335 __field(void *, func)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800336 __field(long, qlen_lazy)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700337 __field(long, qlen)
338 ),
339
340 TP_fast_assign(
341 __entry->rcuname = rcuname;
342 __entry->rhp = rhp;
343 __entry->func = rhp->func;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800344 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700345 __entry->qlen = qlen;
346 ),
347
Paul E. McKenney486e2592012-01-06 14:11:30 -0800348 TP_printk("%s rhp=%p func=%pf %ld/%ld",
349 __entry->rcuname, __entry->rhp, __entry->func,
350 __entry->qlen_lazy, __entry->qlen)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700351);
352
353/*
354 * Tracepoint for the registration of a single RCU callback of the special
355 * kfree() form. The first argument is the RCU type, the second argument
356 * is a pointer to the RCU callback, the third argument is the offset
357 * of the callback within the enclosing RCU-protected data structure,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800358 * the fourth argument is the number of lazy callbacks queued, and the
359 * fifth argument is the total number of callbacks queued.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700360 */
361TRACE_EVENT(rcu_kfree_callback,
362
363 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800364 long qlen_lazy, long qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700365
Paul E. McKenney486e2592012-01-06 14:11:30 -0800366 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700367
368 TP_STRUCT__entry(
369 __field(char *, rcuname)
370 __field(void *, rhp)
371 __field(unsigned long, offset)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800372 __field(long, qlen_lazy)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700373 __field(long, qlen)
374 ),
375
376 TP_fast_assign(
377 __entry->rcuname = rcuname;
378 __entry->rhp = rhp;
379 __entry->offset = offset;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800380 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700381 __entry->qlen = qlen;
382 ),
383
Paul E. McKenney486e2592012-01-06 14:11:30 -0800384 TP_printk("%s rhp=%p func=%ld %ld/%ld",
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700385 __entry->rcuname, __entry->rhp, __entry->offset,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800386 __entry->qlen_lazy, __entry->qlen)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700387);
388
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700389/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700390 * Tracepoint for marking the beginning rcu_do_batch, performed to start
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700391 * RCU callback invocation. The first argument is the RCU flavor,
Paul E. McKenney486e2592012-01-06 14:11:30 -0800392 * the second is the number of lazy callbacks queued, the third is
393 * the total number of callbacks queued, and the fourth argument is
394 * the current RCU-callback batch limit.
Paul E. McKenney300df912011-06-18 22:26:31 -0700395 */
396TRACE_EVENT(rcu_batch_start,
397
Paul E. McKenney486e2592012-01-06 14:11:30 -0800398 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -0700399
Paul E. McKenney486e2592012-01-06 14:11:30 -0800400 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -0700401
402 TP_STRUCT__entry(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700403 __field(char *, rcuname)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800404 __field(long, qlen_lazy)
Paul E. McKenney300df912011-06-18 22:26:31 -0700405 __field(long, qlen)
406 __field(int, blimit)
407 ),
408
409 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700410 __entry->rcuname = rcuname;
Paul E. McKenney486e2592012-01-06 14:11:30 -0800411 __entry->qlen_lazy = qlen_lazy;
Paul E. McKenney300df912011-06-18 22:26:31 -0700412 __entry->qlen = qlen;
413 __entry->blimit = blimit;
414 ),
415
Paul E. McKenney486e2592012-01-06 14:11:30 -0800416 TP_printk("%s CBs=%ld/%ld bl=%d",
417 __entry->rcuname, __entry->qlen_lazy, __entry->qlen,
418 __entry->blimit)
Paul E. McKenney300df912011-06-18 22:26:31 -0700419);
420
421/*
422 * Tracepoint for the invocation of a single RCU callback function.
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700423 * The first argument is the type of RCU, and the second argument is
424 * a pointer to the RCU callback itself.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700425 */
426TRACE_EVENT(rcu_invoke_callback,
427
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700428 TP_PROTO(char *rcuname, struct rcu_head *rhp),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700429
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700430 TP_ARGS(rcuname, rhp),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700431
432 TP_STRUCT__entry(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700433 __field(char *, rcuname)
434 __field(void *, rhp)
435 __field(void *, func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700436 ),
437
438 TP_fast_assign(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700439 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700440 __entry->rhp = rhp;
441 __entry->func = rhp->func;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700442 ),
443
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700444 TP_printk("%s rhp=%p func=%pf",
445 __entry->rcuname, __entry->rhp, __entry->func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700446);
447
448/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700449 * Tracepoint for the invocation of a single RCU callback of the special
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700450 * kfree() form. The first argument is the RCU flavor, the second
451 * argument is a pointer to the RCU callback, and the third argument
452 * is the offset of the callback within the enclosing RCU-protected
453 * data structure.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700454 */
455TRACE_EVENT(rcu_invoke_kfree_callback,
456
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700457 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700458
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700459 TP_ARGS(rcuname, rhp, offset),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700460
461 TP_STRUCT__entry(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700462 __field(char *, rcuname)
463 __field(void *, rhp)
Paul E. McKenney300df912011-06-18 22:26:31 -0700464 __field(unsigned long, offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700465 ),
466
467 TP_fast_assign(
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700468 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700469 __entry->rhp = rhp;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700470 __entry->offset = offset;
471 ),
472
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700473 TP_printk("%s rhp=%p func=%ld",
474 __entry->rcuname, __entry->rhp, __entry->offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700475);
476
477/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700478 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
Paul E. McKenney4968c302011-12-07 16:32:40 -0800479 * invoked. The first argument is the name of the RCU flavor,
480 * the second argument is number of callbacks actually invoked,
481 * the third argument (cb) is whether or not any of the callbacks that
482 * were ready to invoke at the beginning of this batch are still
483 * queued, the fourth argument (nr) is the return value of need_resched(),
484 * the fifth argument (iit) is 1 if the current task is the idle task,
485 * and the sixth argument (risk) is the return value from
486 * rcu_is_callbacks_kthread().
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700487 */
488TRACE_EVENT(rcu_batch_end,
489
Paul E. McKenney4968c302011-12-07 16:32:40 -0800490 TP_PROTO(char *rcuname, int callbacks_invoked,
491 bool cb, bool nr, bool iit, bool risk),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700492
Paul E. McKenney4968c302011-12-07 16:32:40 -0800493 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700494
495 TP_STRUCT__entry(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700496 __field(char *, rcuname)
Paul E. McKenney300df912011-06-18 22:26:31 -0700497 __field(int, callbacks_invoked)
Paul E. McKenney4968c302011-12-07 16:32:40 -0800498 __field(bool, cb)
499 __field(bool, nr)
500 __field(bool, iit)
501 __field(bool, risk)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700502 ),
503
504 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700505 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700506 __entry->callbacks_invoked = callbacks_invoked;
Paul E. McKenney4968c302011-12-07 16:32:40 -0800507 __entry->cb = cb;
508 __entry->nr = nr;
509 __entry->iit = iit;
510 __entry->risk = risk;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700511 ),
512
Paul E. McKenney4968c302011-12-07 16:32:40 -0800513 TP_printk("%s CBs-invoked=%d idle=%c%c%c%c",
514 __entry->rcuname, __entry->callbacks_invoked,
515 __entry->cb ? 'C' : '.',
516 __entry->nr ? 'S' : '.',
517 __entry->iit ? 'I' : '.',
518 __entry->risk ? 'R' : '.')
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700519);
520
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700521/*
522 * Tracepoint for rcutorture readers. The first argument is the name
523 * of the RCU flavor from rcutorture's viewpoint and the second argument
524 * is the callback address.
525 */
526TRACE_EVENT(rcu_torture_read,
527
528 TP_PROTO(char *rcutorturename, struct rcu_head *rhp),
529
530 TP_ARGS(rcutorturename, rhp),
531
532 TP_STRUCT__entry(
533 __field(char *, rcutorturename)
534 __field(struct rcu_head *, rhp)
535 ),
536
537 TP_fast_assign(
538 __entry->rcutorturename = rcutorturename;
539 __entry->rhp = rhp;
540 ),
541
542 TP_printk("%s torture read %p",
543 __entry->rcutorturename, __entry->rhp)
544);
545
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700546/*
547 * Tracepoint for _rcu_barrier() execution. The string "s" describes
548 * the _rcu_barrier phase:
549 * "Begin": rcu_barrier_callback() started.
550 * "Check": rcu_barrier_callback() checking for piggybacking.
551 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
552 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
553 * "Offline": rcu_barrier_callback() found offline CPU
Paul E. McKenney3fbfbf72012-08-19 21:35:53 -0700554 * "OnlineNoCB": rcu_barrier_callback() found online no-CBs CPU.
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700555 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
556 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
557 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
558 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
559 * "LastCB": An rcu_barrier_callback() invoked the last callback.
560 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
561 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
562 * is the count of remaining callbacks, and "done" is the piggybacking count.
563 */
564TRACE_EVENT(rcu_barrier,
565
566 TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done),
567
568 TP_ARGS(rcuname, s, cpu, cnt, done),
569
570 TP_STRUCT__entry(
571 __field(char *, rcuname)
572 __field(char *, s)
573 __field(int, cpu)
574 __field(int, cnt)
575 __field(unsigned long, done)
576 ),
577
578 TP_fast_assign(
579 __entry->rcuname = rcuname;
580 __entry->s = s;
581 __entry->cpu = cpu;
582 __entry->cnt = cnt;
583 __entry->done = done;
584 ),
585
586 TP_printk("%s %s cpu %d remaining %d # %lu",
587 __entry->rcuname, __entry->s, __entry->cpu, __entry->cnt,
588 __entry->done)
589);
590
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700591#else /* #ifdef CONFIG_RCU_TRACE */
592
593#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800594#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
595 qsmask) do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700596#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
597#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800598#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
599 grplo, grphi, gp_tasks) do { } \
600 while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700601#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
Paul E. McKenney4145fa72011-10-31 15:01:54 -0700602#define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
Paul E. McKenney433cddd2011-11-22 14:58:03 -0800603#define trace_rcu_prep_idle(reason) do { } while (0)
Paul E. McKenney486e2592012-01-06 14:11:30 -0800604#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
605#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
606 do { } while (0)
607#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
608 do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700609#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
610#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
Paul E. McKenney4968c302011-12-07 16:32:40 -0800611#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
612 do { } while (0)
Paul E. McKenney91afaf32011-10-02 07:44:32 -0700613#define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0)
Paul E. McKenneya83eff02012-05-23 18:47:05 -0700614#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
Paul E. McKenneyd4c08f22011-06-25 06:36:56 -0700615
616#endif /* #else #ifdef CONFIG_RCU_TRACE */
617
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700618#endif /* _TRACE_RCU_H */
619
620/* This part must be outside protection */
621#include <trace/define_trace.h>