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