diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 817d788cd866..7c93307bd960 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -22,6 +22,8 @@ #include #include +#include + #ifdef CONFIG_ACPI static bool __init acpi_cpu_is_threaded(int cpu) { @@ -151,6 +153,11 @@ static void amu_scale_freq_tick(void) { u64 prev_core_cnt, prev_const_cnt; u64 core_cnt, const_cnt, scale; + bool use_amu_fie = true; + + trace_android_vh_use_amu_fie(&use_amu_fie); + if(!use_amu_fie) + return; prev_const_cnt = this_cpu_read(arch_const_cycles_prev); prev_core_cnt = this_cpu_read(arch_core_cycles_prev); diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 9a310923f1ed..b42e7f6ee83e 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -326,3 +326,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_swappiness); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_signal_whether_wake); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_check); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_freeze_whether_wake); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_use_amu_fie); diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 2cdade8aa933..148e24b91cf1 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -34,6 +34,12 @@ static DEFINE_PER_CPU(u32, freq_factor) = 1; static bool supports_scale_freq_counters(const struct cpumask *cpus) { + bool use_amu_fie = true; + + trace_android_vh_use_amu_fie(&use_amu_fie); + if (!use_amu_fie) + return false; + return cpumask_subset(cpus, &scale_freq_counters_mask); } diff --git a/include/trace/hooks/topology.h b/include/trace/hooks/topology.h index d2673d4379c1..56a9fd22f8c6 100644 --- a/include/trace/hooks/topology.h +++ b/include/trace/hooks/topology.h @@ -24,6 +24,10 @@ DECLARE_HOOK(android_vh_arch_set_freq_scale, #endif +DECLARE_HOOK(android_vh_use_amu_fie, + TP_PROTO(bool *use_amu_fie), + TP_ARGS(use_amu_fie)); + #endif /* _TRACE_HOOK_TOPOLOGY_H */ /* This part must be outside protection */ #include