Commit | Line | Data |
---|---|---|
b87700e3 AG |
1 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM rcu | |
3 | ||
3bc29f0a MD |
4 | #if !defined(LTTNG_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ) |
5 | #define LTTNG_TRACE_RCU_H | |
b87700e3 | 6 | |
3bc29f0a | 7 | #include "../../../probes/lttng-tracepoint-event.h" |
b87700e3 AG |
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 | */ | |
3bc29f0a | 21 | LTTNG_TRACEPOINT_EVENT(rcu_utilization, |
b87700e3 | 22 | |
8e621312 MD |
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)) */ | |
b87700e3 | 26 | TP_PROTO(char *s), |
8e621312 | 27 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
28 | |
29 | TP_ARGS(s), | |
30 | ||
31 | TP_STRUCT__entry( | |
32 | __string(s, s) | |
33 | ), | |
34 | ||
35 | TP_fast_assign( | |
36 | tp_strcpy(s, s) | |
37 | ), | |
38 | ||
39 | TP_printk("%s", __get_str(s)) | |
40 | ) | |
41 | ||
42 | #ifdef CONFIG_RCU_TRACE | |
43 | ||
44 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | |
45 | ||
46 | /* | |
47 | * Tracepoint for grace-period events: starting and ending a grace | |
48 | * period ("start" and "end", respectively), a CPU noting the start | |
49 | * of a new grace period or the end of an old grace period ("cpustart" | |
50 | * and "cpuend", respectively), a CPU passing through a quiescent | |
51 | * state ("cpuqs"), a CPU coming online or going offline ("cpuonl" | |
52 | * and "cpuofl", respectively), and a CPU being kicked for being too | |
53 | * long in dyntick-idle mode ("kick"). | |
54 | */ | |
3bc29f0a | 55 | LTTNG_TRACEPOINT_EVENT(rcu_grace_period, |
b87700e3 | 56 | |
01adf18e MD |
57 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
58 | TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent), | |
59 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 60 | TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent), |
01adf18e | 61 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
62 | |
63 | TP_ARGS(rcuname, gpnum, gpevent), | |
64 | ||
65 | TP_STRUCT__entry( | |
66 | __string(rcuname, rcuname) | |
67 | __field(unsigned long, gpnum) | |
68 | __string(gpevent, gpevent) | |
69 | ), | |
70 | ||
71 | TP_fast_assign( | |
72 | tp_strcpy(rcuname, rcuname) | |
73 | tp_assign(gpnum, gpnum) | |
74 | tp_strcpy(gpevent, gpevent) | |
75 | ), | |
76 | ||
77 | TP_printk("%s %lu %s", | |
78 | __get_str(rcuname), __entry->gpnum, __get_str(gpevent)) | |
79 | ) | |
80 | ||
81 | /* | |
82 | * Tracepoint for grace-period-initialization events. These are | |
83 | * distinguished by the type of RCU, the new grace-period number, the | |
84 | * rcu_node structure level, the starting and ending CPU covered by the | |
85 | * rcu_node structure, and the mask of CPUs that will be waited for. | |
86 | * All but the type of RCU are extracted from the rcu_node structure. | |
87 | */ | |
3bc29f0a | 88 | LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init, |
b87700e3 | 89 | |
01adf18e MD |
90 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
91 | TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level, | |
92 | int grplo, int grphi, unsigned long qsmask), | |
93 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 AG |
94 | TP_PROTO(char *rcuname, unsigned long gpnum, u8 level, |
95 | int grplo, int grphi, unsigned long qsmask), | |
01adf18e | 96 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
97 | |
98 | TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), | |
99 | ||
100 | TP_STRUCT__entry( | |
101 | __string(rcuname, rcuname) | |
102 | __field(unsigned long, gpnum) | |
103 | __field(u8, level) | |
104 | __field(int, grplo) | |
105 | __field(int, grphi) | |
106 | __field(unsigned long, qsmask) | |
107 | ), | |
108 | ||
109 | TP_fast_assign( | |
110 | tp_strcpy(rcuname, rcuname) | |
111 | tp_assign(gpnum, gpnum) | |
112 | tp_assign(level, level) | |
113 | tp_assign(grplo, grplo) | |
114 | tp_assign(grphi, grphi) | |
115 | tp_assign(qsmask, qsmask) | |
116 | ), | |
117 | ||
118 | TP_printk("%s %lu %u %d %d %lx", | |
119 | __get_str(rcuname), __entry->gpnum, __entry->level, | |
120 | __entry->grplo, __entry->grphi, __entry->qsmask) | |
121 | ) | |
122 | ||
123 | /* | |
124 | * Tracepoint for tasks blocking within preemptible-RCU read-side | |
125 | * critical sections. Track the type of RCU (which one day might | |
126 | * include SRCU), the grace-period number that the task is blocking | |
127 | * (the current or the next), and the task's PID. | |
128 | */ | |
3bc29f0a | 129 | LTTNG_TRACEPOINT_EVENT(rcu_preempt_task, |
b87700e3 | 130 | |
01adf18e MD |
131 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
132 | TP_PROTO(const char *rcuname, int pid, unsigned long gpnum), | |
133 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 134 | TP_PROTO(char *rcuname, int pid, unsigned long gpnum), |
01adf18e | 135 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
136 | |
137 | TP_ARGS(rcuname, pid, gpnum), | |
138 | ||
139 | TP_STRUCT__entry( | |
140 | __string(rcuname, rcuname) | |
141 | __field(unsigned long, gpnum) | |
142 | __field(int, pid) | |
143 | ), | |
144 | ||
145 | TP_fast_assign( | |
146 | tp_strcpy(rcuname, rcuname) | |
147 | tp_assign(gpnum, gpnum) | |
148 | tp_assign(pid, pid) | |
149 | ), | |
150 | ||
151 | TP_printk("%s %lu %d", | |
152 | __get_str(rcuname), __entry->gpnum, __entry->pid) | |
153 | ) | |
154 | ||
155 | /* | |
156 | * Tracepoint for tasks that blocked within a given preemptible-RCU | |
157 | * read-side critical section exiting that critical section. Track the | |
158 | * type of RCU (which one day might include SRCU) and the task's PID. | |
159 | */ | |
3bc29f0a | 160 | LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task, |
b87700e3 | 161 | |
01adf18e MD |
162 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
163 | TP_PROTO(const char *rcuname, unsigned long gpnum, int pid), | |
164 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 165 | TP_PROTO(char *rcuname, unsigned long gpnum, int pid), |
01adf18e | 166 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
167 | |
168 | TP_ARGS(rcuname, gpnum, pid), | |
169 | ||
170 | TP_STRUCT__entry( | |
171 | __string(rcuname, rcuname) | |
172 | __field(unsigned long, gpnum) | |
173 | __field(int, pid) | |
174 | ), | |
175 | ||
176 | TP_fast_assign( | |
177 | tp_strcpy(rcuname, rcuname) | |
178 | tp_assign(gpnum, gpnum) | |
179 | tp_assign(pid, pid) | |
180 | ), | |
181 | ||
182 | TP_printk("%s %lu %d", __get_str(rcuname), __entry->gpnum, __entry->pid) | |
183 | ) | |
184 | ||
185 | /* | |
186 | * Tracepoint for quiescent-state-reporting events. These are | |
187 | * distinguished by the type of RCU, the grace-period number, the | |
188 | * mask of quiescent lower-level entities, the rcu_node structure level, | |
189 | * the starting and ending CPU covered by the rcu_node structure, and | |
190 | * whether there are any blocked tasks blocking the current grace period. | |
191 | * All but the type of RCU are extracted from the rcu_node structure. | |
192 | */ | |
3bc29f0a | 193 | LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report, |
b87700e3 | 194 | |
01adf18e MD |
195 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
196 | TP_PROTO(const char *rcuname, unsigned long gpnum, | |
197 | unsigned long mask, unsigned long qsmask, | |
198 | u8 level, int grplo, int grphi, int gp_tasks), | |
199 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 AG |
200 | TP_PROTO(char *rcuname, unsigned long gpnum, |
201 | unsigned long mask, unsigned long qsmask, | |
202 | u8 level, int grplo, int grphi, int gp_tasks), | |
01adf18e | 203 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
204 | |
205 | TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), | |
206 | ||
207 | TP_STRUCT__entry( | |
208 | __string(rcuname, rcuname) | |
209 | __field(unsigned long, gpnum) | |
210 | __field(unsigned long, mask) | |
211 | __field(unsigned long, qsmask) | |
212 | __field(u8, level) | |
213 | __field(int, grplo) | |
214 | __field(int, grphi) | |
215 | __field(u8, gp_tasks) | |
216 | ), | |
217 | ||
218 | TP_fast_assign( | |
219 | tp_strcpy(rcuname, rcuname) | |
220 | tp_assign(gpnum, gpnum) | |
221 | tp_assign(mask, mask) | |
222 | tp_assign(qsmask, qsmask) | |
223 | tp_assign(level, level) | |
224 | tp_assign(grplo, grplo) | |
225 | tp_assign(grphi, grphi) | |
226 | tp_assign(gp_tasks, gp_tasks) | |
227 | ), | |
228 | ||
229 | TP_printk("%s %lu %lx>%lx %u %d %d %u", | |
230 | __get_str(rcuname), __entry->gpnum, | |
231 | __entry->mask, __entry->qsmask, __entry->level, | |
232 | __entry->grplo, __entry->grphi, __entry->gp_tasks) | |
233 | ) | |
234 | ||
235 | /* | |
236 | * Tracepoint for quiescent states detected by force_quiescent_state(). | |
237 | * These trace events include the type of RCU, the grace-period number | |
238 | * that was blocked by the CPU, the CPU itself, and the type of quiescent | |
239 | * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline, | |
240 | * or "kick" when kicking a CPU that has been in dyntick-idle mode for | |
241 | * too long. | |
242 | */ | |
3bc29f0a | 243 | LTTNG_TRACEPOINT_EVENT(rcu_fqs, |
b87700e3 | 244 | |
01adf18e MD |
245 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
246 | TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent), | |
247 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 248 | TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent), |
01adf18e | 249 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
250 | |
251 | TP_ARGS(rcuname, gpnum, cpu, qsevent), | |
252 | ||
253 | TP_STRUCT__entry( | |
254 | __string(rcuname, rcuname) | |
255 | __field(unsigned long, gpnum) | |
256 | __field(int, cpu) | |
257 | __string(qsevent, qsevent) | |
258 | ), | |
259 | ||
260 | TP_fast_assign( | |
261 | tp_strcpy(rcuname, rcuname) | |
262 | tp_assign(gpnum, gpnum) | |
263 | tp_assign(cpu, cpu) | |
264 | tp_strcpy(qsevent, qsevent) | |
265 | ), | |
266 | ||
267 | TP_printk("%s %lu %d %s", | |
268 | __get_str(rcuname), __entry->gpnum, | |
269 | __entry->cpu, __get_str(qsevent)) | |
270 | ) | |
271 | ||
272 | #endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) */ | |
273 | ||
274 | /* | |
275 | * Tracepoint for dyntick-idle entry/exit events. These take a string | |
276 | * as argument: "Start" for entering dyntick-idle mode, "End" for | |
277 | * leaving it, "--=" for events moving towards idle, and "++=" for events | |
278 | * moving away from idle. "Error on entry: not idle task" and "Error on | |
279 | * exit: not idle task" indicate that a non-idle task is erroneously | |
280 | * toying with the idle loop. | |
281 | * | |
282 | * These events also take a pair of numbers, which indicate the nesting | |
283 | * depth before and after the event of interest. Note that task-related | |
284 | * events use the upper bits of each number, while interrupt-related | |
285 | * events use the lower bits. | |
286 | */ | |
3bc29f0a | 287 | LTTNG_TRACEPOINT_EVENT(rcu_dyntick, |
b87700e3 | 288 | |
01adf18e MD |
289 | |
290 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
291 | TP_PROTO(const char *polarity, long long oldnesting, long long newnesting), | |
292 | ||
293 | TP_ARGS(polarity, oldnesting, newnesting), | |
294 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
b87700e3 AG |
295 | TP_PROTO(char *polarity, long long oldnesting, long long newnesting), |
296 | ||
297 | TP_ARGS(polarity, oldnesting, newnesting), | |
298 | #else | |
299 | TP_PROTO(char *polarity), | |
300 | ||
301 | TP_ARGS(polarity), | |
302 | #endif | |
303 | ||
304 | TP_STRUCT__entry( | |
305 | __string(polarity, polarity) | |
306 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
307 | __field(long long, oldnesting) | |
308 | __field(long long, newnesting) | |
309 | #endif | |
310 | ), | |
311 | ||
312 | TP_fast_assign( | |
313 | tp_strcpy(polarity, polarity) | |
314 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
315 | tp_assign(oldnesting, oldnesting) | |
316 | tp_assign(newnesting, newnesting) | |
317 | #endif | |
318 | ), | |
319 | ||
320 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
321 | TP_printk("%s %llx %llx", __get_str(polarity), | |
322 | __entry->oldnesting, __entry->newnesting) | |
323 | #else | |
324 | TP_printk("%s", __get_str(polarity)) | |
325 | #endif | |
326 | ) | |
327 | ||
328 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
329 | /* | |
330 | * Tracepoint for RCU preparation for idle, the goal being to get RCU | |
331 | * processing done so that the current CPU can shut off its scheduling | |
332 | * clock and enter dyntick-idle mode. One way to accomplish this is | |
333 | * to drain all RCU callbacks from this CPU, and the other is to have | |
334 | * done everything RCU requires for the current grace period. In this | |
335 | * latter case, the CPU will be awakened at the end of the current grace | |
336 | * period in order to process the remainder of its callbacks. | |
337 | * | |
338 | * These tracepoints take a string as argument: | |
339 | * | |
340 | * "No callbacks": Nothing to do, no callbacks on this CPU. | |
341 | * "In holdoff": Nothing to do, holding off after unsuccessful attempt. | |
342 | * "Begin holdoff": Attempt failed, don't retry until next jiffy. | |
343 | * "Dyntick with callbacks": Entering dyntick-idle despite callbacks. | |
344 | * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks. | |
345 | * "More callbacks": Still more callbacks, try again to clear them out. | |
346 | * "Callbacks drained": All callbacks processed, off to dyntick idle! | |
347 | * "Timer": Timer fired to cause CPU to continue processing callbacks. | |
348 | * "Demigrate": Timer fired on wrong CPU, woke up correct CPU. | |
349 | * "Cleanup after idle": Idle exited, timer canceled. | |
350 | */ | |
3bc29f0a | 351 | LTTNG_TRACEPOINT_EVENT(rcu_prep_idle, |
b87700e3 | 352 | |
01adf18e MD |
353 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
354 | TP_PROTO(const char *reason), | |
355 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 356 | TP_PROTO(char *reason), |
01adf18e | 357 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
358 | |
359 | TP_ARGS(reason), | |
360 | ||
361 | TP_STRUCT__entry( | |
362 | __string(reason, reason) | |
363 | ), | |
364 | ||
365 | TP_fast_assign( | |
366 | tp_strcpy(reason, reason) | |
367 | ), | |
368 | ||
369 | TP_printk("%s", __get_str(reason)) | |
370 | ) | |
371 | #endif | |
372 | ||
373 | /* | |
374 | * Tracepoint for the registration of a single RCU callback function. | |
375 | * The first argument is the type of RCU, the second argument is | |
376 | * a pointer to the RCU callback itself, the third element is the | |
377 | * number of lazy callbacks queued, and the fourth element is the | |
378 | * total number of callbacks queued. | |
379 | */ | |
3bc29f0a | 380 | LTTNG_TRACEPOINT_EVENT(rcu_callback, |
b87700e3 | 381 | |
01adf18e MD |
382 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
383 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy, | |
384 | long qlen), | |
385 | ||
386 | TP_ARGS(rcuname, rhp, qlen_lazy, qlen), | |
387 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
b87700e3 AG |
388 | TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy, |
389 | long qlen), | |
390 | ||
391 | TP_ARGS(rcuname, rhp, qlen_lazy, qlen), | |
392 | #else | |
393 | TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen), | |
394 | ||
395 | TP_ARGS(rcuname, rhp, qlen), | |
396 | #endif | |
397 | ||
398 | TP_STRUCT__entry( | |
399 | __string(rcuname, rcuname) | |
400 | __field(void *, rhp) | |
401 | __field(void *, func) | |
402 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
403 | __field(long, qlen_lazy) | |
404 | #endif | |
405 | __field(long, qlen) | |
406 | ), | |
407 | ||
408 | TP_fast_assign( | |
409 | tp_strcpy(rcuname, rcuname) | |
410 | tp_assign(rhp, rhp) | |
411 | tp_assign(func, rhp->func) | |
412 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
413 | tp_assign(qlen_lazy, qlen_lazy) | |
414 | #endif | |
415 | tp_assign(qlen, qlen) | |
416 | ), | |
417 | ||
418 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
419 | TP_printk("%s rhp=%p func=%pf %ld/%ld", | |
420 | __get_str(rcuname), __entry->rhp, __entry->func, | |
421 | __entry->qlen_lazy, __entry->qlen) | |
422 | #else | |
423 | TP_printk("%s rhp=%p func=%pf %ld", | |
424 | __get_str(rcuname), __entry->rhp, __entry->func, | |
425 | __entry->qlen) | |
426 | #endif | |
427 | ) | |
428 | ||
429 | /* | |
430 | * Tracepoint for the registration of a single RCU callback of the special | |
431 | * kfree() form. The first argument is the RCU type, the second argument | |
432 | * is a pointer to the RCU callback, the third argument is the offset | |
433 | * of the callback within the enclosing RCU-protected data structure, | |
434 | * the fourth argument is the number of lazy callbacks queued, and the | |
435 | * fifth argument is the total number of callbacks queued. | |
436 | */ | |
3bc29f0a | 437 | LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, |
b87700e3 | 438 | |
01adf18e MD |
439 | |
440 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
441 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset, | |
442 | long qlen_lazy, long qlen), | |
443 | ||
444 | TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), | |
445 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
b87700e3 AG |
446 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, |
447 | long qlen_lazy, long qlen), | |
448 | ||
449 | TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), | |
450 | #else | |
451 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, | |
452 | long qlen), | |
453 | ||
454 | TP_ARGS(rcuname, rhp, offset, qlen), | |
455 | #endif | |
456 | ||
457 | TP_STRUCT__entry( | |
458 | __string(rcuname, rcuname) | |
459 | __field(void *, rhp) | |
460 | __field(unsigned long, offset) | |
461 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
462 | __field(long, qlen_lazy) | |
463 | #endif | |
464 | __field(long, qlen) | |
465 | ), | |
466 | ||
467 | TP_fast_assign( | |
468 | tp_strcpy(rcuname, rcuname) | |
469 | tp_assign(rhp, rhp) | |
470 | tp_assign(offset, offset) | |
471 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
472 | tp_assign(qlen_lazy, qlen_lazy) | |
473 | #endif | |
474 | tp_assign(qlen, qlen) | |
475 | ), | |
476 | ||
477 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
478 | TP_printk("%s rhp=%p func=%ld %ld/%ld", | |
479 | __get_str(rcuname), __entry->rhp, __entry->offset, | |
480 | __entry->qlen_lazy, __entry->qlen) | |
481 | #else | |
482 | TP_printk("%s rhp=%p func=%ld %ld", | |
483 | __get_str(rcuname), __entry->rhp, __entry->offset, | |
484 | __entry->qlen) | |
485 | #endif | |
486 | ) | |
487 | ||
488 | /* | |
489 | * Tracepoint for marking the beginning rcu_do_batch, performed to start | |
490 | * RCU callback invocation. The first argument is the RCU flavor, | |
491 | * the second is the number of lazy callbacks queued, the third is | |
492 | * the total number of callbacks queued, and the fourth argument is | |
493 | * the current RCU-callback batch limit. | |
494 | */ | |
3bc29f0a | 495 | LTTNG_TRACEPOINT_EVENT(rcu_batch_start, |
b87700e3 | 496 | |
01adf18e MD |
497 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
498 | TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit), | |
499 | ||
500 | TP_ARGS(rcuname, qlen_lazy, qlen, blimit), | |
501 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
4b4111c9 MD |
502 | TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit), |
503 | ||
504 | TP_ARGS(rcuname, qlen_lazy, qlen, blimit), | |
505 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
b87700e3 AG |
506 | TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit), |
507 | ||
508 | TP_ARGS(rcuname, qlen_lazy, qlen, blimit), | |
509 | #else | |
510 | TP_PROTO(char *rcuname, long qlen, int blimit), | |
511 | ||
512 | TP_ARGS(rcuname, qlen, blimit), | |
513 | #endif | |
514 | ||
515 | TP_STRUCT__entry( | |
516 | __string(rcuname, rcuname) | |
517 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
518 | __field(long, qlen_lazy) | |
519 | #endif | |
520 | __field(long, qlen) | |
4b4111c9 MD |
521 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
522 | __field(long, blimit) | |
523 | #else | |
b87700e3 | 524 | __field(int, blimit) |
4b4111c9 | 525 | #endif |
b87700e3 AG |
526 | ), |
527 | ||
528 | TP_fast_assign( | |
529 | tp_strcpy(rcuname, rcuname) | |
530 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
531 | tp_assign(qlen_lazy, qlen_lazy) | |
532 | #endif | |
533 | tp_assign(qlen, qlen) | |
534 | tp_assign(blimit, blimit) | |
535 | ), | |
536 | ||
4b4111c9 MD |
537 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
538 | TP_printk("%s CBs=%ld/%ld bl=%ld", | |
539 | __get_str(rcuname), __entry->qlen_lazy, __entry->qlen, | |
540 | __entry->blimit) | |
541 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
b87700e3 AG |
542 | TP_printk("%s CBs=%ld/%ld bl=%d", |
543 | __get_str(rcuname), __entry->qlen_lazy, __entry->qlen, | |
544 | __entry->blimit) | |
545 | #else | |
546 | TP_printk("%s CBs=%ld bl=%d", | |
547 | __get_str(rcuname), __entry->qlen, __entry->blimit) | |
548 | #endif | |
549 | ) | |
550 | ||
551 | /* | |
552 | * Tracepoint for the invocation of a single RCU callback function. | |
553 | * The first argument is the type of RCU, and the second argument is | |
554 | * a pointer to the RCU callback itself. | |
555 | */ | |
3bc29f0a | 556 | LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback, |
b87700e3 | 557 | |
01adf18e MD |
558 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
559 | TP_PROTO(const char *rcuname, struct rcu_head *rhp), | |
560 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 561 | TP_PROTO(char *rcuname, struct rcu_head *rhp), |
01adf18e | 562 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
563 | |
564 | TP_ARGS(rcuname, rhp), | |
565 | ||
566 | TP_STRUCT__entry( | |
567 | __string(rcuname, rcuname) | |
568 | __field(void *, rhp) | |
569 | __field(void *, func) | |
570 | ), | |
571 | ||
572 | TP_fast_assign( | |
573 | tp_strcpy(rcuname, rcuname) | |
574 | tp_assign(rhp, rhp) | |
575 | tp_assign(func, rhp->func) | |
576 | ), | |
577 | ||
578 | TP_printk("%s rhp=%p func=%pf", | |
579 | __get_str(rcuname), __entry->rhp, __entry->func) | |
580 | ) | |
581 | ||
582 | /* | |
583 | * Tracepoint for the invocation of a single RCU callback of the special | |
584 | * kfree() form. The first argument is the RCU flavor, the second | |
585 | * argument is a pointer to the RCU callback, and the third argument | |
586 | * is the offset of the callback within the enclosing RCU-protected | |
587 | * data structure. | |
588 | */ | |
3bc29f0a | 589 | LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback, |
b87700e3 | 590 | |
01adf18e MD |
591 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
592 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset), | |
593 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 594 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset), |
01adf18e | 595 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
596 | |
597 | TP_ARGS(rcuname, rhp, offset), | |
598 | ||
599 | TP_STRUCT__entry( | |
600 | __string(rcuname, rcuname) | |
601 | __field(void *, rhp) | |
602 | __field(unsigned long, offset) | |
603 | ), | |
604 | ||
605 | TP_fast_assign( | |
606 | tp_strcpy(rcuname, rcuname) | |
607 | tp_assign(rhp, rhp) | |
608 | tp_assign(offset, offset) | |
609 | ), | |
610 | ||
611 | TP_printk("%s rhp=%p func=%ld", | |
612 | __get_str(rcuname), __entry->rhp, __entry->offset) | |
613 | ) | |
614 | ||
615 | /* | |
616 | * Tracepoint for exiting rcu_do_batch after RCU callbacks have been | |
617 | * invoked. The first argument is the name of the RCU flavor, | |
618 | * the second argument is number of callbacks actually invoked, | |
619 | * the third argument (cb) is whether or not any of the callbacks that | |
620 | * were ready to invoke at the beginning of this batch are still | |
621 | * queued, the fourth argument (nr) is the return value of need_resched(), | |
622 | * the fifth argument (iit) is 1 if the current task is the idle task, | |
623 | * and the sixth argument (risk) is the return value from | |
624 | * rcu_is_callbacks_kthread(). | |
625 | */ | |
3bc29f0a | 626 | LTTNG_TRACEPOINT_EVENT(rcu_batch_end, |
b87700e3 | 627 | |
01adf18e MD |
628 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) |
629 | TP_PROTO(const char *rcuname, int callbacks_invoked, | |
630 | char cb, char nr, char iit, char risk), | |
631 | ||
632 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), | |
633 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
634 | TP_PROTO(const char *rcuname, int callbacks_invoked, | |
635 | bool cb, bool nr, bool iit, bool risk), | |
636 | ||
637 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), | |
638 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
b87700e3 AG |
639 | TP_PROTO(char *rcuname, int callbacks_invoked, |
640 | bool cb, bool nr, bool iit, bool risk), | |
641 | ||
642 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), | |
643 | #else | |
644 | TP_PROTO(char *rcuname, int callbacks_invoked), | |
645 | ||
646 | TP_ARGS(rcuname, callbacks_invoked), | |
647 | #endif | |
648 | ||
649 | TP_STRUCT__entry( | |
650 | __string(rcuname, rcuname) | |
651 | __field(int, callbacks_invoked) | |
01adf18e MD |
652 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) |
653 | __field(char, cb) | |
654 | __field(char, nr) | |
655 | __field(char, iit) | |
656 | __field(char, risk) | |
657 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
b87700e3 AG |
658 | __field(bool, cb) |
659 | __field(bool, nr) | |
660 | __field(bool, iit) | |
661 | __field(bool, risk) | |
662 | #endif | |
663 | ), | |
664 | ||
665 | TP_fast_assign( | |
666 | tp_strcpy(rcuname, rcuname) | |
667 | tp_assign(callbacks_invoked, callbacks_invoked) | |
668 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
669 | tp_assign(cb, cb) | |
670 | tp_assign(nr, nr) | |
671 | tp_assign(iit, iit) | |
672 | tp_assign(risk, risk) | |
673 | #endif | |
674 | ), | |
675 | ||
676 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
677 | TP_printk("%s CBs-invoked=%d idle=%c%c%c%c", | |
678 | __get_str(rcuname), __entry->callbacks_invoked, | |
679 | __entry->cb ? 'C' : '.', | |
680 | __entry->nr ? 'S' : '.', | |
681 | __entry->iit ? 'I' : '.', | |
682 | __entry->risk ? 'R' : '.') | |
683 | #else | |
684 | TP_printk("%s CBs-invoked=%d", | |
685 | __get_str(rcuname), __entry->callbacks_invoked) | |
686 | #endif | |
687 | ) | |
688 | ||
689 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
690 | /* | |
691 | * Tracepoint for rcutorture readers. The first argument is the name | |
692 | * of the RCU flavor from rcutorture's viewpoint and the second argument | |
693 | * is the callback address. | |
694 | */ | |
3bc29f0a | 695 | LTTNG_TRACEPOINT_EVENT(rcu_torture_read, |
b87700e3 | 696 | |
01adf18e MD |
697 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
698 | TP_PROTO(const char *rcutorturename, struct rcu_head *rhp, | |
699 | unsigned long secs, unsigned long c_old, unsigned long c), | |
700 | ||
701 | TP_ARGS(rcutorturename, rhp, secs, c_old, c), | |
702 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
a828b9d5 MD |
703 | TP_PROTO(char *rcutorturename, struct rcu_head *rhp, |
704 | unsigned long secs, unsigned long c_old, unsigned long c), | |
705 | ||
706 | TP_ARGS(rcutorturename, rhp, secs, c_old, c), | |
707 | #else | |
b87700e3 AG |
708 | TP_PROTO(char *rcutorturename, struct rcu_head *rhp), |
709 | ||
710 | TP_ARGS(rcutorturename, rhp), | |
a828b9d5 | 711 | #endif |
b87700e3 AG |
712 | |
713 | TP_STRUCT__entry( | |
714 | __string(rcutorturename, rcutorturename) | |
715 | __field(struct rcu_head *, rhp) | |
a828b9d5 MD |
716 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
717 | __field(unsigned long, secs) | |
718 | __field(unsigned long, c_old) | |
719 | __field(unsigned long, c) | |
720 | #endif | |
b87700e3 AG |
721 | ), |
722 | ||
723 | TP_fast_assign( | |
724 | tp_strcpy(rcutorturename, rcutorturename) | |
725 | tp_assign(rhp, rhp) | |
a828b9d5 MD |
726 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
727 | tp_assign(secs, secs) | |
728 | tp_assign(c_old, c_old) | |
729 | tp_assign(c, c) | |
730 | #endif | |
b87700e3 AG |
731 | ), |
732 | ||
a828b9d5 MD |
733 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
734 | TP_printk("%s torture read %p %luus c: %lu %lu", | |
735 | __entry->rcutorturename, __entry->rhp, | |
736 | __entry->secs, __entry->c_old, __entry->c) | |
737 | #else | |
b87700e3 AG |
738 | TP_printk("%s torture read %p", |
739 | __get_str(rcutorturename), __entry->rhp) | |
a828b9d5 | 740 | #endif |
b87700e3 AG |
741 | ) |
742 | #endif | |
743 | ||
744 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) | |
745 | /* | |
746 | * Tracepoint for _rcu_barrier() execution. The string "s" describes | |
747 | * the _rcu_barrier phase: | |
748 | * "Begin": rcu_barrier_callback() started. | |
749 | * "Check": rcu_barrier_callback() checking for piggybacking. | |
750 | * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit. | |
751 | * "Inc1": rcu_barrier_callback() piggyback check counter incremented. | |
752 | * "Offline": rcu_barrier_callback() found offline CPU | |
753 | * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks. | |
754 | * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks. | |
755 | * "IRQ": An rcu_barrier_callback() callback posted on remote CPU. | |
756 | * "CB": An rcu_barrier_callback() invoked a callback, not the last. | |
757 | * "LastCB": An rcu_barrier_callback() invoked the last callback. | |
758 | * "Inc2": rcu_barrier_callback() piggyback check counter incremented. | |
759 | * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument | |
760 | * is the count of remaining callbacks, and "done" is the piggybacking count. | |
761 | */ | |
3bc29f0a | 762 | LTTNG_TRACEPOINT_EVENT(rcu_barrier, |
b87700e3 | 763 | |
01adf18e MD |
764 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) |
765 | TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done), | |
766 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
b87700e3 | 767 | TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done), |
01adf18e | 768 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ |
b87700e3 AG |
769 | |
770 | TP_ARGS(rcuname, s, cpu, cnt, done), | |
771 | ||
772 | TP_STRUCT__entry( | |
773 | __string(rcuname, rcuname) | |
774 | __string(s, s) | |
775 | __field(int, cpu) | |
776 | __field(int, cnt) | |
777 | __field(unsigned long, done) | |
778 | ), | |
779 | ||
780 | TP_fast_assign( | |
781 | tp_strcpy(rcuname, rcuname) | |
782 | tp_strcpy(s, s) | |
783 | tp_assign(cpu, cpu) | |
784 | tp_assign(cnt, cnt) | |
785 | tp_assign(done, done) | |
786 | ), | |
787 | ||
788 | TP_printk("%s %s cpu %d remaining %d # %lu", | |
789 | __get_str(rcuname), __get_str(s), __entry->cpu, __entry->cnt, | |
790 | __entry->done) | |
791 | ) | |
792 | #endif | |
793 | ||
794 | #else /* #ifdef CONFIG_RCU_TRACE */ | |
795 | ||
796 | #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0) | |
797 | #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \ | |
798 | qsmask) do { } while (0) | |
799 | #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0) | |
800 | #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0) | |
801 | #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \ | |
802 | grplo, grphi, gp_tasks) do { } \ | |
803 | while (0) | |
804 | #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0) | |
805 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
806 | #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0) | |
807 | #else | |
808 | #define trace_rcu_dyntick(polarity) do { } while (0) | |
809 | #endif | |
810 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
811 | #define trace_rcu_prep_idle(reason) do { } while (0) | |
812 | #endif | |
813 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
814 | #define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0) | |
815 | #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \ | |
816 | do { } while (0) | |
817 | #define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \ | |
818 | do { } while (0) | |
819 | #else | |
820 | #define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0) | |
821 | #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0) | |
822 | #define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0) | |
823 | #endif | |
824 | #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0) | |
825 | #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0) | |
826 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
827 | #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \ | |
828 | do { } while (0) | |
829 | #else | |
830 | #define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0) | |
831 | #endif | |
a828b9d5 MD |
832 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) |
833 | #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ | |
834 | do { } while (0) | |
835 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
b87700e3 AG |
836 | #define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0) |
837 | #endif | |
838 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) | |
839 | #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0) | |
840 | #endif | |
841 | #endif /* #else #ifdef CONFIG_RCU_TRACE */ | |
842 | ||
3bc29f0a | 843 | #endif /* LTTNG_TRACE_RCU_H */ |
b87700e3 AG |
844 | |
845 | /* This part must be outside protection */ | |
846 | #include "../../../probes/define_trace.h" |