diff options
author | Todd Poynor | 2012-11-28 19:56:09 -0600 |
---|---|---|
committer | Arve Hjønnevåg | 2013-02-19 19:55:54 -0600 |
commit | b70dc7fe7203d01bccfb3d3b130b0cd1242381f0 (patch) | |
tree | 149e6f21d6d2eaf1132ac62edf0114c3f48a437e | |
parent | 152c9814b5d819e2e06b0b7032c0a9d59013be03 (diff) | |
download | kernel-common-b70dc7fe7203d01bccfb3d3b130b0cd1242381f0.tar.gz kernel-common-b70dc7fe7203d01bccfb3d3b130b0cd1242381f0.tar.xz kernel-common-b70dc7fe7203d01bccfb3d3b130b0cd1242381f0.zip |
cpufreq: interactive: trace actual speed in target speed decisions
Tracing adds actual speed since this is expected to be key to the
choice of target speed.
Change-Id: Iec936102d0010c4e9dfa143c38a9fd0d551189c3
Signed-off-by: Todd Poynor <toddpoynor@google.com>
-rw-r--r-- | drivers/cpufreq/cpufreq_interactive.c | 18 | ||||
-rw-r--r-- | include/trace/events/cpufreq_interactive.h | 36 |
2 files changed, 31 insertions, 23 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index edc1cbda3c2..60d3057d87a 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c | |||
@@ -185,9 +185,9 @@ static void cpufreq_interactive_timer(unsigned long data) | |||
185 | new_freq > hispeed_freq && | 185 | new_freq > hispeed_freq && |
186 | now - pcpu->hispeed_validate_time | 186 | now - pcpu->hispeed_validate_time |
187 | < above_hispeed_delay_val) { | 187 | < above_hispeed_delay_val) { |
188 | trace_cpufreq_interactive_notyet(data, cpu_load, | 188 | trace_cpufreq_interactive_notyet( |
189 | pcpu->target_freq, | 189 | data, cpu_load, pcpu->target_freq, |
190 | new_freq); | 190 | pcpu->policy->cur, new_freq); |
191 | goto rearm; | 191 | goto rearm; |
192 | } | 192 | } |
193 | } | 193 | } |
@@ -214,8 +214,9 @@ static void cpufreq_interactive_timer(unsigned long data) | |||
214 | */ | 214 | */ |
215 | if (new_freq < pcpu->floor_freq) { | 215 | if (new_freq < pcpu->floor_freq) { |
216 | if (now - pcpu->floor_validate_time < min_sample_time) { | 216 | if (now - pcpu->floor_validate_time < min_sample_time) { |
217 | trace_cpufreq_interactive_notyet(data, cpu_load, | 217 | trace_cpufreq_interactive_notyet( |
218 | pcpu->target_freq, new_freq); | 218 | data, cpu_load, pcpu->target_freq, |
219 | pcpu->policy->cur, new_freq); | ||
219 | goto rearm; | 220 | goto rearm; |
220 | } | 221 | } |
221 | } | 222 | } |
@@ -224,13 +225,14 @@ static void cpufreq_interactive_timer(unsigned long data) | |||
224 | pcpu->floor_validate_time = now; | 225 | pcpu->floor_validate_time = now; |
225 | 226 | ||
226 | if (pcpu->target_freq == new_freq) { | 227 | if (pcpu->target_freq == new_freq) { |
227 | trace_cpufreq_interactive_already(data, cpu_load, | 228 | trace_cpufreq_interactive_already( |
228 | pcpu->target_freq, new_freq); | 229 | data, cpu_load, pcpu->target_freq, |
230 | pcpu->policy->cur, new_freq); | ||
229 | goto rearm_if_notmax; | 231 | goto rearm_if_notmax; |
230 | } | 232 | } |
231 | 233 | ||
232 | trace_cpufreq_interactive_target(data, cpu_load, pcpu->target_freq, | 234 | trace_cpufreq_interactive_target(data, cpu_load, pcpu->target_freq, |
233 | new_freq); | 235 | pcpu->policy->cur, new_freq); |
234 | pcpu->target_set_time_in_idle = now_idle; | 236 | pcpu->target_set_time_in_idle = now_idle; |
235 | pcpu->target_set_time = now; | 237 | pcpu->target_set_time = now; |
236 | 238 | ||
diff --git a/include/trace/events/cpufreq_interactive.h b/include/trace/events/cpufreq_interactive.h index ecec7970b87..951e6ca12da 100644 --- a/include/trace/events/cpufreq_interactive.h +++ b/include/trace/events/cpufreq_interactive.h | |||
@@ -36,44 +36,50 @@ DEFINE_EVENT(set, cpufreq_interactive_setspeed, | |||
36 | 36 | ||
37 | DECLARE_EVENT_CLASS(loadeval, | 37 | DECLARE_EVENT_CLASS(loadeval, |
38 | TP_PROTO(unsigned long cpu_id, unsigned long load, | 38 | TP_PROTO(unsigned long cpu_id, unsigned long load, |
39 | unsigned long curfreq, unsigned long targfreq), | 39 | unsigned long curtarg, unsigned long curactual, |
40 | TP_ARGS(cpu_id, load, curfreq, targfreq), | 40 | unsigned long newtarg), |
41 | TP_ARGS(cpu_id, load, curtarg, curactual, newtarg), | ||
41 | 42 | ||
42 | TP_STRUCT__entry( | 43 | TP_STRUCT__entry( |
43 | __field(unsigned long, cpu_id ) | 44 | __field(unsigned long, cpu_id ) |
44 | __field(unsigned long, load ) | 45 | __field(unsigned long, load ) |
45 | __field(unsigned long, curfreq ) | 46 | __field(unsigned long, curtarg ) |
46 | __field(unsigned long, targfreq ) | 47 | __field(unsigned long, curactual ) |
48 | __field(unsigned long, newtarg ) | ||
47 | ), | 49 | ), |
48 | 50 | ||
49 | TP_fast_assign( | 51 | TP_fast_assign( |
50 | __entry->cpu_id = cpu_id; | 52 | __entry->cpu_id = cpu_id; |
51 | __entry->load = load; | 53 | __entry->load = load; |
52 | __entry->curfreq = curfreq; | 54 | __entry->curtarg = curtarg; |
53 | __entry->targfreq = targfreq; | 55 | __entry->curactual = curactual; |
56 | __entry->newtarg = newtarg; | ||
54 | ), | 57 | ), |
55 | 58 | ||
56 | TP_printk("cpu=%lu load=%lu cur=%lu targ=%lu", | 59 | TP_printk("cpu=%lu load=%lu cur=%lu actual=%lu targ=%lu", |
57 | __entry->cpu_id, __entry->load, __entry->curfreq, | 60 | __entry->cpu_id, __entry->load, __entry->curtarg, |
58 | __entry->targfreq) | 61 | __entry->curactual, __entry->newtarg) |
59 | ); | 62 | ); |
60 | 63 | ||
61 | DEFINE_EVENT(loadeval, cpufreq_interactive_target, | 64 | DEFINE_EVENT(loadeval, cpufreq_interactive_target, |
62 | TP_PROTO(unsigned long cpu_id, unsigned long load, | 65 | TP_PROTO(unsigned long cpu_id, unsigned long load, |
63 | unsigned long curfreq, unsigned long targfreq), | 66 | unsigned long curtarg, unsigned long curactual, |
64 | TP_ARGS(cpu_id, load, curfreq, targfreq) | 67 | unsigned long newtarg), |
68 | TP_ARGS(cpu_id, load, curtarg, curactual, newtarg) | ||
65 | ); | 69 | ); |
66 | 70 | ||
67 | DEFINE_EVENT(loadeval, cpufreq_interactive_already, | 71 | DEFINE_EVENT(loadeval, cpufreq_interactive_already, |
68 | TP_PROTO(unsigned long cpu_id, unsigned long load, | 72 | TP_PROTO(unsigned long cpu_id, unsigned long load, |
69 | unsigned long curfreq, unsigned long targfreq), | 73 | unsigned long curtarg, unsigned long curactual, |
70 | TP_ARGS(cpu_id, load, curfreq, targfreq) | 74 | unsigned long newtarg), |
75 | TP_ARGS(cpu_id, load, curtarg, curactual, newtarg) | ||
71 | ); | 76 | ); |
72 | 77 | ||
73 | DEFINE_EVENT(loadeval, cpufreq_interactive_notyet, | 78 | DEFINE_EVENT(loadeval, cpufreq_interactive_notyet, |
74 | TP_PROTO(unsigned long cpu_id, unsigned long load, | 79 | TP_PROTO(unsigned long cpu_id, unsigned long load, |
75 | unsigned long curfreq, unsigned long targfreq), | 80 | unsigned long curtarg, unsigned long curactual, |
76 | TP_ARGS(cpu_id, load, curfreq, targfreq) | 81 | unsigned long newtarg), |
82 | TP_ARGS(cpu_id, load, curtarg, curactual, newtarg) | ||
77 | ); | 83 | ); |
78 | 84 | ||
79 | TRACE_EVENT(cpufreq_interactive_boost, | 85 | TRACE_EVENT(cpufreq_interactive_boost, |