diff options
Diffstat (limited to 'kernel/entry/syscall-common.c')
| -rw-r--r-- | kernel/entry/syscall-common.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/entry/syscall-common.c b/kernel/entry/syscall-common.c new file mode 100644 index 000000000..b8eac9efb --- /dev/null +++ b/kernel/entry/syscall-common.c @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <linux/audit.h> +#include <linux/entry-common.h> + +#define CREATE_TRACE_POINTS +#include <trace/events/syscalls.h> + +/* Out of line to prevent tracepoint code duplication */ + +void trace_syscall_enter(struct pt_regs *regs) +{ + trace_sys_enter(regs, syscall_get_nr(current, regs)); +} + +void trace_syscall_exit(struct pt_regs *regs, long ret) +{ + trace_sys_exit(regs, ret); +} + +#ifdef CONFIG_AUDITSYSCALL +void syscall_enter_audit(struct pt_regs *regs) +{ + long syscall = syscall_get_nr(current, regs); + unsigned long args[6]; + + syscall_get_arguments(current, regs, args); + __audit_syscall_entry(syscall, args[0], args[1], args[2], args[3]); +} +#endif |
