ANDROID: vendor_hooks: add a hook to control the delay time of frequency up and down.

balance the power and performance via the different delay time.

Bug: 208722787

Signed-off-by: vincent.wang <vincent.wang@unisoc.com>
Change-Id: I104a090bc697ab9c68007081e6533820364f1351
This commit is contained in:
vincent.wang
2021-12-02 11:50:26 +08:00
committed by Todd Kjos
parent 160ebf93a9
commit cf33d6fae0
3 changed files with 9 additions and 0 deletions

View File

@@ -188,6 +188,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ftrace_format_check);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ftrace_dump_buffer);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_allow_domain_state);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_map_util_freq);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_update_next_freq);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_report_bug);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_em_cpu_energy);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_up);

View File

@@ -236,6 +236,11 @@ DECLARE_HOOK(android_vh_map_util_freq,
bool *need_freq_update),
TP_ARGS(util, freq, cap, next_freq, policy, need_freq_update));
DECLARE_HOOK(android_vh_update_next_freq,
TP_PROTO(struct cpufreq_policy *policy, unsigned int old_next_freq,
unsigned int *new_next_freq, s64 delta_ns),
TP_ARGS(policy, old_next_freq, new_next_freq, delta_ns));
struct em_perf_domain;
DECLARE_HOOK(android_vh_em_cpu_energy,
TP_PROTO(struct em_perf_domain *pd,

View File

@@ -104,6 +104,9 @@ static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time,
unsigned int next_freq)
{
if (!sg_policy->need_freq_update) {
s64 delta_ns = time - sg_policy->last_freq_update_time;
trace_android_vh_update_next_freq(sg_policy->policy, sg_policy->next_freq,
&next_freq, delta_ns);
if (sg_policy->next_freq == next_freq)
return false;
} else {