Commit | Line | Data |
---|---|---|
29c00b4a PM |
1 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM rcu | |
3 | ||
4 | #if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ) | |
5 | #define _TRACE_RCU_H | |
6 | ||
7 | #include <linux/tracepoint.h> | |
8 | ||
9 | /* | |
300df91c PM |
10 | * Tracepoint for start/end markers used for utilization calculations. |
11 | * By convention, the string is of the following forms: | |
12 | * | |
13 | * "Start <activity>" -- Mark the start of the specified activity, | |
14 | * such as "context switch". Nesting is permitted. | |
15 | * "End <activity>" -- Mark the end of the specified activity. | |
16 | */ | |
17 | TRACE_EVENT(rcu_utilization, | |
18 | ||
19 | TP_PROTO(char *s), | |
20 | ||
21 | TP_ARGS(s), | |
22 | ||
23 | TP_STRUCT__entry( | |
24 | __field(char *, s) | |
25 | ), | |
26 | ||
27 | TP_fast_assign( | |
28 | __entry->s = s; | |
29 | ), | |
30 | ||
31 | TP_printk("%s", __entry->s) | |
32 | ); | |
33 | ||
34 | /* | |
35 | * Tracepoint for marking the beginning rcu_do_batch, performed to start | |
36 | * RCU callback invocation. The first argument is the total number of | |
37 | * callbacks (including those that are not yet ready to be invoked), | |
38 | * and the second argument is the current RCU-callback batch limit. | |
29c00b4a PM |
39 | */ |
40 | TRACE_EVENT(rcu_batch_start, | |
41 | ||
300df91c | 42 | TP_PROTO(long qlen, int blimit), |
29c00b4a | 43 | |
300df91c | 44 | TP_ARGS(qlen, blimit), |
29c00b4a PM |
45 | |
46 | TP_STRUCT__entry( | |
300df91c PM |
47 | __field(long, qlen) |
48 | __field(int, blimit) | |
29c00b4a PM |
49 | ), |
50 | ||
51 | TP_fast_assign( | |
300df91c PM |
52 | __entry->qlen = qlen; |
53 | __entry->blimit = blimit; | |
29c00b4a PM |
54 | ), |
55 | ||
300df91c | 56 | TP_printk("CBs=%ld bl=%d", __entry->qlen, __entry->blimit) |
29c00b4a PM |
57 | ); |
58 | ||
59 | /* | |
300df91c PM |
60 | * Tracepoint for the invocation of a single RCU callback function. |
61 | * The argument is a pointer to the RCU callback itself. | |
29c00b4a PM |
62 | */ |
63 | TRACE_EVENT(rcu_invoke_callback, | |
64 | ||
65 | TP_PROTO(struct rcu_head *rhp), | |
66 | ||
67 | TP_ARGS(rhp), | |
68 | ||
69 | TP_STRUCT__entry( | |
300df91c PM |
70 | __field(void *, rhp) |
71 | __field(void *, func) | |
29c00b4a PM |
72 | ), |
73 | ||
74 | TP_fast_assign( | |
300df91c PM |
75 | __entry->rhp = rhp; |
76 | __entry->func = rhp->func; | |
29c00b4a PM |
77 | ), |
78 | ||
79 | TP_printk("rhp=%p func=%pf", __entry->rhp, __entry->func) | |
80 | ); | |
81 | ||
82 | /* | |
300df91c PM |
83 | * Tracepoint for the invocation of a single RCU callback of the special |
84 | * kfree() form. The first argument is a pointer to the RCU callback | |
85 | * and the second argument is the offset of the callback within the | |
86 | * enclosing RCU-protected data structure. | |
29c00b4a PM |
87 | */ |
88 | TRACE_EVENT(rcu_invoke_kfree_callback, | |
89 | ||
90 | TP_PROTO(struct rcu_head *rhp, unsigned long offset), | |
91 | ||
92 | TP_ARGS(rhp, offset), | |
93 | ||
94 | TP_STRUCT__entry( | |
300df91c PM |
95 | __field(void *, rhp) |
96 | __field(unsigned long, offset) | |
29c00b4a PM |
97 | ), |
98 | ||
99 | TP_fast_assign( | |
300df91c | 100 | __entry->rhp = rhp; |
29c00b4a PM |
101 | __entry->offset = offset; |
102 | ), | |
103 | ||
104 | TP_printk("rhp=%p func=%ld", __entry->rhp, __entry->offset) | |
105 | ); | |
106 | ||
107 | /* | |
300df91c PM |
108 | * Tracepoint for exiting rcu_do_batch after RCU callbacks have been |
109 | * invoked. The first argument is the number of callbacks actually invoked. | |
29c00b4a PM |
110 | */ |
111 | TRACE_EVENT(rcu_batch_end, | |
112 | ||
113 | TP_PROTO(int callbacks_invoked), | |
114 | ||
115 | TP_ARGS(callbacks_invoked), | |
116 | ||
117 | TP_STRUCT__entry( | |
300df91c | 118 | __field(int, callbacks_invoked) |
29c00b4a PM |
119 | ), |
120 | ||
121 | TP_fast_assign( | |
300df91c | 122 | __entry->callbacks_invoked = callbacks_invoked; |
29c00b4a PM |
123 | ), |
124 | ||
125 | TP_printk("CBs-invoked=%d", __entry->callbacks_invoked) | |
126 | ); | |
127 | ||
128 | #endif /* _TRACE_RCU_H */ | |
129 | ||
130 | /* This part must be outside protection */ | |
131 | #include <trace/define_trace.h> |