diff options
Diffstat (limited to 'include/trace/events/timer.h')
-rw-r--r-- | include/trace/events/timer.h | 80 |
1 files changed, 32 insertions, 48 deletions
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index 9496b965d62a..c624126a9c8a 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h | |||
@@ -8,11 +8,7 @@ | |||
8 | #include <linux/hrtimer.h> | 8 | #include <linux/hrtimer.h> |
9 | #include <linux/timer.h> | 9 | #include <linux/timer.h> |
10 | 10 | ||
11 | /** | 11 | DECLARE_EVENT_CLASS(timer_class, |
12 | * timer_init - called when the timer is initialized | ||
13 | * @timer: pointer to struct timer_list | ||
14 | */ | ||
15 | TRACE_EVENT(timer_init, | ||
16 | 12 | ||
17 | TP_PROTO(struct timer_list *timer), | 13 | TP_PROTO(struct timer_list *timer), |
18 | 14 | ||
@@ -30,6 +26,17 @@ TRACE_EVENT(timer_init, | |||
30 | ); | 26 | ); |
31 | 27 | ||
32 | /** | 28 | /** |
29 | * timer_init - called when the timer is initialized | ||
30 | * @timer: pointer to struct timer_list | ||
31 | */ | ||
32 | DEFINE_EVENT(timer_class, timer_init, | ||
33 | |||
34 | TP_PROTO(struct timer_list *timer), | ||
35 | |||
36 | TP_ARGS(timer) | ||
37 | ); | ||
38 | |||
39 | /** | ||
33 | * timer_start - called when the timer is started | 40 | * timer_start - called when the timer is started |
34 | * @timer: pointer to struct timer_list | 41 | * @timer: pointer to struct timer_list |
35 | * @expires: the timers expiry time | 42 | * @expires: the timers expiry time |
@@ -94,42 +101,22 @@ TRACE_EVENT(timer_expire_entry, | |||
94 | * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might | 101 | * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might |
95 | * be invalid. We solely track the pointer. | 102 | * be invalid. We solely track the pointer. |
96 | */ | 103 | */ |
97 | TRACE_EVENT(timer_expire_exit, | 104 | DEFINE_EVENT(timer_class, timer_expire_exit, |
98 | 105 | ||
99 | TP_PROTO(struct timer_list *timer), | 106 | TP_PROTO(struct timer_list *timer), |
100 | 107 | ||
101 | TP_ARGS(timer), | 108 | TP_ARGS(timer) |
102 | |||
103 | TP_STRUCT__entry( | ||
104 | __field(void *, timer ) | ||
105 | ), | ||
106 | |||
107 | TP_fast_assign( | ||
108 | __entry->timer = timer; | ||
109 | ), | ||
110 | |||
111 | TP_printk("timer=%p", __entry->timer) | ||
112 | ); | 109 | ); |
113 | 110 | ||
114 | /** | 111 | /** |
115 | * timer_cancel - called when the timer is canceled | 112 | * timer_cancel - called when the timer is canceled |
116 | * @timer: pointer to struct timer_list | 113 | * @timer: pointer to struct timer_list |
117 | */ | 114 | */ |
118 | TRACE_EVENT(timer_cancel, | 115 | DEFINE_EVENT(timer_class, timer_cancel, |
119 | 116 | ||
120 | TP_PROTO(struct timer_list *timer), | 117 | TP_PROTO(struct timer_list *timer), |
121 | 118 | ||
122 | TP_ARGS(timer), | 119 | TP_ARGS(timer) |
123 | |||
124 | TP_STRUCT__entry( | ||
125 | __field( void *, timer ) | ||
126 | ), | ||
127 | |||
128 | TP_fast_assign( | ||
129 | __entry->timer = timer; | ||
130 | ), | ||
131 | |||
132 | TP_printk("timer=%p", __entry->timer) | ||
133 | ); | 120 | ); |
134 | 121 | ||
135 | /** | 122 | /** |
@@ -224,14 +211,7 @@ TRACE_EVENT(hrtimer_expire_entry, | |||
224 | (unsigned long long)ktime_to_ns((ktime_t) { .tv64 = __entry->now })) | 211 | (unsigned long long)ktime_to_ns((ktime_t) { .tv64 = __entry->now })) |
225 | ); | 212 | ); |
226 | 213 | ||
227 | /** | 214 | DECLARE_EVENT_CLASS(hrtimer_class, |
228 | * hrtimer_expire_exit - called immediately after the hrtimer callback returns | ||
229 | * @timer: pointer to struct hrtimer | ||
230 | * | ||
231 | * When used in combination with the hrtimer_expire_entry tracepoint we can | ||
232 | * determine the runtime of the callback function. | ||
233 | */ | ||
234 | TRACE_EVENT(hrtimer_expire_exit, | ||
235 | 215 | ||
236 | TP_PROTO(struct hrtimer *hrtimer), | 216 | TP_PROTO(struct hrtimer *hrtimer), |
237 | 217 | ||
@@ -249,24 +229,28 @@ TRACE_EVENT(hrtimer_expire_exit, | |||
249 | ); | 229 | ); |
250 | 230 | ||
251 | /** | 231 | /** |
252 | * hrtimer_cancel - called when the hrtimer is canceled | 232 | * hrtimer_expire_exit - called immediately after the hrtimer callback returns |
253 | * @hrtimer: pointer to struct hrtimer | 233 | * @timer: pointer to struct hrtimer |
234 | * | ||
235 | * When used in combination with the hrtimer_expire_entry tracepoint we can | ||
236 | * determine the runtime of the callback function. | ||
254 | */ | 237 | */ |
255 | TRACE_EVENT(hrtimer_cancel, | 238 | DEFINE_EVENT(hrtimer_class, hrtimer_expire_exit, |
256 | 239 | ||
257 | TP_PROTO(struct hrtimer *hrtimer), | 240 | TP_PROTO(struct hrtimer *hrtimer), |
258 | 241 | ||
259 | TP_ARGS(hrtimer), | 242 | TP_ARGS(hrtimer) |
243 | ); | ||
260 | 244 | ||
261 | TP_STRUCT__entry( | 245 | /** |
262 | __field( void *, hrtimer ) | 246 | * hrtimer_cancel - called when the hrtimer is canceled |
263 | ), | 247 | * @hrtimer: pointer to struct hrtimer |
248 | */ | ||
249 | DEFINE_EVENT(hrtimer_class, hrtimer_cancel, | ||
264 | 250 | ||
265 | TP_fast_assign( | 251 | TP_PROTO(struct hrtimer *hrtimer), |
266 | __entry->hrtimer = hrtimer; | ||
267 | ), | ||
268 | 252 | ||
269 | TP_printk("hrtimer=%p", __entry->hrtimer) | 253 | TP_ARGS(hrtimer) |
270 | ); | 254 | ); |
271 | 255 | ||
272 | /** | 256 | /** |