[CPUFREQ] x86 cpufreq: Make trace_power_frequency cpufreq driver independent
authorThomas Renninger <trenn@suse.de>
Tue, 20 Apr 2010 11:17:36 +0000 (13:17 +0200)
committerDave Jones <davej@redhat.com>
Tue, 3 Aug 2010 17:47:05 +0000 (13:47 -0400)
commit6f4f2723d08534fd4e407e1ef8500b0f4d12c30c
tree3422ba34e7c6bde7e8d4ca1f1f1ed772efc5cc4c
parent6b72e3934b42930fd40fc42fe762d21be413301c
[CPUFREQ] x86 cpufreq: 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

Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: davej@redhat.com
CC: arjan@infradead.org
CC: linux-kernel@vger.kernel.org
CC: robert.schoene@tu-dresden.de
Tested-by: robert.schoene@tu-dresden.de
Signed-off-by: Dave Jones <davej@redhat.com>
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/x86/kernel/process.c
drivers/cpufreq/cpufreq.c
drivers/cpuidle/cpuidle.c
include/trace/events/power.h
tools/perf/builtin-timechart.c