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)
149 TRACE_EVENT(clock_set_parent,
151 TP_PROTO(const char *name, const char *parent_name),
153 TP_ARGS(name, parent_name),
156 __string( name, name )
157 __string( parent_name, parent_name )
161 __assign_str(name, name);
162 __assign_str(parent_name, parent_name);
165 TP_printk("%s parent=%s", __get_str(name), __get_str(parent_name))
169 * The power domain events are used for power domains transitions
171 DECLARE_EVENT_CLASS(power_domain,
173 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
175 TP_ARGS(name, state, cpu_id),
178 __string( name, name )
179 __field( u64, state )
180 __field( u64, cpu_id )
184 __assign_str(name, name);
185 __entry->state = state;
186 __entry->cpu_id = cpu_id;
189 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
190 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
193 DEFINE_EVENT(power_domain, power_domain_target,
195 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
197 TP_ARGS(name, state, cpu_id)
199 #endif /* _TRACE_POWER_H */
201 /* This part must be outside protection */
202 #include <trace/define_trace.h>