From 632bb51100f581031f0d61ee312998136e923c77 Mon Sep 17 00:00:00 2001 From: Shaleen Agrawal Date: Thu, 22 Jul 2021 17:09:23 -0700 Subject: [PATCH] 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 --- drivers/android/vendor_hooks.c | 2 +- drivers/cpufreq/cpufreq.c | 2 +- include/trace/hooks/cpufreq.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index cedfa6d537e4..27bbf0cf14e0 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -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); diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 3bf4ed9099c3..d37b1babf387 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -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); } diff --git a/include/trace/hooks/cpufreq.h b/include/trace/hooks/cpufreq.h index 952c9f26e8a9..4f164b7626df 100644 --- a/include/trace/hooks/cpufreq.h +++ b/include/trace/hooks/cpufreq.h @@ -11,9 +11,9 @@ #include #include -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,