xref: /linux/kernel/entry/syscall-common.c (revision 59e6295fac26b8e85c1ea859cdd89fa1e47519d7)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/audit.h>
4 #include <linux/entry-common.h>
5 
6 #define CREATE_TRACE_POINTS
7 #include <trace/events/syscalls.h>
8 
9 /* Out of line to prevent tracepoint code duplication */
10 
11 void trace_syscall_enter(struct pt_regs *regs)
12 {
13 	trace_sys_enter(regs, syscall_get_nr(current, regs));
14 }
15 
16 void trace_syscall_exit(struct pt_regs *regs, long ret)
17 {
18 	trace_sys_exit(regs, ret);
19 }
20 
21 #ifdef CONFIG_AUDITSYSCALL
22 void syscall_enter_audit(struct pt_regs *regs)
23 {
24 	long syscall = syscall_get_nr(current, regs);
25 	unsigned long args[6];
26 
27 	syscall_get_arguments(current, regs, args);
28 	__audit_syscall_entry(syscall, args[0], args[1], args[2], args[3]);
29 }
30 #endif
31