ANDROID: topology: Add vendor hook for use_amu_fie
Vendors could decide to use amu fie feature or not, such as if they have some feature that needs amu fie to be disabled. Bug: 261753861 Change-Id: I6b44ee899c58e7d5a8b2db03a30e3ab14b08f101 Signed-off-by: Rick Yiu <rickyiu@google.com>
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
#include <asm/cputype.h>
|
||||
#include <asm/topology.h>
|
||||
|
||||
#include <trace/hooks/topology.h>
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
static bool __init acpi_cpu_is_threaded(int cpu)
|
||||
{
|
||||
@@ -163,6 +165,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);
|
||||
|
||||
@@ -289,3 +289,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_madvise_blk_plug);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_inactive_list_blk_plug);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_lruvec_blk_plug);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_reclaim_pages_plug);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_use_amu_fie);
|
||||
|
||||
@@ -29,6 +29,12 @@ static bool scale_freq_invariant;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@ DECLARE_HOOK(android_vh_update_topology_flags_workfn,
|
||||
TP_PROTO(void *unused),
|
||||
TP_ARGS(unused));
|
||||
|
||||
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 <trace/define_trace.h>
|
||||
|
||||
Reference in New Issue
Block a user