diff options
author | Thomas Renninger <trenn@suse.de> | 2010-07-20 19:59:34 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-07-22 06:08:27 -0400 |
commit | 4c21adf26f8fcf86a755b9b9f55c2e9fd241e1fb (patch) | |
tree | f01c367d4cca879d39fe42704c6a9f047518dfdf /drivers | |
parent | 23c2875725ebb03e58e598754309e198648f608a (diff) |
x86 cpufreq, perf: Make trace_power_frequency cpufreq driver independent
and fix the broken case if a core's frequency depends on others.
trace_power_frequency was only implemented in a rather ungeneric
way in acpi-cpufreq driver's target() function only.
-> Move the call to trace_power_frequency to
cpufreq.c:cpufreq_notify_transition() where CPUFREQ_POSTCHANGE
notifier is triggered.
This will support power frequency tracing by all cpufreq
drivers.
trace_power_frequency did not trace frequency changes correctly
when the userspace governor was used or when CPU cores'
frequency depend on each other.
-> Moving this into the CPUFREQ_POSTCHANGE notifier and pass the cpu
which gets switched automatically fixes this.
Robert Schoene provided some important fixes on top of my
initial quick shot version which are integrated in this patch:
- Forgot some changes in power_end trace (TP_printk/variable names)
- Variable dummy in power_end must now be cpu_id
- Use static 64 bit variable instead of unsigned int for cpu_id
[akpm@linux-foundation.org: build fix]
Signed-off-by: Thomas Renninger <trenn@suse.de>
Cc: davej@codemonkey.org.uk
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Dave Jones <davej@codemonkey.org.uk>
Acked-by: Arjan van de Ven <arjan@infradead.org>
Cc: Robert Schoene <robert.schoene@tu-dresden.de>
Tested-by: Robert Schoene <robert.schoene@tu-dresden.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 3 | ||||
-rw-r--r-- | drivers/cpuidle/cpuidle.c | 2 | ||||
-rwxr-xr-x | drivers/idle/intel_idle.c | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 063b2184caf5..4ed665725cc5 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include <linux/completion.h> | 29 | #include <linux/completion.h> |
30 | #include <linux/mutex.h> | 30 | #include <linux/mutex.h> |
31 | 31 | ||
32 | #include <trace/events/power.h> | ||
33 | |||
32 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, \ | 34 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, \ |
33 | "cpufreq-core", msg) | 35 | "cpufreq-core", msg) |
34 | 36 | ||
@@ -354,6 +356,7 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state) | |||
354 | 356 | ||
355 | case CPUFREQ_POSTCHANGE: | 357 | case CPUFREQ_POSTCHANGE: |
356 | adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); | 358 | adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); |
359 | trace_power_frequency(POWER_PSTATE, freqs->new, freqs->cpu); | ||
357 | srcu_notifier_call_chain(&cpufreq_transition_notifier_list, | 360 | srcu_notifier_call_chain(&cpufreq_transition_notifier_list, |
358 | CPUFREQ_POSTCHANGE, freqs); | 361 | CPUFREQ_POSTCHANGE, freqs); |
359 | if (likely(policy) && likely(policy->cpu == freqs->cpu)) | 362 | if (likely(policy) && likely(policy->cpu == freqs->cpu)) |
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 199488576a05..dbefe15bd582 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -95,7 +95,7 @@ static void cpuidle_idle_call(void) | |||
95 | /* give the governor an opportunity to reflect on the outcome */ | 95 | /* give the governor an opportunity to reflect on the outcome */ |
96 | if (cpuidle_curr_governor->reflect) | 96 | if (cpuidle_curr_governor->reflect) |
97 | cpuidle_curr_governor->reflect(dev); | 97 | cpuidle_curr_governor->reflect(dev); |
98 | trace_power_end(0); | 98 | trace_power_end(smp_processor_id()); |
99 | } | 99 | } |
100 | 100 | ||
101 | /** | 101 | /** |
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 54f0fb4cd5d2..03d202b1ff27 100755 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
@@ -231,7 +231,7 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state) | |||
231 | 231 | ||
232 | stop_critical_timings(); | 232 | stop_critical_timings(); |
233 | #ifndef MODULE | 233 | #ifndef MODULE |
234 | trace_power_start(POWER_CSTATE, (eax >> 4) + 1); | 234 | trace_power_start(POWER_CSTATE, (eax >> 4) + 1, cpu); |
235 | #endif | 235 | #endif |
236 | if (!need_resched()) { | 236 | if (!need_resched()) { |
237 | 237 | ||