diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 3fb62914678e..59ff0d4e2d81 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -268,3 +268,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_modify_thermal_target_freq); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_new_ref); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_del_ref); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_register); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_unregister); diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6a6a21d6ad23..1e6a6b4195f9 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -32,6 +32,7 @@ #include #include #include +#include static LIST_HEAD(cpufreq_policy_list); @@ -1537,8 +1538,10 @@ static int cpufreq_online(unsigned int cpu) if (cpufreq_driver->ready) cpufreq_driver->ready(policy); - if (cpufreq_thermal_control_enabled(cpufreq_driver)) + if (cpufreq_thermal_control_enabled(cpufreq_driver)) { policy->cdev = of_cpufreq_cooling_register(policy); + trace_android_vh_thermal_register(policy); + } pr_debug("initialization complete\n"); @@ -1623,6 +1626,7 @@ static void __cpufreq_offline(unsigned int cpu, struct cpufreq_policy *policy) if (cpufreq_thermal_control_enabled(cpufreq_driver)) { cpufreq_cooling_unregister(policy->cdev); + trace_android_vh_thermal_unregister(policy); policy->cdev = NULL; } diff --git a/include/trace/hooks/thermal.h b/include/trace/hooks/thermal.h index 8a71ffdc097a..9cb2eb156d24 100644 --- a/include/trace/hooks/thermal.h +++ b/include/trace/hooks/thermal.h @@ -32,6 +32,14 @@ DECLARE_HOOK(android_vh_modify_thermal_target_freq, TP_PROTO(struct cpufreq_policy *policy, unsigned int *target_freq), TP_ARGS(policy, target_freq)); +DECLARE_HOOK(android_vh_thermal_register, + TP_PROTO(struct cpufreq_policy *policy), + TP_ARGS(policy)); + +DECLARE_HOOK(android_vh_thermal_unregister, + TP_PROTO(struct cpufreq_policy *policy), + TP_ARGS(policy)); + #endif /* _TRACE_HOOK_THERMAL_H */ /* This part must be outside protection */ #include