blob: 6ad031c71be748528a4cc28d6324a4c8353de161 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Xiao Guangrong2b022e32009-08-10 10:48:59 +08002#undef TRACE_SYSTEM
3#define TRACE_SYSTEM timer
4
5#if !defined(_TRACE_TIMER_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_TIMER_H
7
8#include <linux/tracepoint.h>
Xiao Guangrongc6a2a172009-08-10 10:51:23 +08009#include <linux/hrtimer.h>
Xiao Guangrong2b022e32009-08-10 10:48:59 +080010#include <linux/timer.h>
11
Li Zefan363d0f62010-05-24 16:23:15 +080012DECLARE_EVENT_CLASS(timer_class,
Xiao Guangrong2b022e32009-08-10 10:48:59 +080013
14 TP_PROTO(struct timer_list *timer),
15
16 TP_ARGS(timer),
17
18 TP_STRUCT__entry(
19 __field( void *, timer )
20 ),
21
22 TP_fast_assign(
23 __entry->timer = timer;
24 ),
25
Ingo Molnar434a83c2009-10-15 11:50:39 +020026 TP_printk("timer=%p", __entry->timer)
Xiao Guangrong2b022e32009-08-10 10:48:59 +080027);
28
29/**
Li Zefan363d0f62010-05-24 16:23:15 +080030 * timer_init - called when the timer is initialized
31 * @timer: pointer to struct timer_list
32 */
33DEFINE_EVENT(timer_class, timer_init,
34
35 TP_PROTO(struct timer_list *timer),
36
37 TP_ARGS(timer)
38);
39
Thomas Gleixner8a58a342017-02-10 16:41:15 +010040#define decode_timer_flags(flags) \
41 __print_flags(flags, "|", \
42 { TIMER_MIGRATING, "M" }, \
43 { TIMER_DEFERRABLE, "D" }, \
44 { TIMER_PINNED, "P" }, \
45 { TIMER_IRQSAFE, "I" })
46
Li Zefan363d0f62010-05-24 16:23:15 +080047/**
Xiao Guangrong2b022e32009-08-10 10:48:59 +080048 * timer_start - called when the timer is started
49 * @timer: pointer to struct timer_list
50 * @expires: the timers expiry time
51 */
52TRACE_EVENT(timer_start,
53
Badhri Jagan Sridharan4e413e82015-05-07 16:20:34 -070054 TP_PROTO(struct timer_list *timer,
55 unsigned long expires,
Thomas Gleixner0eeda712015-05-26 22:50:29 +000056 unsigned int flags),
Xiao Guangrong2b022e32009-08-10 10:48:59 +080057
Thomas Gleixner0eeda712015-05-26 22:50:29 +000058 TP_ARGS(timer, expires, flags),
Xiao Guangrong2b022e32009-08-10 10:48:59 +080059
60 TP_STRUCT__entry(
61 __field( void *, timer )
62 __field( void *, function )
63 __field( unsigned long, expires )
64 __field( unsigned long, now )
Thomas Gleixner0eeda712015-05-26 22:50:29 +000065 __field( unsigned int, flags )
Xiao Guangrong2b022e32009-08-10 10:48:59 +080066 ),
67
68 TP_fast_assign(
69 __entry->timer = timer;
70 __entry->function = timer->function;
71 __entry->expires = expires;
72 __entry->now = jiffies;
Thomas Gleixner0eeda712015-05-26 22:50:29 +000073 __entry->flags = flags;
Xiao Guangrong2b022e32009-08-10 10:48:59 +080074 ),
75
Anna-Maria Gleixner6849cbb2019-03-21 13:09:20 +010076 TP_printk("timer=%p function=%ps expires=%lu [timeout=%ld] cpu=%u idx=%u flags=%s",
Xiao Guangrong2b022e32009-08-10 10:48:59 +080077 __entry->timer, __entry->function, __entry->expires,
Thomas Gleixner8a58a342017-02-10 16:41:15 +010078 (long)__entry->expires - __entry->now,
79 __entry->flags & TIMER_CPUMASK,
80 __entry->flags >> TIMER_ARRAYSHIFT,
81 decode_timer_flags(__entry->flags & TIMER_TRACE_FLAGMASK))
Xiao Guangrong2b022e32009-08-10 10:48:59 +080082);
83
84/**
85 * timer_expire_entry - called immediately before the timer callback
86 * @timer: pointer to struct timer_list
87 *
88 * Allows to determine the timer latency.
89 */
90TRACE_EVENT(timer_expire_entry,
91
Anna-Maria Gleixnerf28d3d52019-03-21 13:09:21 +010092 TP_PROTO(struct timer_list *timer, unsigned long baseclk),
Xiao Guangrong2b022e32009-08-10 10:48:59 +080093
Anna-Maria Gleixnerf28d3d52019-03-21 13:09:21 +010094 TP_ARGS(timer, baseclk),
Xiao Guangrong2b022e32009-08-10 10:48:59 +080095
96 TP_STRUCT__entry(
97 __field( void *, timer )
98 __field( unsigned long, now )
Arjan van de Venede1b422010-08-18 15:33:13 -070099 __field( void *, function)
Anna-Maria Gleixnerf28d3d52019-03-21 13:09:21 +0100100 __field( unsigned long, baseclk )
Xiao Guangrong2b022e32009-08-10 10:48:59 +0800101 ),
102
103 TP_fast_assign(
104 __entry->timer = timer;
105 __entry->now = jiffies;
Arjan van de Venede1b422010-08-18 15:33:13 -0700106 __entry->function = timer->function;
Anna-Maria Gleixnerf28d3d52019-03-21 13:09:21 +0100107 __entry->baseclk = baseclk;
Xiao Guangrong2b022e32009-08-10 10:48:59 +0800108 ),
109
Anna-Maria Gleixnerf28d3d52019-03-21 13:09:21 +0100110 TP_printk("timer=%p function=%ps now=%lu baseclk=%lu",
111 __entry->timer, __entry->function, __entry->now,
112 __entry->baseclk)
Xiao Guangrong2b022e32009-08-10 10:48:59 +0800113);
114
115/**
116 * timer_expire_exit - called immediately after the timer callback returns
117 * @timer: pointer to struct timer_list
118 *
119 * When used in combination with the timer_expire_entry tracepoint we can
120 * determine the runtime of the timer callback function.
121 *
Ingo Molnarf2cc0202021-03-23 18:49:35 +0100122 * NOTE: Do NOT dereference timer in TP_fast_assign. The pointer might
Xiao Guangrong2b022e32009-08-10 10:48:59 +0800123 * be invalid. We solely track the pointer.
124 */
Li Zefan363d0f62010-05-24 16:23:15 +0800125DEFINE_EVENT(timer_class, timer_expire_exit,
Xiao Guangrong2b022e32009-08-10 10:48:59 +0800126
127 TP_PROTO(struct timer_list *timer),
128
Li Zefan363d0f62010-05-24 16:23:15 +0800129 TP_ARGS(timer)
Xiao Guangrong2b022e32009-08-10 10:48:59 +0800130);
131
132/**
133 * timer_cancel - called when the timer is canceled
134 * @timer: pointer to struct timer_list
135 */
Li Zefan363d0f62010-05-24 16:23:15 +0800136DEFINE_EVENT(timer_class, timer_cancel,
Xiao Guangrong2b022e32009-08-10 10:48:59 +0800137
138 TP_PROTO(struct timer_list *timer),
139
Li Zefan363d0f62010-05-24 16:23:15 +0800140 TP_ARGS(timer)
Xiao Guangrong2b022e32009-08-10 10:48:59 +0800141);
142
Anna-Maria Gleixner91633ee2017-12-21 11:41:37 +0100143#define decode_clockid(type) \
144 __print_symbolic(type, \
145 { CLOCK_REALTIME, "CLOCK_REALTIME" }, \
146 { CLOCK_MONOTONIC, "CLOCK_MONOTONIC" }, \
147 { CLOCK_BOOTTIME, "CLOCK_BOOTTIME" }, \
148 { CLOCK_TAI, "CLOCK_TAI" })
149
150#define decode_hrtimer_mode(mode) \
151 __print_symbolic(mode, \
152 { HRTIMER_MODE_ABS, "ABS" }, \
153 { HRTIMER_MODE_REL, "REL" }, \
154 { HRTIMER_MODE_ABS_PINNED, "ABS|PINNED" }, \
Anna-Maria Gleixner98ecadd2017-12-21 11:41:55 +0100155 { HRTIMER_MODE_REL_PINNED, "REL|PINNED" }, \
156 { HRTIMER_MODE_ABS_SOFT, "ABS|SOFT" }, \
157 { HRTIMER_MODE_REL_SOFT, "REL|SOFT" }, \
158 { HRTIMER_MODE_ABS_PINNED_SOFT, "ABS|PINNED|SOFT" }, \
159 { HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT" })
Anna-Maria Gleixner91633ee2017-12-21 11:41:37 +0100160
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800161/**
162 * hrtimer_init - called when the hrtimer is initialized
Masanari Iidacf2fbdd2013-03-16 20:53:05 +0900163 * @hrtimer: pointer to struct hrtimer
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800164 * @clockid: the hrtimers clock
165 * @mode: the hrtimers mode
166 */
167TRACE_EVENT(hrtimer_init,
168
Ingo Molnar434a83c2009-10-15 11:50:39 +0200169 TP_PROTO(struct hrtimer *hrtimer, clockid_t clockid,
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800170 enum hrtimer_mode mode),
171
Ingo Molnar434a83c2009-10-15 11:50:39 +0200172 TP_ARGS(hrtimer, clockid, mode),
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800173
174 TP_STRUCT__entry(
Ingo Molnar434a83c2009-10-15 11:50:39 +0200175 __field( void *, hrtimer )
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800176 __field( clockid_t, clockid )
177 __field( enum hrtimer_mode, mode )
178 ),
179
180 TP_fast_assign(
Ingo Molnar434a83c2009-10-15 11:50:39 +0200181 __entry->hrtimer = hrtimer;
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800182 __entry->clockid = clockid;
183 __entry->mode = mode;
184 ),
185
Ingo Molnar434a83c2009-10-15 11:50:39 +0200186 TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer,
Anna-Maria Gleixner91633ee2017-12-21 11:41:37 +0100187 decode_clockid(__entry->clockid),
188 decode_hrtimer_mode(__entry->mode))
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800189);
190
191/**
192 * hrtimer_start - called when the hrtimer is started
Masanari Iidacf2fbdd2013-03-16 20:53:05 +0900193 * @hrtimer: pointer to struct hrtimer
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800194 */
195TRACE_EVENT(hrtimer_start,
196
Anna-Maria Gleixner63e2ed32017-12-21 11:41:38 +0100197 TP_PROTO(struct hrtimer *hrtimer, enum hrtimer_mode mode),
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800198
Anna-Maria Gleixner63e2ed32017-12-21 11:41:38 +0100199 TP_ARGS(hrtimer, mode),
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800200
201 TP_STRUCT__entry(
Ingo Molnar434a83c2009-10-15 11:50:39 +0200202 __field( void *, hrtimer )
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800203 __field( void *, function )
204 __field( s64, expires )
205 __field( s64, softexpires )
Anna-Maria Gleixner63e2ed32017-12-21 11:41:38 +0100206 __field( enum hrtimer_mode, mode )
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800207 ),
208
209 TP_fast_assign(
Ingo Molnar434a83c2009-10-15 11:50:39 +0200210 __entry->hrtimer = hrtimer;
211 __entry->function = hrtimer->function;
Thomas Gleixner2456e852016-12-25 11:38:40 +0100212 __entry->expires = hrtimer_get_expires(hrtimer);
213 __entry->softexpires = hrtimer_get_softexpires(hrtimer);
Anna-Maria Gleixner63e2ed32017-12-21 11:41:38 +0100214 __entry->mode = mode;
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800215 ),
216
Anna-Maria Gleixner6849cbb2019-03-21 13:09:20 +0100217 TP_printk("hrtimer=%p function=%ps expires=%llu softexpires=%llu "
Anna-Maria Gleixner63e2ed32017-12-21 11:41:38 +0100218 "mode=%s", __entry->hrtimer, __entry->function,
Thomas Gleixner2456e852016-12-25 11:38:40 +0100219 (unsigned long long) __entry->expires,
Anna-Maria Gleixner63e2ed32017-12-21 11:41:38 +0100220 (unsigned long long) __entry->softexpires,
221 decode_hrtimer_mode(__entry->mode))
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800222);
223
224/**
Masanari Iidacf2fbdd2013-03-16 20:53:05 +0900225 * hrtimer_expire_entry - called immediately before the hrtimer callback
226 * @hrtimer: pointer to struct hrtimer
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800227 * @now: pointer to variable which contains current time of the
228 * timers base.
229 *
230 * Allows to determine the timer latency.
231 */
232TRACE_EVENT(hrtimer_expire_entry,
233
Ingo Molnar434a83c2009-10-15 11:50:39 +0200234 TP_PROTO(struct hrtimer *hrtimer, ktime_t *now),
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800235
Ingo Molnar434a83c2009-10-15 11:50:39 +0200236 TP_ARGS(hrtimer, now),
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800237
238 TP_STRUCT__entry(
Ingo Molnar434a83c2009-10-15 11:50:39 +0200239 __field( void *, hrtimer )
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800240 __field( s64, now )
Arjan van de Venede1b422010-08-18 15:33:13 -0700241 __field( void *, function)
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800242 ),
243
244 TP_fast_assign(
Ingo Molnar434a83c2009-10-15 11:50:39 +0200245 __entry->hrtimer = hrtimer;
Thomas Gleixner2456e852016-12-25 11:38:40 +0100246 __entry->now = *now;
Arjan van de Venede1b422010-08-18 15:33:13 -0700247 __entry->function = hrtimer->function;
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800248 ),
249
Anna-Maria Gleixner6849cbb2019-03-21 13:09:20 +0100250 TP_printk("hrtimer=%p function=%ps now=%llu",
251 __entry->hrtimer, __entry->function,
Thomas Gleixner2456e852016-12-25 11:38:40 +0100252 (unsigned long long) __entry->now)
253);
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800254
Li Zefan363d0f62010-05-24 16:23:15 +0800255DECLARE_EVENT_CLASS(hrtimer_class,
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800256
Ingo Molnar434a83c2009-10-15 11:50:39 +0200257 TP_PROTO(struct hrtimer *hrtimer),
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800258
Ingo Molnar434a83c2009-10-15 11:50:39 +0200259 TP_ARGS(hrtimer),
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800260
261 TP_STRUCT__entry(
Ingo Molnar434a83c2009-10-15 11:50:39 +0200262 __field( void *, hrtimer )
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800263 ),
264
265 TP_fast_assign(
Ingo Molnar434a83c2009-10-15 11:50:39 +0200266 __entry->hrtimer = hrtimer;
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800267 ),
268
Ingo Molnar434a83c2009-10-15 11:50:39 +0200269 TP_printk("hrtimer=%p", __entry->hrtimer)
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800270);
271
272/**
Li Zefan363d0f62010-05-24 16:23:15 +0800273 * hrtimer_expire_exit - called immediately after the hrtimer callback returns
Masanari Iidacf2fbdd2013-03-16 20:53:05 +0900274 * @hrtimer: pointer to struct hrtimer
Li Zefan363d0f62010-05-24 16:23:15 +0800275 *
276 * When used in combination with the hrtimer_expire_entry tracepoint we can
277 * determine the runtime of the callback function.
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800278 */
Li Zefan363d0f62010-05-24 16:23:15 +0800279DEFINE_EVENT(hrtimer_class, hrtimer_expire_exit,
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800280
Ingo Molnar434a83c2009-10-15 11:50:39 +0200281 TP_PROTO(struct hrtimer *hrtimer),
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800282
Li Zefan363d0f62010-05-24 16:23:15 +0800283 TP_ARGS(hrtimer)
284);
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800285
Li Zefan363d0f62010-05-24 16:23:15 +0800286/**
287 * hrtimer_cancel - called when the hrtimer is canceled
288 * @hrtimer: pointer to struct hrtimer
289 */
290DEFINE_EVENT(hrtimer_class, hrtimer_cancel,
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800291
Li Zefan363d0f62010-05-24 16:23:15 +0800292 TP_PROTO(struct hrtimer *hrtimer),
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800293
Li Zefan363d0f62010-05-24 16:23:15 +0800294 TP_ARGS(hrtimer)
Xiao Guangrongc6a2a172009-08-10 10:51:23 +0800295);
296
Xiao Guangrong3f0a5252009-08-10 10:52:30 +0800297/**
298 * itimer_state - called when itimer is started or canceled
299 * @which: name of the interval timer
300 * @value: the itimers value, itimer is canceled if value->it_value is
301 * zero, otherwise it is started
302 * @expires: the itimers expiry time
303 */
304TRACE_EVENT(itimer_state,
305
Arnd Bergmannbd40a172019-11-07 15:27:39 +0100306 TP_PROTO(int which, const struct itimerspec64 *const value,
Frederic Weisbecker858cf3a2017-01-31 04:09:35 +0100307 unsigned long long expires),
Xiao Guangrong3f0a5252009-08-10 10:52:30 +0800308
309 TP_ARGS(which, value, expires),
310
311 TP_STRUCT__entry(
Frederic Weisbecker858cf3a2017-01-31 04:09:35 +0100312 __field( int, which )
313 __field( unsigned long long, expires )
314 __field( long, value_sec )
Arnd Bergmannbd40a172019-11-07 15:27:39 +0100315 __field( long, value_nsec )
Frederic Weisbecker858cf3a2017-01-31 04:09:35 +0100316 __field( long, interval_sec )
Arnd Bergmannbd40a172019-11-07 15:27:39 +0100317 __field( long, interval_nsec )
Xiao Guangrong3f0a5252009-08-10 10:52:30 +0800318 ),
319
320 TP_fast_assign(
321 __entry->which = which;
322 __entry->expires = expires;
323 __entry->value_sec = value->it_value.tv_sec;
Arnd Bergmannbd40a172019-11-07 15:27:39 +0100324 __entry->value_nsec = value->it_value.tv_nsec;
Xiao Guangrong3f0a5252009-08-10 10:52:30 +0800325 __entry->interval_sec = value->it_interval.tv_sec;
Arnd Bergmannbd40a172019-11-07 15:27:39 +0100326 __entry->interval_nsec = value->it_interval.tv_nsec;
Xiao Guangrong3f0a5252009-08-10 10:52:30 +0800327 ),
328
Arnd Bergmannbd40a172019-11-07 15:27:39 +0100329 TP_printk("which=%d expires=%llu it_value=%ld.%06ld it_interval=%ld.%06ld",
Frederic Weisbecker858cf3a2017-01-31 04:09:35 +0100330 __entry->which, __entry->expires,
Arnd Bergmannbd40a172019-11-07 15:27:39 +0100331 __entry->value_sec, __entry->value_nsec / NSEC_PER_USEC,
332 __entry->interval_sec, __entry->interval_nsec / NSEC_PER_USEC)
Xiao Guangrong3f0a5252009-08-10 10:52:30 +0800333);
334
335/**
336 * itimer_expire - called when itimer expires
337 * @which: type of the interval timer
338 * @pid: pid of the process which owns the timer
339 * @now: current time, used to calculate the latency of itimer
340 */
341TRACE_EVENT(itimer_expire,
342
Frederic Weisbecker858cf3a2017-01-31 04:09:35 +0100343 TP_PROTO(int which, struct pid *pid, unsigned long long now),
Xiao Guangrong3f0a5252009-08-10 10:52:30 +0800344
345 TP_ARGS(which, pid, now),
346
347 TP_STRUCT__entry(
Frederic Weisbecker858cf3a2017-01-31 04:09:35 +0100348 __field( int , which )
349 __field( pid_t, pid )
350 __field( unsigned long long, now )
Xiao Guangrong3f0a5252009-08-10 10:52:30 +0800351 ),
352
353 TP_fast_assign(
354 __entry->which = which;
355 __entry->now = now;
356 __entry->pid = pid_nr(pid);
357 ),
358
Thomas Gleixnere9c07482009-12-10 13:23:19 +0100359 TP_printk("which=%d pid=%d now=%llu", __entry->which,
Frederic Weisbecker858cf3a2017-01-31 04:09:35 +0100360 (int) __entry->pid, __entry->now)
Xiao Guangrong3f0a5252009-08-10 10:52:30 +0800361);
362
Frederic Weisbecker2c82d1be2013-04-20 17:35:50 +0200363#ifdef CONFIG_NO_HZ_COMMON
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100364
365#define TICK_DEP_NAMES \
Steven Rostedt (Red Hat)c87edb32016-08-05 12:41:52 -0400366 tick_dep_mask_name(NONE) \
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100367 tick_dep_name(POSIX_TIMER) \
368 tick_dep_name(PERF_EVENTS) \
369 tick_dep_name(SCHED) \
Frederic Weisbecker01b4c392019-07-24 15:22:59 +0200370 tick_dep_name(CLOCK_UNSTABLE) \
371 tick_dep_name_end(RCU)
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100372
373#undef tick_dep_name
Steven Rostedt (Red Hat)c87edb32016-08-05 12:41:52 -0400374#undef tick_dep_mask_name
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100375#undef tick_dep_name_end
376
Steven Rostedt (Red Hat)c87edb32016-08-05 12:41:52 -0400377/* The MASK will convert to their bits and they need to be processed too */
378#define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
379 TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
380#define tick_dep_name_end(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
381 TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
382/* NONE only has a mask defined for it */
383#define tick_dep_mask_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100384
385TICK_DEP_NAMES
386
387#undef tick_dep_name
Steven Rostedt (Red Hat)c87edb32016-08-05 12:41:52 -0400388#undef tick_dep_mask_name
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100389#undef tick_dep_name_end
390
391#define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
Steven Rostedt (Red Hat)c87edb32016-08-05 12:41:52 -0400392#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100393#define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }
394
395#define show_tick_dep_name(val) \
396 __print_symbolic(val, TICK_DEP_NAMES)
397
Frederic Weisbeckercb41a292013-04-20 17:35:50 +0200398TRACE_EVENT(tick_stop,
399
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100400 TP_PROTO(int success, int dependency),
Frederic Weisbeckercb41a292013-04-20 17:35:50 +0200401
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100402 TP_ARGS(success, dependency),
Frederic Weisbeckercb41a292013-04-20 17:35:50 +0200403
404 TP_STRUCT__entry(
405 __field( int , success )
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100406 __field( int , dependency )
Frederic Weisbeckercb41a292013-04-20 17:35:50 +0200407 ),
408
409 TP_fast_assign(
410 __entry->success = success;
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100411 __entry->dependency = dependency;
Frederic Weisbeckercb41a292013-04-20 17:35:50 +0200412 ),
413
Frederic Weisbeckere6e6cc22015-12-11 03:27:25 +0100414 TP_printk("success=%d dependency=%s", __entry->success, \
415 show_tick_dep_name(__entry->dependency))
Frederic Weisbeckercb41a292013-04-20 17:35:50 +0200416);
417#endif
418
Xiao Guangrong2b022e32009-08-10 10:48:59 +0800419#endif /* _TRACE_TIMER_H */
420
421/* This part must be outside protection */
422#include <trace/define_trace.h>