ANDROID: sched: add trace_android_vh_map_util_freq parameter

Add "cpufreq_policy" and "need_freq_update" parameters to the vendor
hook to enable frequency calculation in certain special cases related to
OEM's frequency tuning policy.

Bug: 183674818

Signed-off-by: lijianzhong <lijianzhong@xiaomi.com>
Change-Id: I232d2e1ae885d6736eca9e4709870f4272b4873d
This commit is contained in:
lijianzhong
2021-03-24 16:38:32 +08:00
committed by Carlos Llamas
parent b9bb33b73c
commit e273916482
2 changed files with 6 additions and 3 deletions

View File

@@ -332,10 +332,12 @@ DECLARE_HOOK(android_vh_sched_pelt_multiplier,
TP_PROTO(unsigned int old, unsigned int cur, int *ret),
TP_ARGS(old, cur, ret));
struct cpufreq_policy;
DECLARE_HOOK(android_vh_map_util_freq,
TP_PROTO(unsigned long util, unsigned long freq,
unsigned long cap, unsigned long *next_freq),
TP_ARGS(util, freq, cap, next_freq));
unsigned long cap, unsigned long *next_freq, struct cpufreq_policy *policy,
bool *need_freq_update),
TP_ARGS(util, freq, cap, next_freq, policy, need_freq_update));
/* macro versions of hooks are no longer required */

View File

@@ -148,7 +148,8 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy,
unsigned long next_freq = 0;
util = map_util_perf(util);
trace_android_vh_map_util_freq(util, freq, max, &next_freq);
trace_android_vh_map_util_freq(util, freq, max, &next_freq, policy,
&sg_policy->need_freq_update);
if (next_freq)
freq = next_freq;
else