ANDROID: cpufreq: times: record fast switch frequency transitions

cpufreq_times_record_transition() is not called when fast switch is
enabled, leading /proc/[pid]/time_in_state to attribute all time on a
cluster to a single frequency. To fix this, add a call to
cpufreq_times_record_transition() in the fast switch path.

Test: /proc/[pid]/time_in_state shows times for more than one freq per
cluster

Fixes: Ia6456754f4c ("ANDROID: cpufreq: track per-task time in state")

Bug: 204726690
Signed-off-by: zhengding chen <chenzhengding@oppo.com>
Change-Id: Ief47ffb49fcc7fbf5408eea3056930e8791d2820
(cherry picked from commit 0c053ab6fb902a6e721c36d4ff34419b04ae9548)
This commit is contained in:
zhengding chen
2021-11-03 11:40:01 +08:00
committed by Treehugger Robot
parent 2e139e3055
commit 7c789dabc8
+1
View File
@@ -2196,6 +2196,7 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
arch_set_freq_scale(policy->related_cpus, freq,
arch_scale_freq_ref(policy->cpu));
cpufreq_stats_record_transition(policy, freq);
cpufreq_times_record_transition(policy, freq);
trace_android_rvh_cpufreq_transition(policy);
if (trace_cpu_frequency_enabled()) {