From 1642b4f813ec418bfb59c11bee26a3390387b5c2 Mon Sep 17 00:00:00 2001 From: Yun Hsiang Date: Mon, 31 Aug 2020 15:13:01 +0800 Subject: [PATCH] ANDROID: sched: add cpumask parameter to cpu capacity vendor hook Different cpu type will have different suppression ration. So we add cpumask parameter to cpu capacity vendor hook. Bug: 167126223 Signed-off-by: Yun Hsiang Change-Id: I983a3aca2195f7c37c43d31fa588c999a825ee49 --- drivers/base/arch_topology.c | 4 ++-- include/trace/hooks/topology.h | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index f6802ee94bbf..0d10ee372515 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -34,7 +34,7 @@ void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, scale = (cur_freq << SCHED_CAPACITY_SHIFT) / max_freq; - trace_android_vh_arch_set_freq_scale(cur_freq, max_freq, &scale); + trace_android_vh_arch_set_freq_scale(cpus, cur_freq, max_freq, &scale); for_each_cpu(i, cpus){ per_cpu(freq_scale, i) = scale; @@ -57,7 +57,7 @@ void arch_set_max_freq_scale(struct cpumask *cpus, scale = (policy_max_freq << SCHED_CAPACITY_SHIFT) / max_freq; - trace_android_vh_arch_set_freq_scale(policy_max_freq, max_freq, &scale); + trace_android_vh_arch_set_freq_scale(cpus, policy_max_freq, max_freq, &scale); for_each_cpu(cpu, cpus) per_cpu(max_freq_scale, cpu) = scale; diff --git a/include/trace/hooks/topology.h b/include/trace/hooks/topology.h index 65ee1962b833..32b44c7e5130 100644 --- a/include/trace/hooks/topology.h +++ b/include/trace/hooks/topology.h @@ -9,16 +9,18 @@ #include #include +#include #if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) DECLARE_HOOK(android_vh_arch_set_freq_scale, - TP_PROTO(unsigned long freq, unsigned long max, unsigned long *scale), - TP_ARGS(freq, max, scale)); + TP_PROTO(struct cpumask *cpus, unsigned long freq, unsigned long max, + unsigned long *scale), + TP_ARGS(cpus, freq, max, scale)); #else -#define trace_android_vh_arch_set_freq_scale(freq, max, scale) +#define trace_android_vh_arch_set_freq_scale(cpus, freq, max, scale) #endif