diff options
Diffstat (limited to 'include/trace/power.h')
-rw-r--r-- | include/trace/power.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/trace/power.h b/include/trace/power.h new file mode 100644 index 000000000000..c7cefbcdaea4 --- /dev/null +++ b/include/trace/power.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef _TRACE_POWER_H | ||
2 | #define _TRACE_POWER_H | ||
3 | |||
4 | #include <linux/ktime.h> | ||
5 | |||
6 | enum { | ||
7 | POWER_NONE = 0, | ||
8 | POWER_CSTATE = 1, | ||
9 | POWER_PSTATE = 2, | ||
10 | }; | ||
11 | |||
12 | struct power_trace { | ||
13 | #ifdef CONFIG_POWER_TRACER | ||
14 | ktime_t stamp; | ||
15 | ktime_t end; | ||
16 | int type; | ||
17 | int state; | ||
18 | #endif | ||
19 | }; | ||
20 | |||
21 | #ifdef CONFIG_POWER_TRACER | ||
22 | extern void trace_power_start(struct power_trace *it, unsigned int type, | ||
23 | unsigned int state); | ||
24 | extern void trace_power_mark(struct power_trace *it, unsigned int type, | ||
25 | unsigned int state); | ||
26 | extern void trace_power_end(struct power_trace *it); | ||
27 | #else | ||
28 | static inline void trace_power_start(struct power_trace *it, unsigned int type, | ||
29 | unsigned int state) { } | ||
30 | static inline void trace_power_mark(struct power_trace *it, unsigned int type, | ||
31 | unsigned int state) { } | ||
32 | static inline void trace_power_end(struct power_trace *it) { } | ||
33 | #endif | ||
34 | |||
35 | #endif /* _TRACE_POWER_H */ | ||