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 #ifndef _TRACE_POWER_ENUM_
11 #define _TRACE_POWER_ENUM_
14 POWER_CSTATE = 1, /* C-State */
15 POWER_PSTATE = 2, /* Fequency change or DVFS */
16 POWER_SSTATE = 3, /* Suspend */
21 * The power events are used for cpuidle & suspend (power_start, power_end)
22 * and for cpufreq (power_frequency)
24 DECLARE_EVENT_CLASS(power,
26 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
28 TP_ARGS(type, state, cpu_id),
33 __field( u64, cpu_id )
38 __entry->state = state;
39 __entry->cpu_id = cpu_id;
42 TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry->type,
43 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
46 DEFINE_EVENT(power, power_start,
48 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
50 TP_ARGS(type, state, cpu_id)
53 DEFINE_EVENT(power, power_frequency,
55 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
57 TP_ARGS(type, state, cpu_id)
60 TRACE_EVENT(power_end,
62 TP_PROTO(unsigned int cpu_id),
67 __field( u64, cpu_id )
71 __entry->cpu_id = cpu_id;
74 TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id)
79 * The clock events are used for clock enable/disable and for
82 DECLARE_EVENT_CLASS(clock,
84 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
86 TP_ARGS(name, state, cpu_id),
89 __string( name, name )
91 __field( u64, cpu_id )
95 __assign_str(name, name);
96 __entry->state = state;
97 __entry->cpu_id = cpu_id;
100 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
101 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
104 DEFINE_EVENT(clock, clock_enable,
106 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
108 TP_ARGS(name, state, cpu_id)
111 DEFINE_EVENT(clock, clock_disable,
113 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
115 TP_ARGS(name, state, cpu_id)
118 DEFINE_EVENT(clock, clock_set_rate,
120 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
122 TP_ARGS(name, state, cpu_id)
126 * The power domain events are used for power domains transitions
128 DECLARE_EVENT_CLASS(power_domain,
130 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
132 TP_ARGS(name, state, cpu_id),
135 __string( name, name )
136 __field( u64, state )
137 __field( u64, cpu_id )
141 __assign_str(name, name);
142 __entry->state = state;
143 __entry->cpu_id = cpu_id;
146 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
147 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
150 DEFINE_EVENT(power_domain, power_domain_target,
152 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
154 TP_ARGS(name, state, cpu_id)
157 #endif /* _TRACE_POWER_H */
159 /* This part must be outside protection */
160 #include <trace/define_trace.h>