aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2011-01-03 11:50:44 -0500
committerIngo Molnar <mingo@elte.hu>2011-01-04 02:16:54 -0500
commit25e41933b58777f2d020c3b0186b430ea004ec28 (patch)
treea4ea8bb52509139b52c35d540928c12b33098f40 /include/trace
parent61a0d49c33c7fd57c14895e5b0760bd02b65ac1f (diff)
perf: Clean up power events by introducing new, more generic ones
Add these new power trace events: power:cpu_idle power:cpu_frequency power:machine_suspend The old C-state/idle accounting events: power:power_start power:power_end Have now a replacement (but we are still keeping the old tracepoints for compatibility): power:cpu_idle and power:power_frequency is replaced with: power:cpu_frequency power:machine_suspend is newly introduced. Jean Pihet has a patch integrated into the generic layer (kernel/power/suspend.c) which will make use of it. the type= field got removed from both, it was never used and the type is differed by the event type itself. perf timechart userspace tool gets adjusted in a separate patch. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Acked-by: Arjan van de Ven <arjan@linux.intel.com> Acked-by: Jean Pihet <jean.pihet@newoldbits.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: rjw@sisk.pl LKML-Reference: <1294073445-14812-3-git-send-email-trenn@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> LKML-Reference: <1290072314-31155-2-git-send-email-trenn@suse.de>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/power.h98
1 files changed, 89 insertions, 9 deletions
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 286784d69b8..1bcc2a8c00e 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -7,16 +7,67 @@
7#include <linux/ktime.h> 7#include <linux/ktime.h>
8#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
9 9
10#ifndef _TRACE_POWER_ENUM_ 10DECLARE_EVENT_CLASS(cpu,
11#define _TRACE_POWER_ENUM_ 11
12enum { 12 TP_PROTO(unsigned int state, unsigned int cpu_id),
13 POWER_NONE = 0, 13
14 POWER_CSTATE = 1, /* C-State */ 14 TP_ARGS(state, cpu_id),
15 POWER_PSTATE = 2, /* Fequency change or DVFS */ 15
16 POWER_SSTATE = 3, /* Suspend */ 16 TP_STRUCT__entry(
17}; 17 __field( u32, state )
18 __field( u32, cpu_id )
19 ),
20
21 TP_fast_assign(
22 __entry->state = state;
23 __entry->cpu_id = cpu_id;
24 ),
25
26 TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state,
27 (unsigned long)__entry->cpu_id)
28);
29
30DEFINE_EVENT(cpu, cpu_idle,
31
32 TP_PROTO(unsigned int state, unsigned int cpu_id),
33
34 TP_ARGS(state, cpu_id)
35);
36
37/* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */
38#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING
39#define _PWR_EVENT_AVOID_DOUBLE_DEFINING
40
41#define PWR_EVENT_EXIT -1
18#endif 42#endif
19 43
44DEFINE_EVENT(cpu, cpu_frequency,
45
46 TP_PROTO(unsigned int frequency, unsigned int cpu_id),
47
48 TP_ARGS(frequency, cpu_id)
49);
50
51TRACE_EVENT(machine_suspend,
52
53 TP_PROTO(unsigned int state),
54
55 TP_ARGS(state),
56
57 TP_STRUCT__entry(
58 __field( u32, state )
59 ),
60
61 TP_fast_assign(
62 __entry->state = state;
63 ),
64
65 TP_printk("state=%lu", (unsigned long)__entry->state)
66);
67
68/* This code will be removed after deprecation time exceeded (2.6.41) */
69#ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED
70
20/* 71/*
21 * The power events are used for cpuidle & suspend (power_start, power_end) 72 * The power events are used for cpuidle & suspend (power_start, power_end)
22 * and for cpufreq (power_frequency) 73 * and for cpufreq (power_frequency)
@@ -75,6 +126,36 @@ TRACE_EVENT(power_end,
75 126
76); 127);
77 128
129/* Deprecated dummy functions must be protected against multi-declartion */
130#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
131#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
132
133enum {
134 POWER_NONE = 0,
135 POWER_CSTATE = 1,
136 POWER_PSTATE = 2,
137};
138#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
139
140#else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
141
142#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
143#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
144enum {
145 POWER_NONE = 0,
146 POWER_CSTATE = 1,
147 POWER_PSTATE = 2,
148};
149
150/* These dummy declaration have to be ripped out when the deprecated
151 events get removed */
152static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {};
153static inline void trace_power_end(u64 cpuid) {};
154static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {};
155#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
156
157#endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
158
78/* 159/*
79 * The clock events are used for clock enable/disable and for 160 * The clock events are used for clock enable/disable and for
80 * clock rate change 161 * clock rate change
@@ -153,7 +234,6 @@ DEFINE_EVENT(power_domain, power_domain_target,
153 234
154 TP_ARGS(name, state, cpu_id) 235 TP_ARGS(name, state, cpu_id)
155); 236);
156
157#endif /* _TRACE_POWER_H */ 237#endif /* _TRACE_POWER_H */
158 238
159/* This part must be outside protection */ 239/* This part must be outside protection */