diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 3984d252fbfb..a167640073bf 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -40,11 +40,13 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event * associated with them) to allow external modules to probe them. */ +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_arch_set_freq_scale); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_enter); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_exit); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mpam_set); diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index a177ad05fe16..a323aac2ce1a 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -27,6 +27,7 @@ #undef CREATE_TRACE_POINTS #include +#include static DEFINE_PER_CPU(struct scale_freq_data __rcu *, sft_data); static struct cpumask scale_freq_counters_mask; @@ -152,6 +153,8 @@ void topology_set_freq_scale(const struct cpumask *cpus, unsigned long cur_freq, scale = (cur_freq << SCHED_CAPACITY_SHIFT) / max_freq; + trace_android_vh_arch_set_freq_scale(cpus, cur_freq, max_freq, &scale); + for_each_cpu(i, cpus) per_cpu(arch_freq_scale, i) = scale; } diff --git a/include/trace/hooks/topology.h b/include/trace/hooks/topology.h new file mode 100644 index 000000000000..44a1d8edcf58 --- /dev/null +++ b/include/trace/hooks/topology.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM topology + +#define TRACE_INCLUDE_PATH trace/hooks + +#if !defined(_TRACE_HOOK_TOPOLOGY_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_TOPOLOGY_H + +#include + +struct cpumask; + +DECLARE_HOOK(android_vh_arch_set_freq_scale, + TP_PROTO(const struct cpumask *cpus, unsigned long freq, unsigned long max, + unsigned long *scale), + TP_ARGS(cpus, freq, max, scale)); + +#endif /* _TRACE_HOOK_TOPOLOGY_H */ +/* This part must be outside protection */ +#include