Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
[linux-2.6/libata-dev.git] / include / trace / events / power.h
blob0c9783841a3033565fa90100d6c6efd003861267
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM power
4 #if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_POWER_H
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),
16 TP_STRUCT__entry(
17 __field( u32, state )
18 __field( u32, cpu_id )
21 TP_fast_assign(
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
42 #endif
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),
55 TP_ARGS(state),
57 TP_STRUCT__entry(
58 __field( u32, state )
61 TP_fast_assign(
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),
72 TP_ARGS(name, state),
74 TP_STRUCT__entry(
75 __string( name, name )
76 __field( u64, state )
79 TP_fast_assign(
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),
92 TP_ARGS(name, state)
95 DEFINE_EVENT(wakeup_source, wakeup_source_deactivate,
97 TP_PROTO(const char *name, unsigned int state),
99 TP_ARGS(name, state)
102 #ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED
105 * The power events are used for cpuidle & suspend (power_start, power_end)
106 * and for cpufreq (power_frequency)
108 DECLARE_EVENT_CLASS(power,
110 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
112 TP_ARGS(type, state, cpu_id),
114 TP_STRUCT__entry(
115 __field( u64, type )
116 __field( u64, state )
117 __field( u64, cpu_id )
120 TP_fast_assign(
121 __entry->type = type;
122 __entry->state = state;
123 __entry->cpu_id = cpu_id;
126 TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry->type,
127 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
130 DEFINE_EVENT(power, power_start,
132 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
134 TP_ARGS(type, state, cpu_id)
137 DEFINE_EVENT(power, power_frequency,
139 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
141 TP_ARGS(type, state, cpu_id)
144 TRACE_EVENT(power_end,
146 TP_PROTO(unsigned int cpu_id),
148 TP_ARGS(cpu_id),
150 TP_STRUCT__entry(
151 __field( u64, cpu_id )
154 TP_fast_assign(
155 __entry->cpu_id = cpu_id;
158 TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id)
162 /* Deprecated dummy functions must be protected against multi-declartion */
163 #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
164 #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
166 enum {
167 POWER_NONE = 0,
168 POWER_CSTATE = 1,
169 POWER_PSTATE = 2,
171 #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
173 #else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
175 #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
176 #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
177 enum {
178 POWER_NONE = 0,
179 POWER_CSTATE = 1,
180 POWER_PSTATE = 2,
183 /* These dummy declaration have to be ripped out when the deprecated
184 events get removed */
185 static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {};
186 static inline void trace_power_end(u64 cpuid) {};
187 static inline void trace_power_start_rcuidle(u64 type, u64 state, u64 cpuid) {};
188 static inline void trace_power_end_rcuidle(u64 cpuid) {};
189 static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {};
190 #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
192 #endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
195 * The clock events are used for clock enable/disable and for
196 * clock rate change
198 DECLARE_EVENT_CLASS(clock,
200 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
202 TP_ARGS(name, state, cpu_id),
204 TP_STRUCT__entry(
205 __string( name, name )
206 __field( u64, state )
207 __field( u64, cpu_id )
210 TP_fast_assign(
211 __assign_str(name, name);
212 __entry->state = state;
213 __entry->cpu_id = cpu_id;
216 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
217 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
220 DEFINE_EVENT(clock, clock_enable,
222 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
224 TP_ARGS(name, state, cpu_id)
227 DEFINE_EVENT(clock, clock_disable,
229 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
231 TP_ARGS(name, state, cpu_id)
234 DEFINE_EVENT(clock, clock_set_rate,
236 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
238 TP_ARGS(name, state, cpu_id)
242 * The power domain events are used for power domains transitions
244 DECLARE_EVENT_CLASS(power_domain,
246 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
248 TP_ARGS(name, state, cpu_id),
250 TP_STRUCT__entry(
251 __string( name, name )
252 __field( u64, state )
253 __field( u64, cpu_id )
256 TP_fast_assign(
257 __assign_str(name, name);
258 __entry->state = state;
259 __entry->cpu_id = cpu_id;
262 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
263 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
266 DEFINE_EVENT(power_domain, power_domain_target,
268 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
270 TP_ARGS(name, state, cpu_id)
272 #endif /* _TRACE_POWER_H */
274 /* This part must be outside protection */
275 #include <trace/define_trace.h>