diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index b13367deba9d..0830f821d49b 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -21,6 +21,7 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event @@ -71,3 +72,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_busiest_group); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_map_util_freq); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_em_pd_energy); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_set_task); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_syscall_prctl_finished); diff --git a/include/trace/hooks/sys.h b/include/trace/hooks/sys.h new file mode 100644 index 000000000000..9e5d7a5cb2cf --- /dev/null +++ b/include/trace/hooks/sys.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM sys +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH trace/hooks +#if !defined(_TRACE_HOOK_SYS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_SYS_H +#include +#include + +struct task_struct; +DECLARE_HOOK(android_vh_syscall_prctl_finished, + TP_PROTO(int option, struct task_struct *task), + TP_ARGS(option, task)); +#endif + +#include diff --git a/kernel/sys.c b/kernel/sys.c index 730672cc1942..ccad9fef972d 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -75,6 +75,8 @@ #include "uid16.h" +#include + #ifndef SET_UNALIGN_CTL # define SET_UNALIGN_CTL(a, b) (-EINVAL) #endif @@ -2644,6 +2646,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, error = -EINVAL; break; } + trace_android_vh_syscall_prctl_finished(option, me); return error; }