diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2013-01-11 07:43:45 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-25 18:39:12 -0500 |
commit | 43720bd6014327ac454434496cb953edcdb9f8d6 (patch) | |
tree | be134a588abb3164b7c5f9093707e536f9c54a05 | |
parent | ed1ac6e91a3ff7c561008ba57747cd6cbc49385e (diff) |
PM / tracing: remove deprecated power trace API
The text in Documentation said it would be removed in 2.6.41;
the text in the Kconfig said removal in the 3.1 release. Either
way you look at it, we are well past both, so push it off a cliff.
Note that the POWER_CSTATE and the POWER_PSTATE are part of the
legacy tracing API. Remove all tracepoints which use these flags.
As can be seen from context, most already have a trace entry via
trace_cpu_idle anyways.
Also, the cpufreq/cpufreq.c PSTATE one is actually unpaired, as
compared to the CSTATE ones which all have a clear start/stop.
As part of this, the trace_power_frequency also becomes orphaned,
so it too is deleted.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | Documentation/trace/events-power.txt | 27 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/process.c | 6 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 1 | ||||
-rw-r--r-- | drivers/cpuidle/cpuidle.c | 2 | ||||
-rw-r--r-- | include/trace/events/power.h | 92 | ||||
-rw-r--r-- | kernel/trace/Kconfig | 15 | ||||
-rw-r--r-- | kernel/trace/power-traces.c | 3 |
8 files changed, 1 insertions, 147 deletions
diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt index cf794af22855..e1498ff8cf94 100644 --- a/Documentation/trace/events-power.txt +++ b/Documentation/trace/events-power.txt | |||
@@ -17,7 +17,7 @@ Cf. include/trace/events/power.h for the events definitions. | |||
17 | 1. Power state switch events | 17 | 1. Power state switch events |
18 | ============================ | 18 | ============================ |
19 | 19 | ||
20 | 1.1 New trace API | 20 | 1.1 Trace API |
21 | ----------------- | 21 | ----------------- |
22 | 22 | ||
23 | A 'cpu' event class gathers the CPU-related events: cpuidle and | 23 | A 'cpu' event class gathers the CPU-related events: cpuidle and |
@@ -41,31 +41,6 @@ The event which has 'state=4294967295' in the trace is very important to the use | |||
41 | space tools which are using it to detect the end of the current state, and so to | 41 | space tools which are using it to detect the end of the current state, and so to |
42 | correctly draw the states diagrams and to calculate accurate statistics etc. | 42 | correctly draw the states diagrams and to calculate accurate statistics etc. |
43 | 43 | ||
44 | 1.2 DEPRECATED trace API | ||
45 | ------------------------ | ||
46 | |||
47 | A new Kconfig option CONFIG_EVENT_POWER_TRACING_DEPRECATED with the default value of | ||
48 | 'y' has been created. This allows the legacy trace power API to be used conjointly | ||
49 | with the new trace API. | ||
50 | The Kconfig option, the old trace API (in include/trace/events/power.h) and the | ||
51 | old trace points will disappear in a future release (namely 2.6.41). | ||
52 | |||
53 | power_start "type=%lu state=%lu cpu_id=%lu" | ||
54 | power_frequency "type=%lu state=%lu cpu_id=%lu" | ||
55 | power_end "cpu_id=%lu" | ||
56 | |||
57 | The 'type' parameter takes one of those macros: | ||
58 | . POWER_NONE = 0, | ||
59 | . POWER_CSTATE = 1, /* C-State */ | ||
60 | . POWER_PSTATE = 2, /* Frequency change or DVFS */ | ||
61 | |||
62 | The 'state' parameter is set depending on the type: | ||
63 | . Target C-state for type=POWER_CSTATE, | ||
64 | . Target frequency for type=POWER_PSTATE, | ||
65 | |||
66 | power_end is used to indicate the exit of a state, corresponding to the latest | ||
67 | power_start event. | ||
68 | |||
69 | 2. Clocks events | 44 | 2. Clocks events |
70 | ================ | 45 | ================ |
71 | The clock events are used for clock enable/disable and for | 46 | The clock events are used for clock enable/disable and for |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 7be3622cfc85..2d93d8b23835 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -351,12 +351,10 @@ static void omap3_pm_idle(void) | |||
351 | if (omap_irq_pending()) | 351 | if (omap_irq_pending()) |
352 | goto out; | 352 | goto out; |
353 | 353 | ||
354 | trace_power_start(POWER_CSTATE, 1, smp_processor_id()); | ||
355 | trace_cpu_idle(1, smp_processor_id()); | 354 | trace_cpu_idle(1, smp_processor_id()); |
356 | 355 | ||
357 | omap_sram_idle(); | 356 | omap_sram_idle(); |
358 | 357 | ||
359 | trace_power_end(smp_processor_id()); | ||
360 | trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); | 358 | trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); |
361 | 359 | ||
362 | out: | 360 | out: |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 2ed787f15bf0..dcfc1f410dc4 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -375,7 +375,6 @@ void cpu_idle(void) | |||
375 | */ | 375 | */ |
376 | void default_idle(void) | 376 | void default_idle(void) |
377 | { | 377 | { |
378 | trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id()); | ||
379 | trace_cpu_idle_rcuidle(1, smp_processor_id()); | 378 | trace_cpu_idle_rcuidle(1, smp_processor_id()); |
380 | current_thread_info()->status &= ~TS_POLLING; | 379 | current_thread_info()->status &= ~TS_POLLING; |
381 | /* | 380 | /* |
@@ -389,7 +388,6 @@ void default_idle(void) | |||
389 | else | 388 | else |
390 | local_irq_enable(); | 389 | local_irq_enable(); |
391 | current_thread_info()->status |= TS_POLLING; | 390 | current_thread_info()->status |= TS_POLLING; |
392 | trace_power_end_rcuidle(smp_processor_id()); | ||
393 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); | 391 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); |
394 | } | 392 | } |
395 | #ifdef CONFIG_APM_MODULE | 393 | #ifdef CONFIG_APM_MODULE |
@@ -423,7 +421,6 @@ void stop_this_cpu(void *dummy) | |||
423 | static void mwait_idle(void) | 421 | static void mwait_idle(void) |
424 | { | 422 | { |
425 | if (!need_resched()) { | 423 | if (!need_resched()) { |
426 | trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id()); | ||
427 | trace_cpu_idle_rcuidle(1, smp_processor_id()); | 424 | trace_cpu_idle_rcuidle(1, smp_processor_id()); |
428 | if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR)) | 425 | if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR)) |
429 | clflush((void *)¤t_thread_info()->flags); | 426 | clflush((void *)¤t_thread_info()->flags); |
@@ -434,7 +431,6 @@ static void mwait_idle(void) | |||
434 | __sti_mwait(0, 0); | 431 | __sti_mwait(0, 0); |
435 | else | 432 | else |
436 | local_irq_enable(); | 433 | local_irq_enable(); |
437 | trace_power_end_rcuidle(smp_processor_id()); | ||
438 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); | 434 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); |
439 | } else | 435 | } else |
440 | local_irq_enable(); | 436 | local_irq_enable(); |
@@ -447,12 +443,10 @@ static void mwait_idle(void) | |||
447 | */ | 443 | */ |
448 | static void poll_idle(void) | 444 | static void poll_idle(void) |
449 | { | 445 | { |
450 | trace_power_start_rcuidle(POWER_CSTATE, 0, smp_processor_id()); | ||
451 | trace_cpu_idle_rcuidle(0, smp_processor_id()); | 446 | trace_cpu_idle_rcuidle(0, smp_processor_id()); |
452 | local_irq_enable(); | 447 | local_irq_enable(); |
453 | while (!need_resched()) | 448 | while (!need_resched()) |
454 | cpu_relax(); | 449 | cpu_relax(); |
455 | trace_power_end_rcuidle(smp_processor_id()); | ||
456 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); | 450 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); |
457 | } | 451 | } |
458 | 452 | ||
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 1f93dbd72355..99faadf454ec 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -294,7 +294,6 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state) | |||
294 | adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); | 294 | adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); |
295 | pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, | 295 | pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, |
296 | (unsigned long)freqs->cpu); | 296 | (unsigned long)freqs->cpu); |
297 | trace_power_frequency(POWER_PSTATE, freqs->new, freqs->cpu); | ||
298 | trace_cpu_frequency(freqs->new, freqs->cpu); | 297 | trace_cpu_frequency(freqs->new, freqs->cpu); |
299 | srcu_notifier_call_chain(&cpufreq_transition_notifier_list, | 298 | srcu_notifier_call_chain(&cpufreq_transition_notifier_list, |
300 | CPUFREQ_POSTCHANGE, freqs); | 299 | CPUFREQ_POSTCHANGE, freqs); |
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index e1f6860e069c..eba69290e074 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -144,7 +144,6 @@ int cpuidle_idle_call(void) | |||
144 | return 0; | 144 | return 0; |
145 | } | 145 | } |
146 | 146 | ||
147 | trace_power_start_rcuidle(POWER_CSTATE, next_state, dev->cpu); | ||
148 | trace_cpu_idle_rcuidle(next_state, dev->cpu); | 147 | trace_cpu_idle_rcuidle(next_state, dev->cpu); |
149 | 148 | ||
150 | if (cpuidle_state_is_coupled(dev, drv, next_state)) | 149 | if (cpuidle_state_is_coupled(dev, drv, next_state)) |
@@ -153,7 +152,6 @@ int cpuidle_idle_call(void) | |||
153 | else | 152 | else |
154 | entered_state = cpuidle_enter_state(dev, drv, next_state); | 153 | entered_state = cpuidle_enter_state(dev, drv, next_state); |
155 | 154 | ||
156 | trace_power_end_rcuidle(dev->cpu); | ||
157 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); | 155 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); |
158 | 156 | ||
159 | /* give the governor an opportunity to reflect on the outcome */ | 157 | /* give the governor an opportunity to reflect on the outcome */ |
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 0c9783841a30..427acab5d69a 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
@@ -99,98 +99,6 @@ DEFINE_EVENT(wakeup_source, wakeup_source_deactivate, | |||
99 | TP_ARGS(name, state) | 99 | TP_ARGS(name, state) |
100 | ); | 100 | ); |
101 | 101 | ||
102 | #ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED | ||
103 | |||
104 | /* | ||
105 | * The power events are used for cpuidle & suspend (power_start, power_end) | ||
106 | * and for cpufreq (power_frequency) | ||
107 | */ | ||
108 | DECLARE_EVENT_CLASS(power, | ||
109 | |||
110 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), | ||
111 | |||
112 | TP_ARGS(type, state, cpu_id), | ||
113 | |||
114 | TP_STRUCT__entry( | ||
115 | __field( u64, type ) | ||
116 | __field( u64, state ) | ||
117 | __field( u64, cpu_id ) | ||
118 | ), | ||
119 | |||
120 | TP_fast_assign( | ||
121 | __entry->type = type; | ||
122 | __entry->state = state; | ||
123 | __entry->cpu_id = cpu_id; | ||
124 | ), | ||
125 | |||
126 | TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry->type, | ||
127 | (unsigned long)__entry->state, (unsigned long)__entry->cpu_id) | ||
128 | ); | ||
129 | |||
130 | DEFINE_EVENT(power, power_start, | ||
131 | |||
132 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), | ||
133 | |||
134 | TP_ARGS(type, state, cpu_id) | ||
135 | ); | ||
136 | |||
137 | DEFINE_EVENT(power, power_frequency, | ||
138 | |||
139 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), | ||
140 | |||
141 | TP_ARGS(type, state, cpu_id) | ||
142 | ); | ||
143 | |||
144 | TRACE_EVENT(power_end, | ||
145 | |||
146 | TP_PROTO(unsigned int cpu_id), | ||
147 | |||
148 | TP_ARGS(cpu_id), | ||
149 | |||
150 | TP_STRUCT__entry( | ||
151 | __field( u64, cpu_id ) | ||
152 | ), | ||
153 | |||
154 | TP_fast_assign( | ||
155 | __entry->cpu_id = cpu_id; | ||
156 | ), | ||
157 | |||
158 | TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id) | ||
159 | |||
160 | ); | ||
161 | |||
162 | /* Deprecated dummy functions must be protected against multi-declartion */ | ||
163 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
164 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
165 | |||
166 | enum { | ||
167 | POWER_NONE = 0, | ||
168 | POWER_CSTATE = 1, | ||
169 | POWER_PSTATE = 2, | ||
170 | }; | ||
171 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | ||
172 | |||
173 | #else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ | ||
174 | |||
175 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
176 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
177 | enum { | ||
178 | POWER_NONE = 0, | ||
179 | POWER_CSTATE = 1, | ||
180 | POWER_PSTATE = 2, | ||
181 | }; | ||
182 | |||
183 | /* These dummy declaration have to be ripped out when the deprecated | ||
184 | events get removed */ | ||
185 | static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {}; | ||
186 | static inline void trace_power_end(u64 cpuid) {}; | ||
187 | static inline void trace_power_start_rcuidle(u64 type, u64 state, u64 cpuid) {}; | ||
188 | static inline void trace_power_end_rcuidle(u64 cpuid) {}; | ||
189 | static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {}; | ||
190 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | ||
191 | |||
192 | #endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ | ||
193 | |||
194 | /* | 102 | /* |
195 | * The clock events are used for clock enable/disable and for | 103 | * The clock events are used for clock enable/disable and for |
196 | * clock rate change | 104 | * clock rate change |
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 5d89335a485f..ad0a067ad4b3 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
@@ -78,21 +78,6 @@ config EVENT_TRACING | |||
78 | select CONTEXT_SWITCH_TRACER | 78 | select CONTEXT_SWITCH_TRACER |
79 | bool | 79 | bool |
80 | 80 | ||
81 | config EVENT_POWER_TRACING_DEPRECATED | ||
82 | depends on EVENT_TRACING | ||
83 | bool "Deprecated power event trace API, to be removed" | ||
84 | default y | ||
85 | help | ||
86 | Provides old power event types: | ||
87 | C-state/idle accounting events: | ||
88 | power:power_start | ||
89 | power:power_end | ||
90 | and old cpufreq accounting event: | ||
91 | power:power_frequency | ||
92 | This is for userspace compatibility | ||
93 | and will vanish after 5 kernel iterations, | ||
94 | namely 3.1. | ||
95 | |||
96 | config CONTEXT_SWITCH_TRACER | 81 | config CONTEXT_SWITCH_TRACER |
97 | bool | 82 | bool |
98 | 83 | ||
diff --git a/kernel/trace/power-traces.c b/kernel/trace/power-traces.c index f55fcf61b223..1c71382b283d 100644 --- a/kernel/trace/power-traces.c +++ b/kernel/trace/power-traces.c | |||
@@ -13,8 +13,5 @@ | |||
13 | #define CREATE_TRACE_POINTS | 13 | #define CREATE_TRACE_POINTS |
14 | #include <trace/events/power.h> | 14 | #include <trace/events/power.h> |
15 | 15 | ||
16 | #ifdef EVENT_POWER_TRACING_DEPRECATED | ||
17 | EXPORT_TRACEPOINT_SYMBOL_GPL(power_start); | ||
18 | #endif | ||
19 | EXPORT_TRACEPOINT_SYMBOL_GPL(cpu_idle); | 16 | EXPORT_TRACEPOINT_SYMBOL_GPL(cpu_idle); |
20 | 17 | ||