ANDROID: vendor_hooks: Add hooks for signal

Add hook to boost thread when process killed.

Bug: 237749933
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I7cc6f248397021f3a8271433144a0e582ed27cfa
(cherry picked from commit 709679142d583b0b7338d931fdd43b27b1bbf9e0)
This commit is contained in:
xieliujie
2022-07-01 18:42:13 +08:00
parent a4d5b99e38
commit 226f36eddd
3 changed files with 5 additions and 0 deletions

View File

@@ -297,3 +297,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_early_resume_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_meminfo);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_signal);

View File

@@ -12,6 +12,9 @@ struct task_struct;
DECLARE_HOOK(android_vh_do_send_sig_info,
TP_PROTO(int sig, struct task_struct *killer, struct task_struct *dst),
TP_ARGS(sig, killer, dst));
DECLARE_HOOK(android_vh_exit_signal,
TP_PROTO(struct task_struct *task),
TP_ARGS(task));
#endif /* _TRACE_HOOK_SIGNAL_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@@ -1049,6 +1049,7 @@ static void complete_signal(int sig, struct task_struct *p, enum pid_type type)
signal->group_stop_count = 0;
t = p;
do {
trace_android_vh_exit_signal(t);
task_clear_jobctl_pending(t, JOBCTL_PENDING_MASK);
sigaddset(&t->pending.signal, SIGKILL);
signal_wake_up(t, 1);