From 9b16d612bf4f096520aca2a89654edcf39f4cf2e Mon Sep 17 00:00:00 2001 From: zhengding chen Date: Wed, 3 Nov 2021 11:40:01 +0800 Subject: [PATCH] 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 Bug: 204726690 Signed-off-by: zhengding chen Change-Id: Ief47ffb49fcc7fbf5408eea3056930e8791d2820 (cherry picked from commit 8ff9996c5df3be17d6da10666135a7a96354496e) --- drivers/cpufreq/cpufreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 1e6a6b4195f9..0b0c3bdfdb5b 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2148,6 +2148,7 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy, arch_set_freq_scale(policy->related_cpus, freq, policy->cpuinfo.max_freq); cpufreq_stats_record_transition(policy, freq); + cpufreq_times_record_transition(policy, freq); trace_android_rvh_cpufreq_transition(policy); if (trace_cpu_frequency_enabled()) {