diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 62b071ac0b2f..b35327eeb020 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -208,3 +209,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_wq_wait_start); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_wq_wait_finish); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_work_wait_start); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_work_wait_finish); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_enable_thermal_genl_check); diff --git a/drivers/thermal/thermal_netlink.c b/drivers/thermal/thermal_netlink.c index f3c58c708969..edeead69bc2f 100644 --- a/drivers/thermal/thermal_netlink.c +++ b/drivers/thermal/thermal_netlink.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "thermal_core.h" @@ -270,6 +271,11 @@ static int thermal_genl_send_event(enum thermal_genl_event event, struct sk_buff *msg; int ret = -EMSGSIZE; void *hdr; + int enable_thermal_genl = 1; + + trace_android_vh_enable_thermal_genl_check(event, p->tz_id, &enable_thermal_genl); + if (!enable_thermal_genl) + return 0; if (!thermal_group_has_listeners(THERMAL_GENL_EVENT_GROUP)) return 0; diff --git a/include/trace/hooks/thermal.h b/include/trace/hooks/thermal.h new file mode 100644 index 000000000000..2f86eab8dac9 --- /dev/null +++ b/include/trace/hooks/thermal.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM thermal + +#define TRACE_INCLUDE_PATH trace/hooks + +#if !defined(_TRACE_HOOK_THERMAL_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_THERMAL_H + +#include + +DECLARE_HOOK(android_vh_enable_thermal_genl_check, + TP_PROTO(int event, int tz_id, int *enable_thermal_genl), + TP_ARGS(event, tz_id, enable_thermal_genl)); + +#endif /* _TRACE_HOOK_THERMAL_H */ +/* This part must be outside protection */ +#include +