ANDROID: signal: Add vendor hook for memory reaping

Since commit 3bcdb496f4 ("ANDROID: signal: Add vendor hook
for memory reaping"), but *current* does not need.  Add another
hook here to determine killed process need be reaped.
(e.g. get_mm_counter)

Bug: 232062955
Change-Id: Ide13d3a2e8c199b063f41e071a2bf2fd60a91b04
Signed-off-by: liuhailong <liuhailong@oppo.com>
This commit is contained in:
liuhailong
2022-05-10 16:58:17 +08:00
committed by Suren Baghdasaryan
parent 503435dc8c
commit e27ad1d211
3 changed files with 5 additions and 0 deletions

View File

@@ -99,6 +99,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_restore_priority);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_wakeup_ilocked);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_send_sig_info);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_process_killed);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_killed_process);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_init);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_finished);

View File

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

View File

@@ -1420,6 +1420,7 @@ int group_send_sig_info(int sig, struct kernel_siginfo *info,
bool reap = false;
trace_android_vh_process_killed(current, &reap);
trace_android_vh_killed_process(current, p, &reap);
if (reap)
add_to_oom_reaper(p);
}