ANDROID: sched: add restricted hook to override show_cpufinfo_max_freq

Need restricted hook so that it can sleep.

The old non-restricted versions need to stay in place as a consequence
of KMI freeze.

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 Steve Muckle
parent e30728e4ff
commit f3e3a45d2b
3 changed files with 6 additions and 0 deletions

View File

@@ -370,3 +370,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_usb_dev_resume);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ipv6_gen_linklocal_addr);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sound_usb_support_cpu_suspend);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snd_compr_use_pause_in_drain);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_show_max_freq);

View File

@@ -697,6 +697,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,6 +11,10 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
DECLARE_RESTRICTED_HOOK(android_rvh_show_max_freq,
TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq),
TP_ARGS(policy, max_freq), 1);
DECLARE_HOOK(android_vh_show_max_freq,
TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq),
TP_ARGS(policy, max_freq));