diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index f8b7fa6622fd..09aeef1c58ec 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -275,3 +275,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mem_cgroup_css_offline); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mem_cgroup_css_online); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mem_cgroup_free); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mem_cgroup_alloc); +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 41c8d47805c4..ca1054bdba10 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, p->tz_id, &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 index c8ba5168fb06..df5a5acd3684 100644 --- a/include/trace/hooks/thermal.h +++ b/include/trace/hooks/thermal.h @@ -45,6 +45,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_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