Linux 3.12.39
[linux/fpc-iii.git] / include / trace / events / rcu.h
blobee2376cfaab3a668d01374844c6757d07e7e1be8
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM rcu
4 #if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_RCU_H
7 #include <linux/tracepoint.h>
9 /*
10 * Tracepoint for start/end markers used for utilization calculations.
11 * By convention, the string is of the following forms:
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.
17 * An "@" character within "<activity>" is a comment character: Data
18 * reduction scripts will ignore the "@" and the remainder of the line.
20 TRACE_EVENT(rcu_utilization,
22 TP_PROTO(const char *s),
24 TP_ARGS(s),
26 TP_STRUCT__entry(
27 __field(const char *, s)
30 TP_fast_assign(
31 __entry->s = s;
34 TP_printk("%s", __entry->s)
37 #ifdef CONFIG_RCU_TRACE
39 #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
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"
47 * 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").
52 TRACE_EVENT(rcu_grace_period,
54 TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent),
56 TP_ARGS(rcuname, gpnum, gpevent),
58 TP_STRUCT__entry(
59 __field(const char *, rcuname)
60 __field(unsigned long, gpnum)
61 __field(const char *, gpevent)
64 TP_fast_assign(
65 __entry->rcuname = rcuname;
66 __entry->gpnum = gpnum;
67 __entry->gpevent = gpevent;
70 TP_printk("%s %lu %s",
71 __entry->rcuname, __entry->gpnum, __entry->gpevent)
75 * 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:
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.
90 TRACE_EVENT(rcu_future_grace_period,
92 TP_PROTO(const char *rcuname, unsigned long gpnum, unsigned long completed,
93 unsigned long c, u8 level, int grplo, int grphi,
94 const char *gpevent),
96 TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent),
98 TP_STRUCT__entry(
99 __field(const 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(const char *, gpevent)
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;
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)
127 * 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.
133 TRACE_EVENT(rcu_grace_period_init,
135 TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level,
136 int grplo, int grphi, unsigned long qsmask),
138 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
140 TP_STRUCT__entry(
141 __field(const char *, rcuname)
142 __field(unsigned long, gpnum)
143 __field(u8, level)
144 __field(int, grplo)
145 __field(int, grphi)
146 __field(unsigned long, qsmask)
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;
158 TP_printk("%s %lu %u %d %d %lx",
159 __entry->rcuname, __entry->gpnum, __entry->level,
160 __entry->grplo, __entry->grphi, __entry->qsmask)
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.
169 TRACE_EVENT(rcu_preempt_task,
171 TP_PROTO(const char *rcuname, int pid, unsigned long gpnum),
173 TP_ARGS(rcuname, pid, gpnum),
175 TP_STRUCT__entry(
176 __field(const char *, rcuname)
177 __field(unsigned long, gpnum)
178 __field(int, pid)
181 TP_fast_assign(
182 __entry->rcuname = rcuname;
183 __entry->gpnum = gpnum;
184 __entry->pid = pid;
187 TP_printk("%s %lu %d",
188 __entry->rcuname, __entry->gpnum, __entry->pid)
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.
196 TRACE_EVENT(rcu_unlock_preempted_task,
198 TP_PROTO(const char *rcuname, unsigned long gpnum, int pid),
200 TP_ARGS(rcuname, gpnum, pid),
202 TP_STRUCT__entry(
203 __field(const char *, rcuname)
204 __field(unsigned long, gpnum)
205 __field(int, pid)
208 TP_fast_assign(
209 __entry->rcuname = rcuname;
210 __entry->gpnum = gpnum;
211 __entry->pid = pid;
214 TP_printk("%s %lu %d", __entry->rcuname, __entry->gpnum, __entry->pid)
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.
225 TRACE_EVENT(rcu_quiescent_state_report,
227 TP_PROTO(const char *rcuname, unsigned long gpnum,
228 unsigned long mask, unsigned long qsmask,
229 u8 level, int grplo, int grphi, int gp_tasks),
231 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
233 TP_STRUCT__entry(
234 __field(const 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)
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;
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)
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.
269 TRACE_EVENT(rcu_fqs,
271 TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent),
273 TP_ARGS(rcuname, gpnum, cpu, qsevent),
275 TP_STRUCT__entry(
276 __field(const char *, rcuname)
277 __field(unsigned long, gpnum)
278 __field(int, cpu)
279 __field(const char *, qsevent)
282 TP_fast_assign(
283 __entry->rcuname = rcuname;
284 __entry->gpnum = gpnum;
285 __entry->cpu = cpu;
286 __entry->qsevent = qsevent;
289 TP_printk("%s %lu %d %s",
290 __entry->rcuname, __entry->gpnum,
291 __entry->cpu, __entry->qsevent)
294 #endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) */
297 * Tracepoint for dyntick-idle entry/exit events. These take a string
298 * 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.
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.
309 TRACE_EVENT(rcu_dyntick,
311 TP_PROTO(const char *polarity, long long oldnesting, long long newnesting),
313 TP_ARGS(polarity, oldnesting, newnesting),
315 TP_STRUCT__entry(
316 __field(const char *, polarity)
317 __field(long long, oldnesting)
318 __field(long long, newnesting)
321 TP_fast_assign(
322 __entry->polarity = polarity;
323 __entry->oldnesting = oldnesting;
324 __entry->newnesting = newnesting;
327 TP_printk("%s %llx %llx", __entry->polarity,
328 __entry->oldnesting, __entry->newnesting)
332 * 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.
340 * These tracepoints take a string as argument:
342 * "No callbacks": Nothing to do, no callbacks on this CPU.
343 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
344 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
345 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
346 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
347 * "More callbacks": Still more callbacks, try again to clear them out.
348 * "Callbacks drained": All callbacks processed, off to dyntick idle!
349 * "Timer": Timer fired to cause CPU to continue processing callbacks.
350 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
351 * "Cleanup after idle": Idle exited, timer canceled.
353 TRACE_EVENT(rcu_prep_idle,
355 TP_PROTO(const char *reason),
357 TP_ARGS(reason),
359 TP_STRUCT__entry(
360 __field(const char *, reason)
363 TP_fast_assign(
364 __entry->reason = reason;
367 TP_printk("%s", __entry->reason)
371 * Tracepoint for the registration of a single RCU callback function.
372 * The first argument is the type of RCU, the second argument is
373 * 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.
377 TRACE_EVENT(rcu_callback,
379 TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
380 long qlen),
382 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
384 TP_STRUCT__entry(
385 __field(const char *, rcuname)
386 __field(void *, rhp)
387 __field(void *, func)
388 __field(long, qlen_lazy)
389 __field(long, qlen)
392 TP_fast_assign(
393 __entry->rcuname = rcuname;
394 __entry->rhp = rhp;
395 __entry->func = rhp->func;
396 __entry->qlen_lazy = qlen_lazy;
397 __entry->qlen = qlen;
400 TP_printk("%s rhp=%p func=%pf %ld/%ld",
401 __entry->rcuname, __entry->rhp, __entry->func,
402 __entry->qlen_lazy, __entry->qlen)
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,
410 * the fourth argument is the number of lazy callbacks queued, and the
411 * fifth argument is the total number of callbacks queued.
413 TRACE_EVENT(rcu_kfree_callback,
415 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
416 long qlen_lazy, long qlen),
418 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
420 TP_STRUCT__entry(
421 __field(const char *, rcuname)
422 __field(void *, rhp)
423 __field(unsigned long, offset)
424 __field(long, qlen_lazy)
425 __field(long, qlen)
428 TP_fast_assign(
429 __entry->rcuname = rcuname;
430 __entry->rhp = rhp;
431 __entry->offset = offset;
432 __entry->qlen_lazy = qlen_lazy;
433 __entry->qlen = qlen;
436 TP_printk("%s rhp=%p func=%ld %ld/%ld",
437 __entry->rcuname, __entry->rhp, __entry->offset,
438 __entry->qlen_lazy, __entry->qlen)
442 * Tracepoint for marking the beginning rcu_do_batch, performed to start
443 * RCU callback invocation. The first argument is the RCU flavor,
444 * 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.
448 TRACE_EVENT(rcu_batch_start,
450 TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
452 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
454 TP_STRUCT__entry(
455 __field(const char *, rcuname)
456 __field(long, qlen_lazy)
457 __field(long, qlen)
458 __field(long, blimit)
461 TP_fast_assign(
462 __entry->rcuname = rcuname;
463 __entry->qlen_lazy = qlen_lazy;
464 __entry->qlen = qlen;
465 __entry->blimit = blimit;
468 TP_printk("%s CBs=%ld/%ld bl=%ld",
469 __entry->rcuname, __entry->qlen_lazy, __entry->qlen,
470 __entry->blimit)
474 * Tracepoint for the invocation of a single RCU callback function.
475 * The first argument is the type of RCU, and the second argument is
476 * a pointer to the RCU callback itself.
478 TRACE_EVENT(rcu_invoke_callback,
480 TP_PROTO(const char *rcuname, struct rcu_head *rhp),
482 TP_ARGS(rcuname, rhp),
484 TP_STRUCT__entry(
485 __field(const char *, rcuname)
486 __field(void *, rhp)
487 __field(void *, func)
490 TP_fast_assign(
491 __entry->rcuname = rcuname;
492 __entry->rhp = rhp;
493 __entry->func = rhp->func;
496 TP_printk("%s rhp=%p func=%pf",
497 __entry->rcuname, __entry->rhp, __entry->func)
501 * Tracepoint for the invocation of a single RCU callback of the special
502 * 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.
507 TRACE_EVENT(rcu_invoke_kfree_callback,
509 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
511 TP_ARGS(rcuname, rhp, offset),
513 TP_STRUCT__entry(
514 __field(const char *, rcuname)
515 __field(void *, rhp)
516 __field(unsigned long, offset)
519 TP_fast_assign(
520 __entry->rcuname = rcuname;
521 __entry->rhp = rhp;
522 __entry->offset = offset;
525 TP_printk("%s rhp=%p func=%ld",
526 __entry->rcuname, __entry->rhp, __entry->offset)
530 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
531 * 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().
540 TRACE_EVENT(rcu_batch_end,
542 TP_PROTO(const char *rcuname, int callbacks_invoked,
543 bool cb, bool nr, bool iit, bool risk),
545 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
547 TP_STRUCT__entry(
548 __field(const char *, rcuname)
549 __field(int, callbacks_invoked)
550 __field(bool, cb)
551 __field(bool, nr)
552 __field(bool, iit)
553 __field(bool, risk)
556 TP_fast_assign(
557 __entry->rcuname = rcuname;
558 __entry->callbacks_invoked = callbacks_invoked;
559 __entry->cb = cb;
560 __entry->nr = nr;
561 __entry->iit = iit;
562 __entry->risk = risk;
565 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' : '.')
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.
578 TRACE_EVENT(rcu_torture_read,
580 TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
581 unsigned long secs, unsigned long c_old, unsigned long c),
583 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
585 TP_STRUCT__entry(
586 __field(const char *, rcutorturename)
587 __field(struct rcu_head *, rhp)
588 __field(unsigned long, secs)
589 __field(unsigned long, c_old)
590 __field(unsigned long, c)
593 TP_fast_assign(
594 __entry->rcutorturename = rcutorturename;
595 __entry->rhp = rhp;
596 __entry->secs = secs;
597 __entry->c_old = c_old;
598 __entry->c = c;
601 TP_printk("%s torture read %p %luus c: %lu %lu",
602 __entry->rcutorturename, __entry->rhp,
603 __entry->secs, __entry->c_old, __entry->c)
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
614 * "OnlineNoCB": rcu_barrier_callback() found online no-CBs CPU.
615 * "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.
624 TRACE_EVENT(rcu_barrier,
626 TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
628 TP_ARGS(rcuname, s, cpu, cnt, done),
630 TP_STRUCT__entry(
631 __field(const char *, rcuname)
632 __field(const char *, s)
633 __field(int, cpu)
634 __field(int, cnt)
635 __field(unsigned long, done)
638 TP_fast_assign(
639 __entry->rcuname = rcuname;
640 __entry->s = s;
641 __entry->cpu = cpu;
642 __entry->cnt = cnt;
643 __entry->done = done;
646 TP_printk("%s %s cpu %d remaining %d # %lu",
647 __entry->rcuname, __entry->s, __entry->cpu, __entry->cnt,
648 __entry->done)
651 #else /* #ifdef CONFIG_RCU_TRACE */
653 #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
654 #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
655 qsmask) do { } while (0)
656 #define trace_rcu_future_grace_period(rcuname, gpnum, completed, c, \
657 level, grplo, grphi, event) \
658 do { } while (0)
659 #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
660 #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
661 #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
662 grplo, grphi, gp_tasks) do { } \
663 while (0)
664 #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
665 #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
666 #define trace_rcu_prep_idle(reason) do { } while (0)
667 #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)
672 #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
673 #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
674 #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
675 do { } while (0)
676 #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
677 do { } while (0)
678 #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
680 #endif /* #else #ifdef CONFIG_RCU_TRACE */
682 #endif /* _TRACE_RCU_H */
684 /* This part must be outside protection */
685 #include <trace/define_trace.h>