From d4680ffd79558d4fee8a1ab2d4a007d3cbc063aa Mon Sep 17 00:00:00 2001 From: xieliujie Date: Tue, 16 Aug 2022 20:42:57 +0800 Subject: [PATCH] ANDROID: vendor_hooks: Add hooks for ipa Add hooks to support oem's thermal feature. Bug: 242662879 Bug: 250331401 Signed-off-by: xieliujie Change-Id: I4731948e92e9becb2dbd1f13851b7f849dcfd57c (cherry picked from commit a60c2d4f1230be503cec68b9f22cfb2052e11d63) --- drivers/android/vendor_hooks.c | 1 + drivers/thermal/cpufreq_cooling.c | 2 ++ include/trace/hooks/thermal.h | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 71e756da57f8..f6e81e9e1f54 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -454,3 +454,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_user); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_reclaim_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_failure_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmput); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_modify_thermal_cpu_get_power); diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c index af5b957f745b..b08a6c45fce1 100644 --- a/drivers/thermal/cpufreq_cooling.c +++ b/drivers/thermal/cpufreq_cooling.c @@ -246,6 +246,8 @@ static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev, *power = get_dynamic_power(cpufreq_cdev, freq); + trace_android_vh_modify_thermal_cpu_get_power(policy, power); + if (load_cpu) { trace_thermal_power_cpu_get_power(policy->related_cpus, freq, load_cpu, i, *power); diff --git a/include/trace/hooks/thermal.h b/include/trace/hooks/thermal.h index e0193df29f7c..9740472e77cc 100644 --- a/include/trace/hooks/thermal.h +++ b/include/trace/hooks/thermal.h @@ -44,6 +44,10 @@ DECLARE_HOOK(android_vh_disable_thermal_cooling_stats, TP_PROTO(struct thermal_cooling_device *cdev, int *disable_stats), TP_ARGS(cdev, disable_stats)); +DECLARE_HOOK(android_vh_modify_thermal_cpu_get_power, + TP_PROTO(struct cpufreq_policy *policy, u32 *power), + TP_ARGS(policy, power)); + #endif /* _TRACE_HOOK_THERMAL_H */ /* This part must be outside protection */ #include