You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
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:
committed by
Suren Baghdasaryan
parent
503435dc8c
commit
e27ad1d211
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user