1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM alarmtimer
3 
4 #if !defined(_TRACE_ALARMTIMER_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_ALARMTIMER_H
6 
7 #include <linux/alarmtimer.h>
8 #include <linux/rtc.h>
9 #include <linux/tracepoint.h>
10 
11 TRACE_DEFINE_ENUM(ALARM_REALTIME);
12 TRACE_DEFINE_ENUM(ALARM_BOOTTIME);
13 TRACE_DEFINE_ENUM(ALARM_REALTIME_FREEZER);
14 TRACE_DEFINE_ENUM(ALARM_BOOTTIME_FREEZER);
15 
16 #define show_alarm_type(type)	__print_flags(type, " | ",	\
17 	{ 1 << ALARM_REALTIME, "REALTIME" },			\
18 	{ 1 << ALARM_BOOTTIME, "BOOTTIME" },			\
19 	{ 1 << ALARM_REALTIME_FREEZER, "REALTIME Freezer" },	\
20 	{ 1 << ALARM_BOOTTIME_FREEZER, "BOOTTIME Freezer" })
21 
22 TRACE_EVENT(alarmtimer_suspend,
23 
24 	TP_PROTO(ktime_t expires, int flag),
25 
26 	TP_ARGS(expires, flag),
27 
28 	TP_STRUCT__entry(
29 		__field(s64, expires)
30 		__field(unsigned char, alarm_type)
31 	),
32 
33 	TP_fast_assign(
34 		__entry->expires = expires;
35 		__entry->alarm_type = flag;
36 	),
37 
38 	TP_printk("alarmtimer type:%s expires:%llu",
39 		  show_alarm_type((1 << __entry->alarm_type)),
40 		  __entry->expires
41 	)
42 );
43 
44 DECLARE_EVENT_CLASS(alarm_class,
45 
46 	TP_PROTO(struct alarm *alarm, ktime_t now),
47 
48 	TP_ARGS(alarm, now),
49 
50 	TP_STRUCT__entry(
51 		__field(void *,	alarm)
52 		__field(unsigned char, alarm_type)
53 		__field(s64, expires)
54 		__field(s64, now)
55 	),
56 
57 	TP_fast_assign(
58 		__entry->alarm = alarm;
59 		__entry->alarm_type = alarm->type;
60 		__entry->expires = alarm->node.expires;
61 		__entry->now = now;
62 	),
63 
64 	TP_printk("alarmtimer:%p type:%s expires:%llu now:%llu",
65 		  __entry->alarm,
66 		  show_alarm_type((1 << __entry->alarm_type)),
67 		  __entry->expires,
68 		  __entry->now
69 	)
70 );
71 
72 DEFINE_EVENT(alarm_class, alarmtimer_fired,
73 
74 	TP_PROTO(struct alarm *alarm, ktime_t now),
75 
76 	TP_ARGS(alarm, now)
77 );
78 
79 DEFINE_EVENT(alarm_class, alarmtimer_start,
80 
81 	TP_PROTO(struct alarm *alarm, ktime_t now),
82 
83 	TP_ARGS(alarm, now)
84 );
85 
86 DEFINE_EVENT(alarm_class, alarmtimer_cancel,
87 
88 	TP_PROTO(struct alarm *alarm, ktime_t now),
89 
90 	TP_ARGS(alarm, now)
91 );
92 
93 #endif /* _TRACE_ALARMTIMER_H */
94 
95 /* This part must be outside protection */
96 #include <trace/define_trace.h>
97