diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 98894a573693..e68177ff431f 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -36,6 +36,7 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event @@ -157,3 +158,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pick_next_entity); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_wakeup); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rmqueue); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pagecache_get_page); +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 1234dbe95895..0bfe30233afe 100644 --- a/drivers/thermal/thermal_netlink.c +++ b/drivers/thermal/thermal_netlink.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "thermal_core.h" @@ -229,6 +230,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, &enable_thermal_genl); + if (!enable_thermal_genl) + return 0; msg = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); if (!msg) diff --git a/include/trace/hooks/thermal.h b/include/trace/hooks/thermal.h new file mode 100644 index 000000000000..0e47e0af9284 --- /dev/null +++ b/include/trace/hooks/thermal.h @@ -0,0 +1,20 @@ +/* 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 +#include + +DECLARE_HOOK(android_vh_enable_thermal_genl_check, + TP_PROTO(int event, int *enable_thermal_genl), + TP_ARGS(event, enable_thermal_genl)); + +#endif /* _TRACE_HOOK_THERMAL_H */ +/* This part must be outside protection */ +#include +