7eeb87ce1e8eb4e279516ead5672220c01d498b6
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>
9 #include <linux/version.h>
11 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
12 DECLARE_EVENT_CLASS(cpu
,
14 TP_PROTO(unsigned int state
, unsigned int cpu_id
),
16 TP_ARGS(state
, cpu_id
),
20 __field( u32
, cpu_id
)
24 tp_assign(state
, state
)
25 tp_assign(cpu_id
, cpu_id
)
28 TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry
->state
,
29 (unsigned long)__entry
->cpu_id
)
32 DEFINE_EVENT(cpu
, cpu_idle
,
34 TP_PROTO(unsigned int state
, unsigned int cpu_id
),
36 TP_ARGS(state
, cpu_id
)
39 /* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */
40 #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING
41 #define _PWR_EVENT_AVOID_DOUBLE_DEFINING
43 #define PWR_EVENT_EXIT -1
46 DEFINE_EVENT(cpu
, cpu_frequency
,
48 TP_PROTO(unsigned int frequency
, unsigned int cpu_id
),
50 TP_ARGS(frequency
, cpu_id
)
53 TRACE_EVENT(machine_suspend
,
55 TP_PROTO(unsigned int state
),
64 tp_assign(state
, state
)
67 TP_printk("state=%lu", (unsigned long)__entry
->state
)
71 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
72 DECLARE_EVENT_CLASS(wakeup_source
,
74 TP_PROTO(const char *name
, unsigned int state
),
79 __string( name
, name
)
85 tp_assign(state
, state
)
88 TP_printk("%s state=0x%lx", __get_str(name
),
89 (unsigned long)__entry
->state
)
92 DEFINE_EVENT(wakeup_source
, wakeup_source_activate
,
94 TP_PROTO(const char *name
, unsigned int state
),
99 DEFINE_EVENT(wakeup_source
, wakeup_source_deactivate
,
101 TP_PROTO(const char *name
, unsigned int state
),
107 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
108 #undef CONFIG_EVENT_POWER_TRACING_DEPRECATED
109 #define CONFIG_EVENT_POWER_TRACING_DEPRECATED
110 #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
113 #ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED
116 * The power events are used for cpuidle & suspend (power_start, power_end)
117 * and for cpufreq (power_frequency)
119 DECLARE_EVENT_CLASS(power
,
121 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
122 TP_PROTO(unsigned int type
, unsigned int state
, unsigned int cpu_id
),
124 TP_ARGS(type
, state
, cpu_id
),
126 TP_PROTO(unsigned int type
, unsigned int state
),
128 TP_ARGS(type
, state
),
133 __field( u64
, state
)
134 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
135 __field( u64
, cpu_id
)
140 tp_assign(type
, type
)
141 tp_assign(state
, state
)
142 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
143 tp_assign(cpu_id
, cpu_id
)
147 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
148 TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry
->type
,
149 (unsigned long)__entry
->state
, (unsigned long)__entry
->cpu_id
)
151 TP_printk("type=%lu state=%lu", (unsigned long)__entry
->type
,
152 (unsigned long)__entry
->state
)
156 DEFINE_EVENT(power
, power_start
,
158 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
159 TP_PROTO(unsigned int type
, unsigned int state
, unsigned int cpu_id
),
161 TP_ARGS(type
, state
, cpu_id
)
163 TP_PROTO(unsigned int type
, unsigned int state
),
169 DEFINE_EVENT(power
, power_frequency
,
171 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
172 TP_PROTO(unsigned int type
, unsigned int state
, unsigned int cpu_id
),
174 TP_ARGS(type
, state
, cpu_id
)
176 TP_PROTO(unsigned int type
, unsigned int state
),
182 TRACE_EVENT(power_end
,
184 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
185 TP_PROTO(unsigned int cpu_id
),
195 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
196 __field( u64
, cpu_id
)
198 __field( u64
, dummy
)
203 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
204 tp_assign(cpu_id
, cpu_id
)
206 tp_assign(dummy
, 0xffff)
210 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
211 TP_printk("cpu_id=%lu", (unsigned long)__entry
->cpu_id
)
213 TP_printk("dummy=%lu", (unsigned long)__entry
->dummy
)
217 /* Deprecated dummy functions must be protected against multi-declartion */
218 #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
219 #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
226 #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
228 #else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
230 #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
231 #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
238 /* These dummy declaration have to be ripped out when the deprecated
239 events get removed */
240 static inline void trace_power_start(u64 type
, u64 state
, u64 cpuid
) {};
241 static inline void trace_power_end(u64 cpuid
) {};
242 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
243 static inline void trace_power_start_rcuidle(u64 type
, u64 state
, u64 cpuid
) {};
244 static inline void trace_power_end_rcuidle(u64 cpuid
) {};
246 static inline void trace_power_frequency(u64 type
, u64 state
, u64 cpuid
) {};
247 #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
249 #endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
251 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
253 * The clock events are used for clock enable/disable and for
256 DECLARE_EVENT_CLASS(clock
,
258 TP_PROTO(const char *name
, unsigned int state
, unsigned int cpu_id
),
260 TP_ARGS(name
, state
, cpu_id
),
263 __string( name
, name
)
264 __field( u64
, state
)
265 __field( u64
, cpu_id
)
269 tp_strcpy(name
, name
)
270 tp_assign(state
, state
)
271 tp_assign(cpu_id
, cpu_id
)
274 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name
),
275 (unsigned long)__entry
->state
, (unsigned long)__entry
->cpu_id
)
278 DEFINE_EVENT(clock
, clock_enable
,
280 TP_PROTO(const char *name
, unsigned int state
, unsigned int cpu_id
),
282 TP_ARGS(name
, state
, cpu_id
)
285 DEFINE_EVENT(clock
, clock_disable
,
287 TP_PROTO(const char *name
, unsigned int state
, unsigned int cpu_id
),
289 TP_ARGS(name
, state
, cpu_id
)
292 DEFINE_EVENT(clock
, clock_set_rate
,
294 TP_PROTO(const char *name
, unsigned int state
, unsigned int cpu_id
),
296 TP_ARGS(name
, state
, cpu_id
)
300 * The power domain events are used for power domains transitions
302 DECLARE_EVENT_CLASS(power_domain
,
304 TP_PROTO(const char *name
, unsigned int state
, unsigned int cpu_id
),
306 TP_ARGS(name
, state
, cpu_id
),
309 __string( name
, name
)
310 __field( u64
, state
)
311 __field( u64
, cpu_id
)
315 tp_strcpy(name
, name
)
316 tp_assign(state
, state
)
317 tp_assign(cpu_id
, cpu_id
)
320 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name
),
321 (unsigned long)__entry
->state
, (unsigned long)__entry
->cpu_id
)
324 DEFINE_EVENT(power_domain
, power_domain_target
,
326 TP_PROTO(const char *name
, unsigned int state
, unsigned int cpu_id
),
328 TP_ARGS(name
, state
, cpu_id
)
332 #endif /* _TRACE_POWER_H */
334 /* This part must be outside protection */
335 #include "../../../probes/define_trace.h"
This page took 0.076389 seconds and 4 git commands to generate.