2 #define TRACE_SYSTEM power
4 #if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/ktime.h>
8 #include <linux/tracepoint.h>
10 DECLARE_EVENT_CLASS(cpu,
12 TP_PROTO(unsigned int state, unsigned int cpu_id),
14 TP_ARGS(state, cpu_id),
18 __field( u32, cpu_id )
22 __entry->state = state;
23 __entry->cpu_id = cpu_id;
26 TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state,
27 (unsigned long)__entry->cpu_id)
30 DEFINE_EVENT(cpu, cpu_idle,
32 TP_PROTO(unsigned int state, unsigned int cpu_id),
34 TP_ARGS(state, cpu_id)
37 /* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */
38 #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING
39 #define _PWR_EVENT_AVOID_DOUBLE_DEFINING
41 #define PWR_EVENT_EXIT -1
44 DEFINE_EVENT(cpu, cpu_frequency,
46 TP_PROTO(unsigned int frequency, unsigned int cpu_id),
48 TP_ARGS(frequency, cpu_id)
51 TRACE_EVENT(machine_suspend,
53 TP_PROTO(unsigned int state),
62 __entry->state = state;
65 TP_printk("state=%lu", (unsigned long)__entry->state)
68 DECLARE_EVENT_CLASS(wakeup_source,
70 TP_PROTO(const char *name, unsigned int state),
75 __string( name, name )
80 __assign_str(name, name);
81 __entry->state = state;
84 TP_printk("%s state=0x%lx", __get_str(name),
85 (unsigned long)__entry->state)
88 DEFINE_EVENT(wakeup_source, wakeup_source_activate,
90 TP_PROTO(const char *name, unsigned int state),
95 DEFINE_EVENT(wakeup_source, wakeup_source_deactivate,
97 TP_PROTO(const char *name, unsigned int state),
103 * The clock events are used for clock enable/disable and for
106 DECLARE_EVENT_CLASS(clock,
108 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
110 TP_ARGS(name, state, cpu_id),
113 __string( name, name )
114 __field( u64, state )
115 __field( u64, cpu_id )
119 __assign_str(name, name);
120 __entry->state = state;
121 __entry->cpu_id = cpu_id;
124 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
125 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
128 DEFINE_EVENT(clock, clock_enable,
130 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
132 TP_ARGS(name, state, cpu_id)
135 DEFINE_EVENT(clock, clock_disable,
137 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
139 TP_ARGS(name, state, cpu_id)
142 DEFINE_EVENT(clock, clock_set_rate,
144 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
146 TP_ARGS(name, state, cpu_id)
150 * The power domain events are used for power domains transitions
152 DECLARE_EVENT_CLASS(power_domain,
154 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
156 TP_ARGS(name, state, cpu_id),
159 __string( name, name )
160 __field( u64, state )
161 __field( u64, cpu_id )
165 __assign_str(name, name);
166 __entry->state = state;
167 __entry->cpu_id = cpu_id;
170 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
171 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
174 DEFINE_EVENT(power_domain, power_domain_target,
176 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
178 TP_ARGS(name, state, cpu_id)
180 #endif /* _TRACE_POWER_H */
182 /* This part must be outside protection */
183 #include <trace/define_trace.h>