ANDROID: Add vendor hooks to signal.
Add vendor hook to get signal for vendor-specific tuning. Bug: 184898838 Signed-off-by: Zhuguangqing <zhuguangqing@xiaomi.com> Change-Id: I83a28b0a6eb413976f4c57f2314d008ad792fa0d
This commit is contained in:

committed by
Guangqing Zhu

parent
128b8a7ad2
commit
d623f1ff72
@@ -49,6 +49,7 @@
|
|||||||
#include <trace/hooks/memory.h>
|
#include <trace/hooks/memory.h>
|
||||||
#include <trace/hooks/typec.h>
|
#include <trace/hooks/typec.h>
|
||||||
#include <trace/hooks/gpiolib.h>
|
#include <trace/hooks/gpiolib.h>
|
||||||
|
#include <trace/hooks/signal.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Export tracepoints that act as a bare tracehook (ie: have no trace event
|
* Export tracepoints that act as a bare tracehook (ie: have no trace event
|
||||||
@@ -73,6 +74,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_init);
|
|||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_set_priority);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_set_priority);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_restore_priority);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_restore_priority);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_wakeup_ilocked);
|
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_rwsem_init);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_init);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_finished);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_finished);
|
||||||
|
17
include/trace/hooks/signal.h
Normal file
17
include/trace/hooks/signal.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM signal
|
||||||
|
#undef TRACE_INCLUDE_PATH
|
||||||
|
#define TRACE_INCLUDE_PATH trace/hooks
|
||||||
|
#if !defined(_TRACE_HOOK_SIGNAL_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
|
#define _TRACE_HOOK_SIGNAL_H
|
||||||
|
#include <linux/tracepoint.h>
|
||||||
|
#include <trace/hooks/vendor_hooks.h>
|
||||||
|
|
||||||
|
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));
|
||||||
|
#endif /* _TRACE_HOOK_SIGNAL_H */
|
||||||
|
/* This part must be outside protection */
|
||||||
|
#include <trace/define_trace.h>
|
@@ -57,6 +57,8 @@
|
|||||||
#include <asm/siginfo.h>
|
#include <asm/siginfo.h>
|
||||||
#include <asm/cacheflush.h>
|
#include <asm/cacheflush.h>
|
||||||
|
|
||||||
|
#undef CREATE_TRACE_POINTS
|
||||||
|
#include <trace/hooks/signal.h>
|
||||||
/*
|
/*
|
||||||
* SLAB caches for signal bits.
|
* SLAB caches for signal bits.
|
||||||
*/
|
*/
|
||||||
@@ -1299,7 +1301,7 @@ int do_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p
|
|||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret = -ESRCH;
|
int ret = -ESRCH;
|
||||||
|
trace_android_vh_do_send_sig_info(sig, current, p);
|
||||||
if (lock_task_sighand(p, &flags)) {
|
if (lock_task_sighand(p, &flags)) {
|
||||||
ret = send_signal(sig, info, p, type);
|
ret = send_signal(sig, info, p, type);
|
||||||
unlock_task_sighand(p, &flags);
|
unlock_task_sighand(p, &flags);
|
||||||
|
Reference in New Issue
Block a user