aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2010-07-20 19:59:34 -0400
committerIngo Molnar <mingo@elte.hu>2010-07-22 06:08:27 -0400
commit4c21adf26f8fcf86a755b9b9f55c2e9fd241e1fb (patch)
treef01c367d4cca879d39fe42704c6a9f047518dfdf /include
parent23c2875725ebb03e58e598754309e198648f608a (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 'include')
-rw-r--r--include/trace/events/power.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index c4efe9b8280d..35a2a6e7bf1e 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -18,52 +18,55 @@ enum {
18 18
19DECLARE_EVENT_CLASS(power, 19DECLARE_EVENT_CLASS(power,
20 20
21 TP_PROTO(unsigned int type, unsigned int state), 21 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
22 22
23 TP_ARGS(type, state), 23 TP_ARGS(type, state, cpu_id),
24 24
25 TP_STRUCT__entry( 25 TP_STRUCT__entry(
26 __field( u64, type ) 26 __field( u64, type )
27 __field( u64, state ) 27 __field( u64, state )
28 __field( u64, cpu_id )
28 ), 29 ),
29 30
30 TP_fast_assign( 31 TP_fast_assign(
31 __entry->type = type; 32 __entry->type = type;
32 __entry->state = state; 33 __entry->state = state;
34 __entry->cpu_id = cpu_id;
33 ), 35 ),
34 36
35 TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state) 37 TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry->type,
38 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
36); 39);
37 40
38DEFINE_EVENT(power, power_start, 41DEFINE_EVENT(power, power_start,
39 42
40 TP_PROTO(unsigned int type, unsigned int state), 43 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
41 44
42 TP_ARGS(type, state) 45 TP_ARGS(type, state, cpu_id)
43); 46);
44 47
45DEFINE_EVENT(power, power_frequency, 48DEFINE_EVENT(power, power_frequency,
46 49
47 TP_PROTO(unsigned int type, unsigned int state), 50 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
48 51
49 TP_ARGS(type, state) 52 TP_ARGS(type, state, cpu_id)
50); 53);
51 54
52TRACE_EVENT(power_end, 55TRACE_EVENT(power_end,
53 56
54 TP_PROTO(int dummy), 57 TP_PROTO(unsigned int cpu_id),
55 58
56 TP_ARGS(dummy), 59 TP_ARGS(cpu_id),
57 60
58 TP_STRUCT__entry( 61 TP_STRUCT__entry(
59 __field( u64, dummy ) 62 __field( u64, cpu_id )
60 ), 63 ),
61 64
62 TP_fast_assign( 65 TP_fast_assign(
63 __entry->dummy = 0xffff; 66 __entry->cpu_id = cpu_id;
64 ), 67 ),
65 68
66 TP_printk("dummy=%lu", (unsigned long)__entry->dummy) 69 TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id)
67 70
68); 71);
69 72