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 /arch | |
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 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/process.c | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index 1d3cddaa40ee..cee5263927c1 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/compiler.h> | 34 | #include <linux/compiler.h> |
35 | #include <linux/dmi.h> | 35 | #include <linux/dmi.h> |
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <trace/events/power.h> | ||
38 | 37 | ||
39 | #include <linux/acpi.h> | 38 | #include <linux/acpi.h> |
40 | #include <linux/io.h> | 39 | #include <linux/io.h> |
@@ -324,8 +323,6 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, | |||
324 | } | 323 | } |
325 | } | 324 | } |
326 | 325 | ||
327 | trace_power_frequency(POWER_PSTATE, data->freq_table[next_state].frequency); | ||
328 | |||
329 | switch (data->cpu_feature) { | 326 | switch (data->cpu_feature) { |
330 | case SYSTEM_INTEL_MSR_CAPABLE: | 327 | case SYSTEM_INTEL_MSR_CAPABLE: |
331 | cmd.type = SYSTEM_INTEL_MSR_CAPABLE; | 328 | cmd.type = SYSTEM_INTEL_MSR_CAPABLE; |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index e7e35219b32f..787572d43d9c 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -371,7 +371,7 @@ static inline int hlt_use_halt(void) | |||
371 | void default_idle(void) | 371 | void default_idle(void) |
372 | { | 372 | { |
373 | if (hlt_use_halt()) { | 373 | if (hlt_use_halt()) { |
374 | trace_power_start(POWER_CSTATE, 1); | 374 | trace_power_start(POWER_CSTATE, 1, smp_processor_id()); |
375 | current_thread_info()->status &= ~TS_POLLING; | 375 | current_thread_info()->status &= ~TS_POLLING; |
376 | /* | 376 | /* |
377 | * TS_POLLING-cleared state must be visible before we | 377 | * TS_POLLING-cleared state must be visible before we |
@@ -441,7 +441,7 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait); | |||
441 | */ | 441 | */ |
442 | void mwait_idle_with_hints(unsigned long ax, unsigned long cx) | 442 | void mwait_idle_with_hints(unsigned long ax, unsigned long cx) |
443 | { | 443 | { |
444 | trace_power_start(POWER_CSTATE, (ax>>4)+1); | 444 | trace_power_start(POWER_CSTATE, (ax>>4)+1, smp_processor_id()); |
445 | if (!need_resched()) { | 445 | if (!need_resched()) { |
446 | if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) | 446 | if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) |
447 | clflush((void *)¤t_thread_info()->flags); | 447 | clflush((void *)¤t_thread_info()->flags); |
@@ -457,7 +457,7 @@ void mwait_idle_with_hints(unsigned long ax, unsigned long cx) | |||
457 | static void mwait_idle(void) | 457 | static void mwait_idle(void) |
458 | { | 458 | { |
459 | if (!need_resched()) { | 459 | if (!need_resched()) { |
460 | trace_power_start(POWER_CSTATE, 1); | 460 | trace_power_start(POWER_CSTATE, 1, smp_processor_id()); |
461 | if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) | 461 | if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) |
462 | clflush((void *)¤t_thread_info()->flags); | 462 | clflush((void *)¤t_thread_info()->flags); |
463 | 463 | ||
@@ -478,7 +478,7 @@ static void mwait_idle(void) | |||
478 | */ | 478 | */ |
479 | static void poll_idle(void) | 479 | static void poll_idle(void) |
480 | { | 480 | { |
481 | trace_power_start(POWER_CSTATE, 0); | 481 | trace_power_start(POWER_CSTATE, 0, smp_processor_id()); |
482 | local_irq_enable(); | 482 | local_irq_enable(); |
483 | while (!need_resched()) | 483 | while (!need_resched()) |
484 | cpu_relax(); | 484 | cpu_relax(); |