Arjan van de Ven | 6161352 | 2009-09-17 16:11:28 +0200 | [diff] [blame] | 1 | #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 | |
| 10 | #ifndef _TRACE_POWER_ENUM_ |
| 11 | #define _TRACE_POWER_ENUM_ |
| 12 | enum { |
| 13 | POWER_NONE = 0, |
| 14 | POWER_CSTATE = 1, |
| 15 | POWER_PSTATE = 2, |
| 16 | }; |
| 17 | #endif |
| 18 | |
Li Zefan | 7703466 | 2009-11-26 15:05:38 +0800 | [diff] [blame] | 19 | DECLARE_EVENT_CLASS(power, |
Arjan van de Ven | 6161352 | 2009-09-17 16:11:28 +0200 | [diff] [blame] | 20 | |
| 21 | TP_PROTO(unsigned int type, unsigned int state), |
| 22 | |
| 23 | TP_ARGS(type, state), |
| 24 | |
| 25 | TP_STRUCT__entry( |
| 26 | __field( u64, type ) |
| 27 | __field( u64, state ) |
| 28 | ), |
| 29 | |
| 30 | TP_fast_assign( |
| 31 | __entry->type = type; |
| 32 | __entry->state = state; |
| 33 | ), |
| 34 | |
| 35 | TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state) |
| 36 | ); |
| 37 | |
Li Zefan | 7703466 | 2009-11-26 15:05:38 +0800 | [diff] [blame] | 38 | DEFINE_EVENT(power, power_start, |
| 39 | |
| 40 | TP_PROTO(unsigned int type, unsigned int state), |
| 41 | |
| 42 | TP_ARGS(type, state) |
| 43 | ); |
| 44 | |
| 45 | DEFINE_EVENT(power, power_frequency, |
| 46 | |
| 47 | TP_PROTO(unsigned int type, unsigned int state), |
| 48 | |
| 49 | TP_ARGS(type, state) |
| 50 | ); |
| 51 | |
Arjan van de Ven | 6161352 | 2009-09-17 16:11:28 +0200 | [diff] [blame] | 52 | TRACE_EVENT(power_end, |
| 53 | |
| 54 | TP_PROTO(int dummy), |
| 55 | |
| 56 | TP_ARGS(dummy), |
| 57 | |
| 58 | TP_STRUCT__entry( |
| 59 | __field( u64, dummy ) |
| 60 | ), |
| 61 | |
| 62 | TP_fast_assign( |
| 63 | __entry->dummy = 0xffff; |
| 64 | ), |
| 65 | |
| 66 | TP_printk("dummy=%lu", (unsigned long)__entry->dummy) |
| 67 | |
| 68 | ); |
| 69 | |
Arjan van de Ven | 6161352 | 2009-09-17 16:11:28 +0200 | [diff] [blame] | 70 | #endif /* _TRACE_POWER_H */ |
| 71 | |
| 72 | /* This part must be outside protection */ |
| 73 | #include <trace/define_trace.h> |