diff options
author | Jean Pihet <jean.pihet@newoldbits.com> | 2010-09-07 03:21:32 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-09-17 03:10:43 -0400 |
commit | 74704ac6ea402d50c9543cb28247e6d9f521f7ae (patch) | |
tree | 8b3b9e175d48193b0c30db116164d5cc26f46cba | |
parent | 635c17c2b2b4e5cd34f5dcba19d751b4e58533c2 (diff) |
tracing, perf: Add more power related events
This patch adds new generic events for dynamic power management
tracing:
- clock events class: used for clock enable/disable and for
clock rate change,
- power_domain events class: used for power domains transitions.
The OMAP architecture will be using the new events for PM debugging,
however the new events are made generic enough to be used by all
platforms.
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Acked-by: Thomas Renninger <trenn@suse.de>
Cc: discuss@lesswatts.org
Cc: linux-pm@lists.linux-foundation.org
Cc: Thomas Renninger <trenn@suse.de>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
LKML-Reference: <AANLkTinUmbSUUuxUzc8++pcb9gd1CZFdyTQFrveTBXyV@mail.gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/trace/events/power.h | 90 |
1 files changed, 87 insertions, 3 deletions
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 35a2a6e7bf1e..286784d69b8f 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
@@ -10,12 +10,17 @@ | |||
10 | #ifndef _TRACE_POWER_ENUM_ | 10 | #ifndef _TRACE_POWER_ENUM_ |
11 | #define _TRACE_POWER_ENUM_ | 11 | #define _TRACE_POWER_ENUM_ |
12 | enum { | 12 | enum { |
13 | POWER_NONE = 0, | 13 | POWER_NONE = 0, |
14 | POWER_CSTATE = 1, | 14 | POWER_CSTATE = 1, /* C-State */ |
15 | POWER_PSTATE = 2, | 15 | POWER_PSTATE = 2, /* Fequency change or DVFS */ |
16 | POWER_SSTATE = 3, /* Suspend */ | ||
16 | }; | 17 | }; |
17 | #endif | 18 | #endif |
18 | 19 | ||
20 | /* | ||
21 | * The power events are used for cpuidle & suspend (power_start, power_end) | ||
22 | * and for cpufreq (power_frequency) | ||
23 | */ | ||
19 | DECLARE_EVENT_CLASS(power, | 24 | DECLARE_EVENT_CLASS(power, |
20 | 25 | ||
21 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), | 26 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), |
@@ -70,6 +75,85 @@ TRACE_EVENT(power_end, | |||
70 | 75 | ||
71 | ); | 76 | ); |
72 | 77 | ||
78 | /* | ||
79 | * The clock events are used for clock enable/disable and for | ||
80 | * clock rate change | ||
81 | */ | ||
82 | DECLARE_EVENT_CLASS(clock, | ||
83 | |||
84 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), | ||
85 | |||
86 | TP_ARGS(name, state, cpu_id), | ||
87 | |||
88 | TP_STRUCT__entry( | ||
89 | __string( name, name ) | ||
90 | __field( u64, state ) | ||
91 | __field( u64, cpu_id ) | ||
92 | ), | ||
93 | |||
94 | TP_fast_assign( | ||
95 | __assign_str(name, name); | ||
96 | __entry->state = state; | ||
97 | __entry->cpu_id = cpu_id; | ||
98 | ), | ||
99 | |||
100 | TP_printk("%s state=%lu cpu_id=%lu", __get_str(name), | ||
101 | (unsigned long)__entry->state, (unsigned long)__entry->cpu_id) | ||
102 | ); | ||
103 | |||
104 | DEFINE_EVENT(clock, clock_enable, | ||
105 | |||
106 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), | ||
107 | |||
108 | TP_ARGS(name, state, cpu_id) | ||
109 | ); | ||
110 | |||
111 | DEFINE_EVENT(clock, clock_disable, | ||
112 | |||
113 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), | ||
114 | |||
115 | TP_ARGS(name, state, cpu_id) | ||
116 | ); | ||
117 | |||
118 | DEFINE_EVENT(clock, clock_set_rate, | ||
119 | |||
120 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), | ||
121 | |||
122 | TP_ARGS(name, state, cpu_id) | ||
123 | ); | ||
124 | |||
125 | /* | ||
126 | * The power domain events are used for power domains transitions | ||
127 | */ | ||
128 | DECLARE_EVENT_CLASS(power_domain, | ||
129 | |||
130 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), | ||
131 | |||
132 | TP_ARGS(name, state, cpu_id), | ||
133 | |||
134 | TP_STRUCT__entry( | ||
135 | __string( name, name ) | ||
136 | __field( u64, state ) | ||
137 | __field( u64, cpu_id ) | ||
138 | ), | ||
139 | |||
140 | TP_fast_assign( | ||
141 | __assign_str(name, name); | ||
142 | __entry->state = state; | ||
143 | __entry->cpu_id = cpu_id; | ||
144 | ), | ||
145 | |||
146 | TP_printk("%s state=%lu cpu_id=%lu", __get_str(name), | ||
147 | (unsigned long)__entry->state, (unsigned long)__entry->cpu_id) | ||
148 | ); | ||
149 | |||
150 | DEFINE_EVENT(power_domain, power_domain_target, | ||
151 | |||
152 | TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), | ||
153 | |||
154 | TP_ARGS(name, state, cpu_id) | ||
155 | ); | ||
156 | |||
73 | #endif /* _TRACE_POWER_H */ | 157 | #endif /* _TRACE_POWER_H */ |
74 | 158 | ||
75 | /* This part must be outside protection */ | 159 | /* This part must be outside protection */ |