xref: /openbmc/linux/include/trace/events/timer.h (revision 8a58a34ba479d42b3ef28f8ffd9e245a81a7786f)
12b022e3dSXiao Guangrong #undef TRACE_SYSTEM
22b022e3dSXiao Guangrong #define TRACE_SYSTEM timer
32b022e3dSXiao Guangrong 
42b022e3dSXiao Guangrong #if !defined(_TRACE_TIMER_H) || defined(TRACE_HEADER_MULTI_READ)
52b022e3dSXiao Guangrong #define _TRACE_TIMER_H
62b022e3dSXiao Guangrong 
72b022e3dSXiao Guangrong #include <linux/tracepoint.h>
8c6a2a177SXiao Guangrong #include <linux/hrtimer.h>
92b022e3dSXiao Guangrong #include <linux/timer.h>
102b022e3dSXiao Guangrong 
11363d0f64SLi Zefan DECLARE_EVENT_CLASS(timer_class,
122b022e3dSXiao Guangrong 
132b022e3dSXiao Guangrong 	TP_PROTO(struct timer_list *timer),
142b022e3dSXiao Guangrong 
152b022e3dSXiao Guangrong 	TP_ARGS(timer),
162b022e3dSXiao Guangrong 
172b022e3dSXiao Guangrong 	TP_STRUCT__entry(
182b022e3dSXiao Guangrong 		__field( void *,	timer	)
192b022e3dSXiao Guangrong 	),
202b022e3dSXiao Guangrong 
212b022e3dSXiao Guangrong 	TP_fast_assign(
222b022e3dSXiao Guangrong 		__entry->timer	= timer;
232b022e3dSXiao Guangrong 	),
242b022e3dSXiao Guangrong 
25434a83c3SIngo Molnar 	TP_printk("timer=%p", __entry->timer)
262b022e3dSXiao Guangrong );
272b022e3dSXiao Guangrong 
282b022e3dSXiao Guangrong /**
29363d0f64SLi Zefan  * timer_init - called when the timer is initialized
30363d0f64SLi Zefan  * @timer:	pointer to struct timer_list
31363d0f64SLi Zefan  */
32363d0f64SLi Zefan DEFINE_EVENT(timer_class, timer_init,
33363d0f64SLi Zefan 
34363d0f64SLi Zefan 	TP_PROTO(struct timer_list *timer),
35363d0f64SLi Zefan 
36363d0f64SLi Zefan 	TP_ARGS(timer)
37363d0f64SLi Zefan );
38363d0f64SLi Zefan 
39*8a58a34bSThomas Gleixner #define decode_timer_flags(flags)			\
40*8a58a34bSThomas Gleixner 	__print_flags(flags, "|",			\
41*8a58a34bSThomas Gleixner 		{  TIMER_MIGRATING,	"M" },		\
42*8a58a34bSThomas Gleixner 		{  TIMER_DEFERRABLE,	"D" },		\
43*8a58a34bSThomas Gleixner 		{  TIMER_PINNED,	"P" },		\
44*8a58a34bSThomas Gleixner 		{  TIMER_IRQSAFE,	"I" })
45*8a58a34bSThomas Gleixner 
46363d0f64SLi Zefan /**
472b022e3dSXiao Guangrong  * timer_start - called when the timer is started
482b022e3dSXiao Guangrong  * @timer:	pointer to struct timer_list
492b022e3dSXiao Guangrong  * @expires:	the timers expiry time
502b022e3dSXiao Guangrong  */
512b022e3dSXiao Guangrong TRACE_EVENT(timer_start,
522b022e3dSXiao Guangrong 
534e413e85SBadhri Jagan Sridharan 	TP_PROTO(struct timer_list *timer,
544e413e85SBadhri Jagan Sridharan 		unsigned long expires,
550eeda71bSThomas Gleixner 		unsigned int flags),
562b022e3dSXiao Guangrong 
570eeda71bSThomas Gleixner 	TP_ARGS(timer, expires, flags),
582b022e3dSXiao Guangrong 
592b022e3dSXiao Guangrong 	TP_STRUCT__entry(
602b022e3dSXiao Guangrong 		__field( void *,	timer		)
612b022e3dSXiao Guangrong 		__field( void *,	function	)
622b022e3dSXiao Guangrong 		__field( unsigned long,	expires		)
632b022e3dSXiao Guangrong 		__field( unsigned long,	now		)
640eeda71bSThomas Gleixner 		__field( unsigned int,	flags		)
652b022e3dSXiao Guangrong 	),
662b022e3dSXiao Guangrong 
672b022e3dSXiao Guangrong 	TP_fast_assign(
682b022e3dSXiao Guangrong 		__entry->timer		= timer;
692b022e3dSXiao Guangrong 		__entry->function	= timer->function;
702b022e3dSXiao Guangrong 		__entry->expires	= expires;
712b022e3dSXiao Guangrong 		__entry->now		= jiffies;
720eeda71bSThomas Gleixner 		__entry->flags		= flags;
732b022e3dSXiao Guangrong 	),
742b022e3dSXiao Guangrong 
75*8a58a34bSThomas Gleixner 	TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld] cpu=%u idx=%u flags=%s",
762b022e3dSXiao Guangrong 		  __entry->timer, __entry->function, __entry->expires,
77*8a58a34bSThomas Gleixner 		  (long)__entry->expires - __entry->now,
78*8a58a34bSThomas Gleixner 		  __entry->flags & TIMER_CPUMASK,
79*8a58a34bSThomas Gleixner 		  __entry->flags >> TIMER_ARRAYSHIFT,
80*8a58a34bSThomas Gleixner 		  decode_timer_flags(__entry->flags & TIMER_TRACE_FLAGMASK))
812b022e3dSXiao Guangrong );
822b022e3dSXiao Guangrong 
832b022e3dSXiao Guangrong /**
842b022e3dSXiao Guangrong  * timer_expire_entry - called immediately before the timer callback
852b022e3dSXiao Guangrong  * @timer:	pointer to struct timer_list
862b022e3dSXiao Guangrong  *
872b022e3dSXiao Guangrong  * Allows to determine the timer latency.
882b022e3dSXiao Guangrong  */
892b022e3dSXiao Guangrong TRACE_EVENT(timer_expire_entry,
902b022e3dSXiao Guangrong 
912b022e3dSXiao Guangrong 	TP_PROTO(struct timer_list *timer),
922b022e3dSXiao Guangrong 
932b022e3dSXiao Guangrong 	TP_ARGS(timer),
942b022e3dSXiao Guangrong 
952b022e3dSXiao Guangrong 	TP_STRUCT__entry(
962b022e3dSXiao Guangrong 		__field( void *,	timer	)
972b022e3dSXiao Guangrong 		__field( unsigned long,	now	)
98ede1b429SArjan van de Ven 		__field( void *,	function)
992b022e3dSXiao Guangrong 	),
1002b022e3dSXiao Guangrong 
1012b022e3dSXiao Guangrong 	TP_fast_assign(
1022b022e3dSXiao Guangrong 		__entry->timer		= timer;
1032b022e3dSXiao Guangrong 		__entry->now		= jiffies;
104ede1b429SArjan van de Ven 		__entry->function	= timer->function;
1052b022e3dSXiao Guangrong 	),
1062b022e3dSXiao Guangrong 
107ede1b429SArjan van de Ven 	TP_printk("timer=%p function=%pf now=%lu", __entry->timer, __entry->function,__entry->now)
1082b022e3dSXiao Guangrong );
1092b022e3dSXiao Guangrong 
1102b022e3dSXiao Guangrong /**
1112b022e3dSXiao Guangrong  * timer_expire_exit - called immediately after the timer callback returns
1122b022e3dSXiao Guangrong  * @timer:	pointer to struct timer_list
1132b022e3dSXiao Guangrong  *
1142b022e3dSXiao Guangrong  * When used in combination with the timer_expire_entry tracepoint we can
1152b022e3dSXiao Guangrong  * determine the runtime of the timer callback function.
1162b022e3dSXiao Guangrong  *
1172b022e3dSXiao Guangrong  * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might
1182b022e3dSXiao Guangrong  * be invalid. We solely track the pointer.
1192b022e3dSXiao Guangrong  */
120363d0f64SLi Zefan DEFINE_EVENT(timer_class, timer_expire_exit,
1212b022e3dSXiao Guangrong 
1222b022e3dSXiao Guangrong 	TP_PROTO(struct timer_list *timer),
1232b022e3dSXiao Guangrong 
124363d0f64SLi Zefan 	TP_ARGS(timer)
1252b022e3dSXiao Guangrong );
1262b022e3dSXiao Guangrong 
1272b022e3dSXiao Guangrong /**
1282b022e3dSXiao Guangrong  * timer_cancel - called when the timer is canceled
1292b022e3dSXiao Guangrong  * @timer:	pointer to struct timer_list
1302b022e3dSXiao Guangrong  */
131363d0f64SLi Zefan DEFINE_EVENT(timer_class, timer_cancel,
1322b022e3dSXiao Guangrong 
1332b022e3dSXiao Guangrong 	TP_PROTO(struct timer_list *timer),
1342b022e3dSXiao Guangrong 
135363d0f64SLi Zefan 	TP_ARGS(timer)
1362b022e3dSXiao Guangrong );
1372b022e3dSXiao Guangrong 
138c6a2a177SXiao Guangrong /**
139c6a2a177SXiao Guangrong  * hrtimer_init - called when the hrtimer is initialized
140cf2fbdd2SMasanari Iida  * @hrtimer:	pointer to struct hrtimer
141c6a2a177SXiao Guangrong  * @clockid:	the hrtimers clock
142c6a2a177SXiao Guangrong  * @mode:	the hrtimers mode
143c6a2a177SXiao Guangrong  */
144c6a2a177SXiao Guangrong TRACE_EVENT(hrtimer_init,
145c6a2a177SXiao Guangrong 
146434a83c3SIngo Molnar 	TP_PROTO(struct hrtimer *hrtimer, clockid_t clockid,
147c6a2a177SXiao Guangrong 		 enum hrtimer_mode mode),
148c6a2a177SXiao Guangrong 
149434a83c3SIngo Molnar 	TP_ARGS(hrtimer, clockid, mode),
150c6a2a177SXiao Guangrong 
151c6a2a177SXiao Guangrong 	TP_STRUCT__entry(
152434a83c3SIngo Molnar 		__field( void *,		hrtimer		)
153c6a2a177SXiao Guangrong 		__field( clockid_t,		clockid		)
154c6a2a177SXiao Guangrong 		__field( enum hrtimer_mode,	mode		)
155c6a2a177SXiao Guangrong 	),
156c6a2a177SXiao Guangrong 
157c6a2a177SXiao Guangrong 	TP_fast_assign(
158434a83c3SIngo Molnar 		__entry->hrtimer	= hrtimer;
159c6a2a177SXiao Guangrong 		__entry->clockid	= clockid;
160c6a2a177SXiao Guangrong 		__entry->mode		= mode;
161c6a2a177SXiao Guangrong 	),
162c6a2a177SXiao Guangrong 
163434a83c3SIngo Molnar 	TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer,
164c6a2a177SXiao Guangrong 		  __entry->clockid == CLOCK_REALTIME ?
165c6a2a177SXiao Guangrong 			"CLOCK_REALTIME" : "CLOCK_MONOTONIC",
166c6a2a177SXiao Guangrong 		  __entry->mode == HRTIMER_MODE_ABS ?
167c6a2a177SXiao Guangrong 			"HRTIMER_MODE_ABS" : "HRTIMER_MODE_REL")
168c6a2a177SXiao Guangrong );
169c6a2a177SXiao Guangrong 
170c6a2a177SXiao Guangrong /**
171c6a2a177SXiao Guangrong  * hrtimer_start - called when the hrtimer is started
172cf2fbdd2SMasanari Iida  * @hrtimer: pointer to struct hrtimer
173c6a2a177SXiao Guangrong  */
174c6a2a177SXiao Guangrong TRACE_EVENT(hrtimer_start,
175c6a2a177SXiao Guangrong 
176434a83c3SIngo Molnar 	TP_PROTO(struct hrtimer *hrtimer),
177c6a2a177SXiao Guangrong 
178434a83c3SIngo Molnar 	TP_ARGS(hrtimer),
179c6a2a177SXiao Guangrong 
180c6a2a177SXiao Guangrong 	TP_STRUCT__entry(
181434a83c3SIngo Molnar 		__field( void *,	hrtimer		)
182c6a2a177SXiao Guangrong 		__field( void *,	function	)
183c6a2a177SXiao Guangrong 		__field( s64,		expires		)
184c6a2a177SXiao Guangrong 		__field( s64,		softexpires	)
185c6a2a177SXiao Guangrong 	),
186c6a2a177SXiao Guangrong 
187c6a2a177SXiao Guangrong 	TP_fast_assign(
188434a83c3SIngo Molnar 		__entry->hrtimer	= hrtimer;
189434a83c3SIngo Molnar 		__entry->function	= hrtimer->function;
1902456e855SThomas Gleixner 		__entry->expires	= hrtimer_get_expires(hrtimer);
1912456e855SThomas Gleixner 		__entry->softexpires	= hrtimer_get_softexpires(hrtimer);
192c6a2a177SXiao Guangrong 	),
193c6a2a177SXiao Guangrong 
194434a83c3SIngo Molnar 	TP_printk("hrtimer=%p function=%pf expires=%llu softexpires=%llu",
195434a83c3SIngo Molnar 		  __entry->hrtimer, __entry->function,
1962456e855SThomas Gleixner 		  (unsigned long long) __entry->expires,
1972456e855SThomas Gleixner 		  (unsigned long long) __entry->softexpires)
198c6a2a177SXiao Guangrong );
199c6a2a177SXiao Guangrong 
200c6a2a177SXiao Guangrong /**
201cf2fbdd2SMasanari Iida  * hrtimer_expire_entry - called immediately before the hrtimer callback
202cf2fbdd2SMasanari Iida  * @hrtimer:	pointer to struct hrtimer
203c6a2a177SXiao Guangrong  * @now:	pointer to variable which contains current time of the
204c6a2a177SXiao Guangrong  *		timers base.
205c6a2a177SXiao Guangrong  *
206c6a2a177SXiao Guangrong  * Allows to determine the timer latency.
207c6a2a177SXiao Guangrong  */
208c6a2a177SXiao Guangrong TRACE_EVENT(hrtimer_expire_entry,
209c6a2a177SXiao Guangrong 
210434a83c3SIngo Molnar 	TP_PROTO(struct hrtimer *hrtimer, ktime_t *now),
211c6a2a177SXiao Guangrong 
212434a83c3SIngo Molnar 	TP_ARGS(hrtimer, now),
213c6a2a177SXiao Guangrong 
214c6a2a177SXiao Guangrong 	TP_STRUCT__entry(
215434a83c3SIngo Molnar 		__field( void *,	hrtimer	)
216c6a2a177SXiao Guangrong 		__field( s64,		now	)
217ede1b429SArjan van de Ven 		__field( void *,	function)
218c6a2a177SXiao Guangrong 	),
219c6a2a177SXiao Guangrong 
220c6a2a177SXiao Guangrong 	TP_fast_assign(
221434a83c3SIngo Molnar 		__entry->hrtimer	= hrtimer;
2222456e855SThomas Gleixner 		__entry->now		= *now;
223ede1b429SArjan van de Ven 		__entry->function	= hrtimer->function;
224c6a2a177SXiao Guangrong 	),
225c6a2a177SXiao Guangrong 
226ede1b429SArjan van de Ven 	TP_printk("hrtimer=%p function=%pf now=%llu", __entry->hrtimer, __entry->function,
2272456e855SThomas Gleixner 		  (unsigned long long) __entry->now)
228c6a2a177SXiao Guangrong );
229c6a2a177SXiao Guangrong 
230363d0f64SLi Zefan DECLARE_EVENT_CLASS(hrtimer_class,
231c6a2a177SXiao Guangrong 
232434a83c3SIngo Molnar 	TP_PROTO(struct hrtimer *hrtimer),
233c6a2a177SXiao Guangrong 
234434a83c3SIngo Molnar 	TP_ARGS(hrtimer),
235c6a2a177SXiao Guangrong 
236c6a2a177SXiao Guangrong 	TP_STRUCT__entry(
237434a83c3SIngo Molnar 		__field( void *,	hrtimer	)
238c6a2a177SXiao Guangrong 	),
239c6a2a177SXiao Guangrong 
240c6a2a177SXiao Guangrong 	TP_fast_assign(
241434a83c3SIngo Molnar 		__entry->hrtimer	= hrtimer;
242c6a2a177SXiao Guangrong 	),
243c6a2a177SXiao Guangrong 
244434a83c3SIngo Molnar 	TP_printk("hrtimer=%p", __entry->hrtimer)
245c6a2a177SXiao Guangrong );
246c6a2a177SXiao Guangrong 
247c6a2a177SXiao Guangrong /**
248363d0f64SLi Zefan  * hrtimer_expire_exit - called immediately after the hrtimer callback returns
249cf2fbdd2SMasanari Iida  * @hrtimer:	pointer to struct hrtimer
250363d0f64SLi Zefan  *
251363d0f64SLi Zefan  * When used in combination with the hrtimer_expire_entry tracepoint we can
252363d0f64SLi Zefan  * determine the runtime of the callback function.
253c6a2a177SXiao Guangrong  */
254363d0f64SLi Zefan DEFINE_EVENT(hrtimer_class, hrtimer_expire_exit,
255c6a2a177SXiao Guangrong 
256434a83c3SIngo Molnar 	TP_PROTO(struct hrtimer *hrtimer),
257c6a2a177SXiao Guangrong 
258363d0f64SLi Zefan 	TP_ARGS(hrtimer)
259363d0f64SLi Zefan );
260c6a2a177SXiao Guangrong 
261363d0f64SLi Zefan /**
262363d0f64SLi Zefan  * hrtimer_cancel - called when the hrtimer is canceled
263363d0f64SLi Zefan  * @hrtimer:	pointer to struct hrtimer
264363d0f64SLi Zefan  */
265363d0f64SLi Zefan DEFINE_EVENT(hrtimer_class, hrtimer_cancel,
266c6a2a177SXiao Guangrong 
267363d0f64SLi Zefan 	TP_PROTO(struct hrtimer *hrtimer),
268c6a2a177SXiao Guangrong 
269363d0f64SLi Zefan 	TP_ARGS(hrtimer)
270c6a2a177SXiao Guangrong );
271c6a2a177SXiao Guangrong 
2723f0a525eSXiao Guangrong /**
2733f0a525eSXiao Guangrong  * itimer_state - called when itimer is started or canceled
2743f0a525eSXiao Guangrong  * @which:	name of the interval timer
2753f0a525eSXiao Guangrong  * @value:	the itimers value, itimer is canceled if value->it_value is
2763f0a525eSXiao Guangrong  *		zero, otherwise it is started
2773f0a525eSXiao Guangrong  * @expires:	the itimers expiry time
2783f0a525eSXiao Guangrong  */
2793f0a525eSXiao Guangrong TRACE_EVENT(itimer_state,
2803f0a525eSXiao Guangrong 
2813f0a525eSXiao Guangrong 	TP_PROTO(int which, const struct itimerval *const value,
2823f0a525eSXiao Guangrong 		 cputime_t expires),
2833f0a525eSXiao Guangrong 
2843f0a525eSXiao Guangrong 	TP_ARGS(which, value, expires),
2853f0a525eSXiao Guangrong 
2863f0a525eSXiao Guangrong 	TP_STRUCT__entry(
2873f0a525eSXiao Guangrong 		__field(	int,		which		)
2883f0a525eSXiao Guangrong 		__field(	cputime_t,	expires		)
2893f0a525eSXiao Guangrong 		__field(	long,		value_sec	)
2903f0a525eSXiao Guangrong 		__field(	long,		value_usec	)
2913f0a525eSXiao Guangrong 		__field(	long,		interval_sec	)
2923f0a525eSXiao Guangrong 		__field(	long,		interval_usec	)
2933f0a525eSXiao Guangrong 	),
2943f0a525eSXiao Guangrong 
2953f0a525eSXiao Guangrong 	TP_fast_assign(
2963f0a525eSXiao Guangrong 		__entry->which		= which;
2973f0a525eSXiao Guangrong 		__entry->expires	= expires;
2983f0a525eSXiao Guangrong 		__entry->value_sec	= value->it_value.tv_sec;
2993f0a525eSXiao Guangrong 		__entry->value_usec	= value->it_value.tv_usec;
3003f0a525eSXiao Guangrong 		__entry->interval_sec	= value->it_interval.tv_sec;
3013f0a525eSXiao Guangrong 		__entry->interval_usec	= value->it_interval.tv_usec;
3023f0a525eSXiao Guangrong 	),
3033f0a525eSXiao Guangrong 
304e9c0748bSThomas Gleixner 	TP_printk("which=%d expires=%llu it_value=%ld.%ld it_interval=%ld.%ld",
305e9c0748bSThomas Gleixner 		  __entry->which, (unsigned long long)__entry->expires,
3063f0a525eSXiao Guangrong 		  __entry->value_sec, __entry->value_usec,
3073f0a525eSXiao Guangrong 		  __entry->interval_sec, __entry->interval_usec)
3083f0a525eSXiao Guangrong );
3093f0a525eSXiao Guangrong 
3103f0a525eSXiao Guangrong /**
3113f0a525eSXiao Guangrong  * itimer_expire - called when itimer expires
3123f0a525eSXiao Guangrong  * @which:	type of the interval timer
3133f0a525eSXiao Guangrong  * @pid:	pid of the process which owns the timer
3143f0a525eSXiao Guangrong  * @now:	current time, used to calculate the latency of itimer
3153f0a525eSXiao Guangrong  */
3163f0a525eSXiao Guangrong TRACE_EVENT(itimer_expire,
3173f0a525eSXiao Guangrong 
3183f0a525eSXiao Guangrong 	TP_PROTO(int which, struct pid *pid, cputime_t now),
3193f0a525eSXiao Guangrong 
3203f0a525eSXiao Guangrong 	TP_ARGS(which, pid, now),
3213f0a525eSXiao Guangrong 
3223f0a525eSXiao Guangrong 	TP_STRUCT__entry(
3233f0a525eSXiao Guangrong 		__field( int ,		which	)
3243f0a525eSXiao Guangrong 		__field( pid_t,		pid	)
3253f0a525eSXiao Guangrong 		__field( cputime_t,	now	)
3263f0a525eSXiao Guangrong 	),
3273f0a525eSXiao Guangrong 
3283f0a525eSXiao Guangrong 	TP_fast_assign(
3293f0a525eSXiao Guangrong 		__entry->which	= which;
3303f0a525eSXiao Guangrong 		__entry->now	= now;
3313f0a525eSXiao Guangrong 		__entry->pid	= pid_nr(pid);
3323f0a525eSXiao Guangrong 	),
3333f0a525eSXiao Guangrong 
334e9c0748bSThomas Gleixner 	TP_printk("which=%d pid=%d now=%llu", __entry->which,
335e9c0748bSThomas Gleixner 		  (int) __entry->pid, (unsigned long long)__entry->now)
3363f0a525eSXiao Guangrong );
3373f0a525eSXiao Guangrong 
3382c82d1beSFrederic Weisbecker #ifdef CONFIG_NO_HZ_COMMON
339e6e6cc22SFrederic Weisbecker 
340e6e6cc22SFrederic Weisbecker #define TICK_DEP_NAMES					\
341c87edb36SSteven Rostedt (Red Hat) 		tick_dep_mask_name(NONE)		\
342e6e6cc22SFrederic Weisbecker 		tick_dep_name(POSIX_TIMER)		\
343e6e6cc22SFrederic Weisbecker 		tick_dep_name(PERF_EVENTS)		\
344e6e6cc22SFrederic Weisbecker 		tick_dep_name(SCHED)			\
345e6e6cc22SFrederic Weisbecker 		tick_dep_name_end(CLOCK_UNSTABLE)
346e6e6cc22SFrederic Weisbecker 
347e6e6cc22SFrederic Weisbecker #undef tick_dep_name
348c87edb36SSteven Rostedt (Red Hat) #undef tick_dep_mask_name
349e6e6cc22SFrederic Weisbecker #undef tick_dep_name_end
350e6e6cc22SFrederic Weisbecker 
351c87edb36SSteven Rostedt (Red Hat) /* The MASK will convert to their bits and they need to be processed too */
352c87edb36SSteven Rostedt (Red Hat) #define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
353c87edb36SSteven Rostedt (Red Hat) 	TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
354c87edb36SSteven Rostedt (Red Hat) #define tick_dep_name_end(sdep)  TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
355c87edb36SSteven Rostedt (Red Hat) 	TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
356c87edb36SSteven Rostedt (Red Hat) /* NONE only has a mask defined for it */
357c87edb36SSteven Rostedt (Red Hat) #define tick_dep_mask_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
358e6e6cc22SFrederic Weisbecker 
359e6e6cc22SFrederic Weisbecker TICK_DEP_NAMES
360e6e6cc22SFrederic Weisbecker 
361e6e6cc22SFrederic Weisbecker #undef tick_dep_name
362c87edb36SSteven Rostedt (Red Hat) #undef tick_dep_mask_name
363e6e6cc22SFrederic Weisbecker #undef tick_dep_name_end
364e6e6cc22SFrederic Weisbecker 
365e6e6cc22SFrederic Weisbecker #define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
366c87edb36SSteven Rostedt (Red Hat) #define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
367e6e6cc22SFrederic Weisbecker #define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }
368e6e6cc22SFrederic Weisbecker 
369e6e6cc22SFrederic Weisbecker #define show_tick_dep_name(val)				\
370e6e6cc22SFrederic Weisbecker 	__print_symbolic(val, TICK_DEP_NAMES)
371e6e6cc22SFrederic Weisbecker 
372cb41a290SFrederic Weisbecker TRACE_EVENT(tick_stop,
373cb41a290SFrederic Weisbecker 
374e6e6cc22SFrederic Weisbecker 	TP_PROTO(int success, int dependency),
375cb41a290SFrederic Weisbecker 
376e6e6cc22SFrederic Weisbecker 	TP_ARGS(success, dependency),
377cb41a290SFrederic Weisbecker 
378cb41a290SFrederic Weisbecker 	TP_STRUCT__entry(
379cb41a290SFrederic Weisbecker 		__field( int ,		success	)
380e6e6cc22SFrederic Weisbecker 		__field( int ,		dependency )
381cb41a290SFrederic Weisbecker 	),
382cb41a290SFrederic Weisbecker 
383cb41a290SFrederic Weisbecker 	TP_fast_assign(
384cb41a290SFrederic Weisbecker 		__entry->success	= success;
385e6e6cc22SFrederic Weisbecker 		__entry->dependency	= dependency;
386cb41a290SFrederic Weisbecker 	),
387cb41a290SFrederic Weisbecker 
388e6e6cc22SFrederic Weisbecker 	TP_printk("success=%d dependency=%s",  __entry->success, \
389e6e6cc22SFrederic Weisbecker 			show_tick_dep_name(__entry->dependency))
390cb41a290SFrederic Weisbecker );
391cb41a290SFrederic Weisbecker #endif
392cb41a290SFrederic Weisbecker 
3932b022e3dSXiao Guangrong #endif /*  _TRACE_TIMER_H */
3942b022e3dSXiao Guangrong 
3952b022e3dSXiao Guangrong /* This part must be outside protection */
3962b022e3dSXiao Guangrong #include <trace/define_trace.h>
397