ANDROID: sched: add restricted hook to override show_cpufinfo_max_freq

Need to update to restricted hook since the module code registering for
this hook needs to take the task lock and walk over the linked
libraries.

Bug: 194431527
Change-Id: I7093b66f95c3b9c473386ade60d8897426ddbb13
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
This commit is contained in:
Shaleen Agrawal 2021-07-22 17:09:23 -07:00 committed by Todd Kjos
parent d54d036966
commit 632bb51100
3 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gic_v3_set_affinity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gic_v3_affinity_init);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_suspend_epoch_val);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_resume_epoch_val);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_max_freq);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_freq_table_limits);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_newidle_balance);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_nohz_balancer_kick);
@ -166,3 +165,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pick_next_entity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_wakeup);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpufreq_transition);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_balance_anon_file_reclaim);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_show_max_freq);

View File

@ -696,7 +696,7 @@ static ssize_t show_cpuinfo_max_freq(struct cpufreq_policy *policy, char *buf)
{
unsigned int max_freq = policy->cpuinfo.max_freq;
trace_android_vh_show_max_freq(policy, &max_freq);
trace_android_rvh_show_max_freq(policy, &max_freq);
return sprintf(buf, "%u\n", max_freq);
}

View File

@ -11,9 +11,9 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
DECLARE_HOOK(android_vh_show_max_freq,
DECLARE_RESTRICTED_HOOK(android_rvh_show_max_freq,
TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq),
TP_ARGS(policy, max_freq));
TP_ARGS(policy, max_freq), 1);
DECLARE_HOOK(android_vh_freq_table_limits,
TP_PROTO(struct cpufreq_policy *policy, unsigned int min_freq,