~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to include/trace/events/power.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#include <linux/ktime.h>
8
8
#include <linux/tracepoint.h>
9
9
 
10
 
#ifndef _TRACE_POWER_ENUM_
11
 
#define _TRACE_POWER_ENUM_
 
10
DECLARE_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
 
 
30
DEFINE_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
 
42
#endif
 
43
 
 
44
DEFINE_EVENT(cpu, cpu_frequency,
 
45
 
 
46
        TP_PROTO(unsigned int frequency, unsigned int cpu_id),
 
47
 
 
48
        TP_ARGS(frequency, cpu_id)
 
49
);
 
50
 
 
51
TRACE_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
 
 
68
/* This code will be removed after deprecation time exceeded (2.6.41) */
 
69
#ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED
 
70
 
 
71
/*
 
72
 * The power events are used for cpuidle & suspend (power_start, power_end)
 
73
 *  and for cpufreq (power_frequency)
 
74
 */
 
75
DECLARE_EVENT_CLASS(power,
 
76
 
 
77
        TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
 
78
 
 
79
        TP_ARGS(type, state, cpu_id),
 
80
 
 
81
        TP_STRUCT__entry(
 
82
                __field(        u64,            type            )
 
83
                __field(        u64,            state           )
 
84
                __field(        u64,            cpu_id          )
 
85
        ),
 
86
 
 
87
        TP_fast_assign(
 
88
                __entry->type = type;
 
89
                __entry->state = state;
 
90
                __entry->cpu_id = cpu_id;
 
91
        ),
 
92
 
 
93
        TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry->type,
 
94
                (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
 
95
);
 
96
 
 
97
DEFINE_EVENT(power, power_start,
 
98
 
 
99
        TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
 
100
 
 
101
        TP_ARGS(type, state, cpu_id)
 
102
);
 
103
 
 
104
DEFINE_EVENT(power, power_frequency,
 
105
 
 
106
        TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
 
107
 
 
108
        TP_ARGS(type, state, cpu_id)
 
109
);
 
110
 
 
111
TRACE_EVENT(power_end,
 
112
 
 
113
        TP_PROTO(unsigned int cpu_id),
 
114
 
 
115
        TP_ARGS(cpu_id),
 
116
 
 
117
        TP_STRUCT__entry(
 
118
                __field(        u64,            cpu_id          )
 
119
        ),
 
120
 
 
121
        TP_fast_assign(
 
122
                __entry->cpu_id = cpu_id;
 
123
        ),
 
124
 
 
125
        TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id)
 
126
 
 
127
);
 
128
 
 
129
/* Deprecated dummy functions must be protected against multi-declartion */
 
130
#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
 
131
#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
 
132
 
12
133
enum {
13
134
        POWER_NONE = 0,
14
135
        POWER_CSTATE = 1,
15
136
        POWER_PSTATE = 2,
16
137
};
17
 
#endif
18
 
 
19
 
 
20
 
 
21
 
TRACE_EVENT(power_start,
22
 
 
23
 
        TP_PROTO(unsigned int type, unsigned int state),
24
 
 
25
 
        TP_ARGS(type, state),
26
 
 
27
 
        TP_STRUCT__entry(
28
 
                __field(        u64,            type            )
29
 
                __field(        u64,            state           )
30
 
        ),
31
 
 
32
 
        TP_fast_assign(
33
 
                __entry->type = type;
34
 
                __entry->state = state;
35
 
        ),
36
 
 
37
 
        TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state)
38
 
);
39
 
 
40
 
TRACE_EVENT(power_end,
41
 
 
42
 
        TP_PROTO(int dummy),
43
 
 
44
 
        TP_ARGS(dummy),
45
 
 
46
 
        TP_STRUCT__entry(
47
 
                __field(        u64,            dummy           )
48
 
        ),
49
 
 
50
 
        TP_fast_assign(
51
 
                __entry->dummy = 0xffff;
52
 
        ),
53
 
 
54
 
        TP_printk("dummy=%lu", (unsigned long)__entry->dummy)
55
 
 
56
 
);
57
 
 
58
 
 
59
 
TRACE_EVENT(power_frequency,
60
 
 
61
 
        TP_PROTO(unsigned int type, unsigned int state),
62
 
 
63
 
        TP_ARGS(type, state),
64
 
 
65
 
        TP_STRUCT__entry(
66
 
                __field(        u64,            type            )
67
 
                __field(        u64,            state           )
68
 
        ),
69
 
 
70
 
        TP_fast_assign(
71
 
                __entry->type = type;
72
 
                __entry->state = state;
73
 
        ),
74
 
 
75
 
        TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long) __entry->state)
76
 
);
77
 
 
 
138
#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
 
139
 
 
140
#else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
 
141
 
 
142
#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
 
143
#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
 
144
enum {
 
145
       POWER_NONE = 0,
 
146
       POWER_CSTATE = 1,
 
147
       POWER_PSTATE = 2,
 
148
};
 
149
 
 
150
/* These dummy declaration have to be ripped out when the deprecated
 
151
   events get removed */
 
152
static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {};
 
153
static inline void trace_power_end(u64 cpuid) {};
 
154
static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {};
 
155
#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
 
156
 
 
157
#endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
 
158
 
 
159
/*
 
160
 * The clock events are used for clock enable/disable and for
 
161
 *  clock rate change
 
162
 */
 
163
DECLARE_EVENT_CLASS(clock,
 
164
 
 
165
        TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
 
166
 
 
167
        TP_ARGS(name, state, cpu_id),
 
168
 
 
169
        TP_STRUCT__entry(
 
170
                __string(       name,           name            )
 
171
                __field(        u64,            state           )
 
172
                __field(        u64,            cpu_id          )
 
173
        ),
 
174
 
 
175
        TP_fast_assign(
 
176
                __assign_str(name, name);
 
177
                __entry->state = state;
 
178
                __entry->cpu_id = cpu_id;
 
179
        ),
 
180
 
 
181
        TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
 
182
                (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
 
183
);
 
184
 
 
185
DEFINE_EVENT(clock, clock_enable,
 
186
 
 
187
        TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
 
188
 
 
189
        TP_ARGS(name, state, cpu_id)
 
190
);
 
191
 
 
192
DEFINE_EVENT(clock, clock_disable,
 
193
 
 
194
        TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
 
195
 
 
196
        TP_ARGS(name, state, cpu_id)
 
197
);
 
198
 
 
199
DEFINE_EVENT(clock, clock_set_rate,
 
200
 
 
201
        TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
 
202
 
 
203
        TP_ARGS(name, state, cpu_id)
 
204
);
 
205
 
 
206
/*
 
207
 * The power domain events are used for power domains transitions
 
208
 */
 
209
DECLARE_EVENT_CLASS(power_domain,
 
210
 
 
211
        TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
 
212
 
 
213
        TP_ARGS(name, state, cpu_id),
 
214
 
 
215
        TP_STRUCT__entry(
 
216
                __string(       name,           name            )
 
217
                __field(        u64,            state           )
 
218
                __field(        u64,            cpu_id          )
 
219
        ),
 
220
 
 
221
        TP_fast_assign(
 
222
                __assign_str(name, name);
 
223
                __entry->state = state;
 
224
                __entry->cpu_id = cpu_id;
 
225
),
 
226
 
 
227
        TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
 
228
                (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
 
229
);
 
230
 
 
231
DEFINE_EVENT(power_domain, power_domain_target,
 
232
 
 
233
        TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
 
234
 
 
235
        TP_ARGS(name, state, cpu_id)
 
236
);
78
237
#endif /* _TRACE_POWER_H */
79
238
 
80
239
/* This part must be outside protection */