Fix: update btrfs instrumentation for kernel 4.14
[lttng-modules.git] / instrumentation / events / lttng-module / rcu.h
... / ...
CommitLineData
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM rcu
3
4#if !defined(LTTNG_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
5#define LTTNG_TRACE_RCU_H
6
7#include <probes/lttng-tracepoint-event.h>
8#include <linux/version.h>
9
10/*
11 * Tracepoint for start/end markers used for utilization calculations.
12 * By convention, the string is of the following forms:
13 *
14 * "Start <activity>" -- Mark the start of the specified activity,
15 * such as "context switch". Nesting is permitted.
16 * "End <activity>" -- Mark the end of the specified activity.
17 *
18 * An "@" character within "<activity>" is a comment character: Data
19 * reduction scripts will ignore the "@" and the remainder of the line.
20 */
21LTTNG_TRACEPOINT_EVENT(rcu_utilization,
22
23#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
24 TP_PROTO(const char *s),
25#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
26 TP_PROTO(char *s),
27#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
28
29 TP_ARGS(s),
30
31 TP_FIELDS(
32 ctf_string(s, s)
33 )
34)
35
36#ifdef CONFIG_RCU_TRACE
37
38#if defined(CONFIG_TREE_RCU) \
39 || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) \
40 && defined(CONFIG_PREEMPT_RCU)) \
41 || defined(CONFIG_TREE_PREEMPT_RCU)
42
43/*
44 * Tracepoint for grace-period events: starting and ending a grace
45 * period ("start" and "end", respectively), a CPU noting the start
46 * of a new grace period or the end of an old grace period ("cpustart"
47 * and "cpuend", respectively), a CPU passing through a quiescent
48 * state ("cpuqs"), a CPU coming online or going offline ("cpuonl"
49 * and "cpuofl", respectively), and a CPU being kicked for being too
50 * long in dyntick-idle mode ("kick").
51 */
52LTTNG_TRACEPOINT_EVENT(rcu_grace_period,
53
54#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
55 TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent),
56#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
57 TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent),
58#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
59
60 TP_ARGS(rcuname, gpnum, gpevent),
61
62 TP_FIELDS(
63 ctf_string(rcuname, rcuname)
64 ctf_integer(unsigned long, gpnum, gpnum)
65 ctf_string(gpevent, gpevent)
66 )
67)
68
69/*
70 * Tracepoint for grace-period-initialization events. These are
71 * distinguished by the type of RCU, the new grace-period number, the
72 * rcu_node structure level, the starting and ending CPU covered by the
73 * rcu_node structure, and the mask of CPUs that will be waited for.
74 * All but the type of RCU are extracted from the rcu_node structure.
75 */
76LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init,
77
78#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
79 TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level,
80 int grplo, int grphi, unsigned long qsmask),
81#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
82 TP_PROTO(char *rcuname, unsigned long gpnum, u8 level,
83 int grplo, int grphi, unsigned long qsmask),
84#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
85
86 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
87
88 TP_FIELDS(
89 ctf_string(rcuname, rcuname)
90 ctf_integer(unsigned long, gpnum, gpnum)
91 ctf_integer(u8, level, level)
92 ctf_integer(int, grplo, grplo)
93 ctf_integer(int, grphi, grphi)
94 ctf_integer(unsigned long, qsmask, qsmask)
95 )
96)
97
98/*
99 * Tracepoint for tasks blocking within preemptible-RCU read-side
100 * critical sections. Track the type of RCU (which one day might
101 * include SRCU), the grace-period number that the task is blocking
102 * (the current or the next), and the task's PID.
103 */
104LTTNG_TRACEPOINT_EVENT(rcu_preempt_task,
105
106#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
107 TP_PROTO(const char *rcuname, int pid, unsigned long gpnum),
108#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
109 TP_PROTO(char *rcuname, int pid, unsigned long gpnum),
110#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
111
112 TP_ARGS(rcuname, pid, gpnum),
113
114 TP_FIELDS(
115 ctf_string(rcuname, rcuname)
116 ctf_integer(unsigned long, gpnum, gpnum)
117 ctf_integer(int, pid, pid)
118 )
119)
120
121/*
122 * Tracepoint for tasks that blocked within a given preemptible-RCU
123 * read-side critical section exiting that critical section. Track the
124 * type of RCU (which one day might include SRCU) and the task's PID.
125 */
126LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task,
127
128#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
129 TP_PROTO(const char *rcuname, unsigned long gpnum, int pid),
130#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
131 TP_PROTO(char *rcuname, unsigned long gpnum, int pid),
132#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
133
134 TP_ARGS(rcuname, gpnum, pid),
135
136 TP_FIELDS(
137 ctf_string(rcuname, rcuname)
138 ctf_integer(unsigned long, gpnum, gpnum)
139 ctf_integer(int, pid, pid)
140 )
141)
142
143/*
144 * Tracepoint for quiescent-state-reporting events. These are
145 * distinguished by the type of RCU, the grace-period number, the
146 * mask of quiescent lower-level entities, the rcu_node structure level,
147 * the starting and ending CPU covered by the rcu_node structure, and
148 * whether there are any blocked tasks blocking the current grace period.
149 * All but the type of RCU are extracted from the rcu_node structure.
150 */
151LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report,
152
153#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
154 TP_PROTO(const char *rcuname, unsigned long gpnum,
155 unsigned long mask, unsigned long qsmask,
156 u8 level, int grplo, int grphi, int gp_tasks),
157#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
158 TP_PROTO(char *rcuname, unsigned long gpnum,
159 unsigned long mask, unsigned long qsmask,
160 u8 level, int grplo, int grphi, int gp_tasks),
161#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
162
163 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
164
165 TP_FIELDS(
166 ctf_string(rcuname, rcuname)
167 ctf_integer(unsigned long, gpnum, gpnum)
168 ctf_integer(unsigned long, mask, mask)
169 ctf_integer(unsigned long, qsmask, qsmask)
170 ctf_integer(u8, level, level)
171 ctf_integer(int, grplo, grplo)
172 ctf_integer(int, grphi, grphi)
173 ctf_integer(u8, gp_tasks, gp_tasks)
174 )
175)
176
177/*
178 * Tracepoint for quiescent states detected by force_quiescent_state().
179 * These trace events include the type of RCU, the grace-period number
180 * that was blocked by the CPU, the CPU itself, and the type of quiescent
181 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
182 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
183 * too long.
184 */
185LTTNG_TRACEPOINT_EVENT(rcu_fqs,
186
187#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
188 TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent),
189#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
190 TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent),
191#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
192
193 TP_ARGS(rcuname, gpnum, cpu, qsevent),
194
195 TP_FIELDS(
196 ctf_integer(unsigned long, gpnum, gpnum)
197 ctf_integer(int, cpu, cpu)
198 ctf_string(rcuname, rcuname)
199 ctf_string(qsevent, qsevent)
200 )
201)
202
203#endif /*
204 * #if defined(CONFIG_TREE_RCU)
205 * || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
206 * && defined(CONFIG_PREEMPT_RCU))
207 * || defined(CONFIG_TREE_PREEMPT_RCU)
208 */
209
210/*
211 * Tracepoint for dyntick-idle entry/exit events. These take a string
212 * as argument: "Start" for entering dyntick-idle mode, "End" for
213 * leaving it, "--=" for events moving towards idle, and "++=" for events
214 * moving away from idle. "Error on entry: not idle task" and "Error on
215 * exit: not idle task" indicate that a non-idle task is erroneously
216 * toying with the idle loop.
217 *
218 * These events also take a pair of numbers, which indicate the nesting
219 * depth before and after the event of interest. Note that task-related
220 * events use the upper bits of each number, while interrupt-related
221 * events use the lower bits.
222 */
223LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
224
225
226#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
227 TP_PROTO(const char *polarity, long long oldnesting, long long newnesting),
228
229 TP_ARGS(polarity, oldnesting, newnesting),
230#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
231 TP_PROTO(char *polarity, long long oldnesting, long long newnesting),
232
233 TP_ARGS(polarity, oldnesting, newnesting),
234#else
235 TP_PROTO(char *polarity),
236
237 TP_ARGS(polarity),
238#endif
239
240 TP_FIELDS(
241 ctf_string(polarity, polarity)
242#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
243 ctf_integer(long long, oldnesting, oldnesting)
244 ctf_integer(long long, newnesting, newnesting)
245#endif
246 )
247)
248
249#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
250/*
251 * Tracepoint for RCU preparation for idle, the goal being to get RCU
252 * processing done so that the current CPU can shut off its scheduling
253 * clock and enter dyntick-idle mode. One way to accomplish this is
254 * to drain all RCU callbacks from this CPU, and the other is to have
255 * done everything RCU requires for the current grace period. In this
256 * latter case, the CPU will be awakened at the end of the current grace
257 * period in order to process the remainder of its callbacks.
258 *
259 * These tracepoints take a string as argument:
260 *
261 * "No callbacks": Nothing to do, no callbacks on this CPU.
262 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
263 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
264 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
265 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
266 * "More callbacks": Still more callbacks, try again to clear them out.
267 * "Callbacks drained": All callbacks processed, off to dyntick idle!
268 * "Timer": Timer fired to cause CPU to continue processing callbacks.
269 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
270 * "Cleanup after idle": Idle exited, timer canceled.
271 */
272LTTNG_TRACEPOINT_EVENT(rcu_prep_idle,
273
274#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
275 TP_PROTO(const char *reason),
276#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
277 TP_PROTO(char *reason),
278#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
279
280 TP_ARGS(reason),
281
282 TP_FIELDS(
283 ctf_string(reason, reason)
284 )
285)
286#endif
287
288/*
289 * Tracepoint for the registration of a single RCU callback function.
290 * The first argument is the type of RCU, the second argument is
291 * a pointer to the RCU callback itself, the third element is the
292 * number of lazy callbacks queued, and the fourth element is the
293 * total number of callbacks queued.
294 */
295LTTNG_TRACEPOINT_EVENT(rcu_callback,
296
297#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
298 TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
299 long qlen),
300
301 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
302#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
303 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy,
304 long qlen),
305
306 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
307#else
308 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen),
309
310 TP_ARGS(rcuname, rhp, qlen),
311#endif
312
313 TP_FIELDS(
314 ctf_string(rcuname, rcuname)
315 ctf_integer_hex(void *, rhp, rhp)
316 ctf_integer_hex(void *, func, rhp->func)
317#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
318 ctf_integer(long, qlen_lazy, qlen_lazy)
319#endif
320 ctf_integer(long, qlen, qlen)
321 )
322)
323
324/*
325 * Tracepoint for the registration of a single RCU callback of the special
326 * kfree() form. The first argument is the RCU type, the second argument
327 * is a pointer to the RCU callback, the third argument is the offset
328 * of the callback within the enclosing RCU-protected data structure,
329 * the fourth argument is the number of lazy callbacks queued, and the
330 * fifth argument is the total number of callbacks queued.
331 */
332LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback,
333
334
335#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
336 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
337 long qlen_lazy, long qlen),
338
339 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
340#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
341 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
342 long qlen_lazy, long qlen),
343
344 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
345#else
346 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
347 long qlen),
348
349 TP_ARGS(rcuname, rhp, offset, qlen),
350#endif
351
352 TP_FIELDS(
353 ctf_string(rcuname, rcuname)
354 ctf_integer_hex(void *, rhp, rhp)
355 ctf_integer_hex(unsigned long, offset, offset)
356#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
357 ctf_integer(long, qlen_lazy, qlen_lazy)
358#endif
359 ctf_integer(long, qlen, qlen)
360 )
361)
362
363/*
364 * Tracepoint for marking the beginning rcu_do_batch, performed to start
365 * RCU callback invocation. The first argument is the RCU flavor,
366 * the second is the number of lazy callbacks queued, the third is
367 * the total number of callbacks queued, and the fourth argument is
368 * the current RCU-callback batch limit.
369 */
370LTTNG_TRACEPOINT_EVENT(rcu_batch_start,
371
372#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
373 TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
374
375 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
376#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
377 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit),
378
379 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
380#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
381 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit),
382
383 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
384#else
385 TP_PROTO(char *rcuname, long qlen, int blimit),
386
387 TP_ARGS(rcuname, qlen, blimit),
388#endif
389
390 TP_FIELDS(
391 ctf_string(rcuname, rcuname)
392#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
393 ctf_integer(long, qlen_lazy, qlen_lazy)
394#endif
395 ctf_integer(long, qlen, qlen)
396#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
397 ctf_integer(long, blimit, blimit)
398#else
399 ctf_integer(int, blimit, blimit)
400#endif
401 )
402)
403
404/*
405 * Tracepoint for the invocation of a single RCU callback function.
406 * The first argument is the type of RCU, and the second argument is
407 * a pointer to the RCU callback itself.
408 */
409LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback,
410
411#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
412 TP_PROTO(const char *rcuname, struct rcu_head *rhp),
413#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
414 TP_PROTO(char *rcuname, struct rcu_head *rhp),
415#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
416
417 TP_ARGS(rcuname, rhp),
418
419 TP_FIELDS(
420 ctf_string(rcuname, rcuname)
421 ctf_integer_hex(void *, rhp, rhp)
422 ctf_integer_hex(void *, func, rhp->func)
423 )
424)
425
426/*
427 * Tracepoint for the invocation of a single RCU callback of the special
428 * kfree() form. The first argument is the RCU flavor, the second
429 * argument is a pointer to the RCU callback, and the third argument
430 * is the offset of the callback within the enclosing RCU-protected
431 * data structure.
432 */
433LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback,
434
435#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
436 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
437#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
438 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset),
439#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
440
441 TP_ARGS(rcuname, rhp, offset),
442
443 TP_FIELDS(
444 ctf_string(rcuname, rcuname)
445 ctf_integer_hex(void *, rhp, rhp)
446 ctf_integer(unsigned long, offset, offset)
447 )
448)
449
450/*
451 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
452 * invoked. The first argument is the name of the RCU flavor,
453 * the second argument is number of callbacks actually invoked,
454 * the third argument (cb) is whether or not any of the callbacks that
455 * were ready to invoke at the beginning of this batch are still
456 * queued, the fourth argument (nr) is the return value of need_resched(),
457 * the fifth argument (iit) is 1 if the current task is the idle task,
458 * and the sixth argument (risk) is the return value from
459 * rcu_is_callbacks_kthread().
460 */
461LTTNG_TRACEPOINT_EVENT(rcu_batch_end,
462
463#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
464 TP_PROTO(const char *rcuname, int callbacks_invoked,
465 char cb, char nr, char iit, char risk),
466
467 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
468#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
469 TP_PROTO(const char *rcuname, int callbacks_invoked,
470 bool cb, bool nr, bool iit, bool risk),
471
472 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
473#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
474 TP_PROTO(char *rcuname, int callbacks_invoked,
475 bool cb, bool nr, bool iit, bool risk),
476
477 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
478#else
479 TP_PROTO(char *rcuname, int callbacks_invoked),
480
481 TP_ARGS(rcuname, callbacks_invoked),
482#endif
483
484 TP_FIELDS(
485 ctf_string(rcuname, rcuname)
486 ctf_integer(int, callbacks_invoked, callbacks_invoked)
487#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
488 ctf_integer(char, cb, cb)
489 ctf_integer(char, nr, nr)
490 ctf_integer(char, iit, iit)
491 ctf_integer(char, risk, risk)
492#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
493 ctf_integer(bool, cb, cb)
494 ctf_integer(bool, nr, nr)
495 ctf_integer(bool, iit, iit)
496 ctf_integer(bool, risk, risk)
497#endif
498 )
499)
500
501#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
502/*
503 * Tracepoint for rcutorture readers. The first argument is the name
504 * of the RCU flavor from rcutorture's viewpoint and the second argument
505 * is the callback address.
506 */
507LTTNG_TRACEPOINT_EVENT(rcu_torture_read,
508
509#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
510 TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
511 unsigned long secs, unsigned long c_old, unsigned long c),
512
513 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
514#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
515 TP_PROTO(char *rcutorturename, struct rcu_head *rhp,
516 unsigned long secs, unsigned long c_old, unsigned long c),
517
518 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
519#else
520 TP_PROTO(char *rcutorturename, struct rcu_head *rhp),
521
522 TP_ARGS(rcutorturename, rhp),
523#endif
524
525 TP_FIELDS(
526 ctf_string(rcutorturename, rcutorturename)
527 ctf_integer_hex(struct rcu_head *, rhp, rhp)
528#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
529 ctf_integer(unsigned long, secs, secs)
530 ctf_integer(unsigned long, c_old, c_old)
531 ctf_integer(unsigned long, c, c)
532#endif
533 )
534)
535#endif
536
537#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
538/*
539 * Tracepoint for _rcu_barrier() execution. The string "s" describes
540 * the _rcu_barrier phase:
541 * "Begin": rcu_barrier_callback() started.
542 * "Check": rcu_barrier_callback() checking for piggybacking.
543 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
544 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
545 * "Offline": rcu_barrier_callback() found offline CPU
546 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
547 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
548 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
549 * "CB": An rcu_barrier_callback() invoked a callback, not the last.
550 * "LastCB": An rcu_barrier_callback() invoked the last callback.
551 * "Inc2": rcu_barrier_callback() piggyback check counter incremented.
552 * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument
553 * is the count of remaining callbacks, and "done" is the piggybacking count.
554 */
555LTTNG_TRACEPOINT_EVENT(rcu_barrier,
556
557#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
558 TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
559#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
560 TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done),
561#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
562
563 TP_ARGS(rcuname, s, cpu, cnt, done),
564
565 TP_FIELDS(
566 ctf_string(rcuname, rcuname)
567 ctf_string(s, s)
568 ctf_integer(int, cpu, cpu)
569 ctf_integer(int, cnt, cnt)
570 ctf_integer(unsigned long, done, done)
571 )
572)
573#endif
574
575#else /* #ifdef CONFIG_RCU_TRACE */
576
577#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
578#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
579 qsmask) do { } while (0)
580#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
581#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
582#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
583 grplo, grphi, gp_tasks) do { } \
584 while (0)
585#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
586#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
587#define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0)
588#else
589#define trace_rcu_dyntick(polarity) do { } while (0)
590#endif
591#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
592#define trace_rcu_prep_idle(reason) do { } while (0)
593#endif
594#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
595#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
596#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
597 do { } while (0)
598#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \
599 do { } while (0)
600#else
601#define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0)
602#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0)
603#define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0)
604#endif
605#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
606#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
607#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
608#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \
609 do { } while (0)
610#else
611#define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0)
612#endif
613#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
614#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
615 do { } while (0)
616#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
617#define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0)
618#endif
619#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
620#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0)
621#endif
622#endif /* #else #ifdef CONFIG_RCU_TRACE */
623
624#endif /* LTTNG_TRACE_RCU_H */
625
626/* This part must be outside protection */
627#include <probes/define_trace.h>
This page took 0.024159 seconds and 4 git commands to generate.