Skip to content

Commit 43720bd

Browse files
Paul Gortmakerrafaeljw
authored andcommitted
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>
1 parent ed1ac6e commit 43720bd

8 files changed

Lines changed: 1 addition & 147 deletions

File tree

‎Documentation/trace/events-power.txt‎

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Cf. include/trace/events/power.h for the events definitions.
1717
1. Power state switch events
1818
============================
1919

20-
1.1 New trace API
20+
1.1 Trace API
2121
-----------------
2222

2323
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
4141
space tools which are using it to detect the end of the current state, and so to
4242
correctly draw the states diagrams and to calculate accurate statistics etc.
4343

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-
6944
2. Clocks events
7045
================
7146
The clock events are used for clock enable/disable and for

‎arch/arm/mach-omap2/pm34xx.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,10 @@ static void omap3_pm_idle(void)
351351
if (omap_irq_pending())
352352
goto out;
353353

354-
trace_power_start(POWER_CSTATE, 1, smp_processor_id());
355354
trace_cpu_idle(1, smp_processor_id());
356355

357356
omap_sram_idle();
358357

359-
trace_power_end(smp_processor_id());
360358
trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
361359

362360
out:

‎arch/x86/kernel/process.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ void cpu_idle(void)
375375
*/
376376
void default_idle(void)
377377
{
378-
trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
379378
trace_cpu_idle_rcuidle(1, smp_processor_id());
380379
current_thread_info()->status &= ~TS_POLLING;
381380
/*
@@ -389,7 +388,6 @@ void default_idle(void)
389388
else
390389
local_irq_enable();
391390
current_thread_info()->status |= TS_POLLING;
392-
trace_power_end_rcuidle(smp_processor_id());
393391
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
394392
}
395393
#ifdef CONFIG_APM_MODULE
@@ -423,7 +421,6 @@ void stop_this_cpu(void *dummy)
423421
static void mwait_idle(void)
424422
{
425423
if (!need_resched()) {
426-
trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
427424
trace_cpu_idle_rcuidle(1, smp_processor_id());
428425
if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR))
429426
clflush((void *)&current_thread_info()->flags);
@@ -434,7 +431,6 @@ static void mwait_idle(void)
434431
__sti_mwait(0, 0);
435432
else
436433
local_irq_enable();
437-
trace_power_end_rcuidle(smp_processor_id());
438434
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
439435
} else
440436
local_irq_enable();
@@ -447,12 +443,10 @@ static void mwait_idle(void)
447443
*/
448444
static void poll_idle(void)
449445
{
450-
trace_power_start_rcuidle(POWER_CSTATE, 0, smp_processor_id());
451446
trace_cpu_idle_rcuidle(0, smp_processor_id());
452447
local_irq_enable();
453448
while (!need_resched())
454449
cpu_relax();
455-
trace_power_end_rcuidle(smp_processor_id());
456450
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
457451
}
458452

‎drivers/cpufreq/cpufreq.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
294294
adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
295295
pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new,
296296
(unsigned long)freqs->cpu);
297-
trace_power_frequency(POWER_PSTATE, freqs->new, freqs->cpu);
298297
trace_cpu_frequency(freqs->new, freqs->cpu);
299298
srcu_notifier_call_chain(&cpufreq_transition_notifier_list,
300299
CPUFREQ_POSTCHANGE, freqs);

‎drivers/cpuidle/cpuidle.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ int cpuidle_idle_call(void)
144144
return 0;
145145
}
146146

147-
trace_power_start_rcuidle(POWER_CSTATE, next_state, dev->cpu);
148147
trace_cpu_idle_rcuidle(next_state, dev->cpu);
149148

150149
if (cpuidle_state_is_coupled(dev, drv, next_state))
@@ -153,7 +152,6 @@ int cpuidle_idle_call(void)
153152
else
154153
entered_state = cpuidle_enter_state(dev, drv, next_state);
155154

156-
trace_power_end_rcuidle(dev->cpu);
157155
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
158156

159157
/* give the governor an opportunity to reflect on the outcome */

‎include/trace/events/power.h‎

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -99,98 +99,6 @@ DEFINE_EVENT(wakeup_source, wakeup_source_deactivate,
9999
TP_ARGS(name, state)
100100
);
101101

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-
194102
/*
195103
* The clock events are used for clock enable/disable and for
196104
* clock rate change

‎kernel/trace/Kconfig‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,6 @@ config EVENT_TRACING
7878
select CONTEXT_SWITCH_TRACER
7979
bool
8080

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-
9681
config CONTEXT_SWITCH_TRACER
9782
bool
9883

‎kernel/trace/power-traces.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@
1313
#define CREATE_TRACE_POINTS
1414
#include <trace/events/power.h>
1515

16-
#ifdef EVENT_POWER_TRACING_DEPRECATED
17-
EXPORT_TRACEPOINT_SYMBOL_GPL(power_start);
18-
#endif
1916
EXPORT_TRACEPOINT_SYMBOL_GPL(cpu_idle);
2017

0 commit comments

Comments
 (0)