ANDROID: thermal: Add vendor hook for thermal_genl_check

This re-instates the hook available in earlier GKI kernels. See
commit 6ca2ff04a1 ("ANDROID: thermal: Add vendor thermal genl check")

Bug: 344738061
Bug: 344826816
Change-Id: Ie59e0ef871b0210716e994ba838d294ca49f572c
Signed-off-by: Taeju Park <taeju@google.com>
[Updated commit message]
Signed-off-by: Qais Yousef <qyousef@google.com>
This commit is contained in:
Taeju Park 2024-06-19 00:04:51 +00:00 committed by John Stultz
parent aecd80888c
commit 30800b0a33
3 changed files with 11 additions and 0 deletions

View File

@ -422,3 +422,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_use_amu_fie);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_begin); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_end); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_early_resume_begin); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_early_resume_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_enable_thermal_genl_check);

View File

@ -9,6 +9,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <net/genetlink.h> #include <net/genetlink.h>
#include <trace/hooks/thermal.h>
#include <uapi/linux/thermal.h> #include <uapi/linux/thermal.h>
#include "thermal_core.h" #include "thermal_core.h"
@ -274,6 +275,11 @@ static int thermal_genl_send_event(enum thermal_genl_event event,
struct sk_buff *msg; struct sk_buff *msg;
int ret = -EMSGSIZE; int ret = -EMSGSIZE;
void *hdr; 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); msg = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
if (!msg) if (!msg)

View File

@ -9,6 +9,10 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
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));
struct thermal_cooling_device; struct thermal_cooling_device;
DECLARE_HOOK(android_vh_disable_thermal_cooling_stats, DECLARE_HOOK(android_vh_disable_thermal_cooling_stats,
TP_PROTO(struct thermal_cooling_device *cdev, bool *disable_stats), TP_PROTO(struct thermal_cooling_device *cdev, bool *disable_stats),