Linux 3.12.39
[linux/fpc-iii.git] / include / trace / events / power.h
blobcda100d6762d250616648c6323c3ba2d7aaf6316
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/pm_qos.h>
9 #include <linux/tracepoint.h>
11 DECLARE_EVENT_CLASS(cpu,
13 TP_PROTO(unsigned int state, unsigned int cpu_id),
15 TP_ARGS(state, cpu_id),
17 TP_STRUCT__entry(
18 __field( u32, state )
19 __field( u32, cpu_id )
22 TP_fast_assign(
23 __entry->state = state;
24 __entry->cpu_id = cpu_id;
27 TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state,
28 (unsigned long)__entry->cpu_id)
31 DEFINE_EVENT(cpu, cpu_idle,
33 TP_PROTO(unsigned int state, unsigned int cpu_id),
35 TP_ARGS(state, cpu_id)
38 /* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */
39 #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING
40 #define _PWR_EVENT_AVOID_DOUBLE_DEFINING
42 #define PWR_EVENT_EXIT -1
43 #endif
45 DEFINE_EVENT(cpu, cpu_frequency,
47 TP_PROTO(unsigned int frequency, unsigned int cpu_id),
49 TP_ARGS(frequency, cpu_id)
52 TRACE_EVENT(machine_suspend,
54 TP_PROTO(unsigned int state),
56 TP_ARGS(state),
58 TP_STRUCT__entry(
59 __field( u32, state )
62 TP_fast_assign(
63 __entry->state = state;
66 TP_printk("state=%lu", (unsigned long)__entry->state)
69 TRACE_EVENT(device_pm_report_time,
71 TP_PROTO(struct device *dev, const char *pm_ops, s64 ops_time,
72 char *pm_event_str, int error),
74 TP_ARGS(dev, pm_ops, ops_time, pm_event_str, error),
76 TP_STRUCT__entry(
77 __string(device, dev_name(dev))
78 __string(driver, dev_driver_string(dev))
79 __string(parent, dev->parent ? dev_name(dev->parent) : "none")
80 __string(pm_ops, pm_ops ? pm_ops : "none ")
81 __string(pm_event_str, pm_event_str)
82 __field(s64, ops_time)
83 __field(int, error)
86 TP_fast_assign(
87 const char *tmp = dev->parent ? dev_name(dev->parent) : "none";
88 const char *tmp_i = pm_ops ? pm_ops : "none ";
90 __assign_str(device, dev_name(dev));
91 __assign_str(driver, dev_driver_string(dev));
92 __assign_str(parent, tmp);
93 __assign_str(pm_ops, tmp_i);
94 __assign_str(pm_event_str, pm_event_str);
95 __entry->ops_time = ops_time;
96 __entry->error = error;
99 /* ops_str has an extra space at the end */
100 TP_printk("%s %s parent=%s state=%s ops=%snsecs=%lld err=%d",
101 __get_str(driver), __get_str(device), __get_str(parent),
102 __get_str(pm_event_str), __get_str(pm_ops),
103 __entry->ops_time, __entry->error)
106 DECLARE_EVENT_CLASS(wakeup_source,
108 TP_PROTO(const char *name, unsigned int state),
110 TP_ARGS(name, state),
112 TP_STRUCT__entry(
113 __string( name, name )
114 __field( u64, state )
117 TP_fast_assign(
118 __assign_str(name, name);
119 __entry->state = state;
122 TP_printk("%s state=0x%lx", __get_str(name),
123 (unsigned long)__entry->state)
126 DEFINE_EVENT(wakeup_source, wakeup_source_activate,
128 TP_PROTO(const char *name, unsigned int state),
130 TP_ARGS(name, state)
133 DEFINE_EVENT(wakeup_source, wakeup_source_deactivate,
135 TP_PROTO(const char *name, unsigned int state),
137 TP_ARGS(name, state)
141 * The clock events are used for clock enable/disable and for
142 * clock rate change
144 DECLARE_EVENT_CLASS(clock,
146 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
148 TP_ARGS(name, state, cpu_id),
150 TP_STRUCT__entry(
151 __string( name, name )
152 __field( u64, state )
153 __field( u64, cpu_id )
156 TP_fast_assign(
157 __assign_str(name, name);
158 __entry->state = state;
159 __entry->cpu_id = cpu_id;
162 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
163 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
166 DEFINE_EVENT(clock, clock_enable,
168 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
170 TP_ARGS(name, state, cpu_id)
173 DEFINE_EVENT(clock, clock_disable,
175 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
177 TP_ARGS(name, state, cpu_id)
180 DEFINE_EVENT(clock, clock_set_rate,
182 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
184 TP_ARGS(name, state, cpu_id)
188 * The power domain events are used for power domains transitions
190 DECLARE_EVENT_CLASS(power_domain,
192 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
194 TP_ARGS(name, state, cpu_id),
196 TP_STRUCT__entry(
197 __string( name, name )
198 __field( u64, state )
199 __field( u64, cpu_id )
202 TP_fast_assign(
203 __assign_str(name, name);
204 __entry->state = state;
205 __entry->cpu_id = cpu_id;
208 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
209 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
212 DEFINE_EVENT(power_domain, power_domain_target,
214 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
216 TP_ARGS(name, state, cpu_id)
220 * The pm qos events are used for pm qos update
222 DECLARE_EVENT_CLASS(pm_qos_request,
224 TP_PROTO(int pm_qos_class, s32 value),
226 TP_ARGS(pm_qos_class, value),
228 TP_STRUCT__entry(
229 __field( int, pm_qos_class )
230 __field( s32, value )
233 TP_fast_assign(
234 __entry->pm_qos_class = pm_qos_class;
235 __entry->value = value;
238 TP_printk("pm_qos_class=%s value=%d",
239 __print_symbolic(__entry->pm_qos_class,
240 { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" },
241 { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" },
242 { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }),
243 __entry->value)
246 DEFINE_EVENT(pm_qos_request, pm_qos_add_request,
248 TP_PROTO(int pm_qos_class, s32 value),
250 TP_ARGS(pm_qos_class, value)
253 DEFINE_EVENT(pm_qos_request, pm_qos_update_request,
255 TP_PROTO(int pm_qos_class, s32 value),
257 TP_ARGS(pm_qos_class, value)
260 DEFINE_EVENT(pm_qos_request, pm_qos_remove_request,
262 TP_PROTO(int pm_qos_class, s32 value),
264 TP_ARGS(pm_qos_class, value)
267 TRACE_EVENT(pm_qos_update_request_timeout,
269 TP_PROTO(int pm_qos_class, s32 value, unsigned long timeout_us),
271 TP_ARGS(pm_qos_class, value, timeout_us),
273 TP_STRUCT__entry(
274 __field( int, pm_qos_class )
275 __field( s32, value )
276 __field( unsigned long, timeout_us )
279 TP_fast_assign(
280 __entry->pm_qos_class = pm_qos_class;
281 __entry->value = value;
282 __entry->timeout_us = timeout_us;
285 TP_printk("pm_qos_class=%s value=%d, timeout_us=%ld",
286 __print_symbolic(__entry->pm_qos_class,
287 { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" },
288 { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" },
289 { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }),
290 __entry->value, __entry->timeout_us)
293 DECLARE_EVENT_CLASS(pm_qos_update,
295 TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
297 TP_ARGS(action, prev_value, curr_value),
299 TP_STRUCT__entry(
300 __field( enum pm_qos_req_action, action )
301 __field( int, prev_value )
302 __field( int, curr_value )
305 TP_fast_assign(
306 __entry->action = action;
307 __entry->prev_value = prev_value;
308 __entry->curr_value = curr_value;
311 TP_printk("action=%s prev_value=%d curr_value=%d",
312 __print_symbolic(__entry->action,
313 { PM_QOS_ADD_REQ, "ADD_REQ" },
314 { PM_QOS_UPDATE_REQ, "UPDATE_REQ" },
315 { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }),
316 __entry->prev_value, __entry->curr_value)
319 DEFINE_EVENT(pm_qos_update, pm_qos_update_target,
321 TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
323 TP_ARGS(action, prev_value, curr_value)
326 DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags,
328 TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
330 TP_ARGS(action, prev_value, curr_value),
332 TP_printk("action=%s prev_value=0x%x curr_value=0x%x",
333 __print_symbolic(__entry->action,
334 { PM_QOS_ADD_REQ, "ADD_REQ" },
335 { PM_QOS_UPDATE_REQ, "UPDATE_REQ" },
336 { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }),
337 __entry->prev_value, __entry->curr_value)
340 DECLARE_EVENT_CLASS(dev_pm_qos_request,
342 TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
343 s32 new_value),
345 TP_ARGS(name, type, new_value),
347 TP_STRUCT__entry(
348 __string( name, name )
349 __field( enum dev_pm_qos_req_type, type )
350 __field( s32, new_value )
353 TP_fast_assign(
354 __assign_str(name, name);
355 __entry->type = type;
356 __entry->new_value = new_value;
359 TP_printk("device=%s type=%s new_value=%d",
360 __get_str(name),
361 __print_symbolic(__entry->type,
362 { DEV_PM_QOS_LATENCY, "DEV_PM_QOS_LATENCY" },
363 { DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS" }),
364 __entry->new_value)
367 DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_add_request,
369 TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
370 s32 new_value),
372 TP_ARGS(name, type, new_value)
375 DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_update_request,
377 TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
378 s32 new_value),
380 TP_ARGS(name, type, new_value)
383 DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request,
385 TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
386 s32 new_value),
388 TP_ARGS(name, type, new_value)
390 #endif /* _TRACE_POWER_H */
392 /* This part must be outside protection */
393 #include <trace/define_trace.h>