blob: 427acab5d69af24899c4daf19b194e4abd67a243 [file] [log] [blame]
Arjan van de Ven61613522009-09-17 16:11:28 +02001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM power
3
4#if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_POWER_H
6
7#include <linux/ktime.h>
8#include <linux/tracepoint.h>
9
Thomas Renninger25e41932011-01-03 17:50:44 +010010DECLARE_EVENT_CLASS(cpu,
11
12 TP_PROTO(unsigned int state, unsigned int cpu_id),
13
14 TP_ARGS(state, cpu_id),
15
16 TP_STRUCT__entry(
17 __field( u32, state )
18 __field( u32, cpu_id )
19 ),
20
21 TP_fast_assign(
22 __entry->state = state;
23 __entry->cpu_id = cpu_id;
24 ),
25
26 TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state,
27 (unsigned long)__entry->cpu_id)
28);
29
30DEFINE_EVENT(cpu, cpu_idle,
31
32 TP_PROTO(unsigned int state, unsigned int cpu_id),
33
34 TP_ARGS(state, cpu_id)
35);
36
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
40
41#define PWR_EVENT_EXIT -1
Arjan van de Ven61613522009-09-17 16:11:28 +020042#endif
43
Thomas Renninger25e41932011-01-03 17:50:44 +010044DEFINE_EVENT(cpu, cpu_frequency,
45
46 TP_PROTO(unsigned int frequency, unsigned int cpu_id),
47
48 TP_ARGS(frequency, cpu_id)
49);
50
51TRACE_EVENT(machine_suspend,
52
53 TP_PROTO(unsigned int state),
54
55 TP_ARGS(state),
56
57 TP_STRUCT__entry(
58 __field( u32, state )
59 ),
60
61 TP_fast_assign(
62 __entry->state = state;
63 ),
64
65 TP_printk("state=%lu", (unsigned long)__entry->state)
66);
67
Arve Hjønnevåg6791e362012-04-29 22:53:02 +020068DECLARE_EVENT_CLASS(wakeup_source,
69
70 TP_PROTO(const char *name, unsigned int state),
71
72 TP_ARGS(name, state),
73
74 TP_STRUCT__entry(
75 __string( name, name )
76 __field( u64, state )
77 ),
78
79 TP_fast_assign(
80 __assign_str(name, name);
81 __entry->state = state;
82 ),
83
84 TP_printk("%s state=0x%lx", __get_str(name),
85 (unsigned long)__entry->state)
86);
87
88DEFINE_EVENT(wakeup_source, wakeup_source_activate,
89
90 TP_PROTO(const char *name, unsigned int state),
91
92 TP_ARGS(name, state)
93);
94
95DEFINE_EVENT(wakeup_source, wakeup_source_deactivate,
96
97 TP_PROTO(const char *name, unsigned int state),
98
99 TP_ARGS(name, state)
100);
101
Jean Pihet74704ac2010-09-07 09:21:32 +0200102/*
103 * The clock events are used for clock enable/disable and for
104 * clock rate change
105 */
106DECLARE_EVENT_CLASS(clock,
107
108 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
109
110 TP_ARGS(name, state, cpu_id),
111
112 TP_STRUCT__entry(
113 __string( name, name )
114 __field( u64, state )
115 __field( u64, cpu_id )
116 ),
117
118 TP_fast_assign(
119 __assign_str(name, name);
120 __entry->state = state;
121 __entry->cpu_id = cpu_id;
122 ),
123
124 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
125 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
126);
127
128DEFINE_EVENT(clock, clock_enable,
129
130 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
131
132 TP_ARGS(name, state, cpu_id)
133);
134
135DEFINE_EVENT(clock, clock_disable,
136
137 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
138
139 TP_ARGS(name, state, cpu_id)
140);
141
142DEFINE_EVENT(clock, clock_set_rate,
143
144 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
145
146 TP_ARGS(name, state, cpu_id)
147);
148
149/*
150 * The power domain events are used for power domains transitions
151 */
152DECLARE_EVENT_CLASS(power_domain,
153
154 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
155
156 TP_ARGS(name, state, cpu_id),
157
158 TP_STRUCT__entry(
159 __string( name, name )
160 __field( u64, state )
161 __field( u64, cpu_id )
162 ),
163
164 TP_fast_assign(
165 __assign_str(name, name);
166 __entry->state = state;
167 __entry->cpu_id = cpu_id;
168),
169
170 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
171 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
172);
173
174DEFINE_EVENT(power_domain, power_domain_target,
175
176 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
177
178 TP_ARGS(name, state, cpu_id)
179);
Arjan van de Ven61613522009-09-17 16:11:28 +0200180#endif /* _TRACE_POWER_H */
181
182/* This part must be outside protection */
183#include <trace/define_trace.h>