1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM raw_syscalls
4 #undef TRACE_INCLUDE_FILE
5 #define TRACE_INCLUDE_FILE syscalls
7 #if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ)
8 #define _TRACE_EVENTS_SYSCALLS_H
10 #include <linux/tracepoint.h>
12 #include <asm/ptrace.h>
13 #include <asm/syscall.h>
16 #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
18 TRACE_EVENT_FN(sys_enter,
20 TP_PROTO(struct pt_regs *regs, long id),
26 __array( unsigned long, args, 6 )
31 syscall_get_arguments(current, regs, 0, 6, __entry->args);
34 TP_printk("NR %ld (%lx, %lx, %lx, %lx, %lx, %lx)",
36 __entry->args[0], __entry->args[1], __entry->args[2],
37 __entry->args[3], __entry->args[4], __entry->args[5]),
39 syscall_regfunc, syscall_unregfunc
42 TRACE_EVENT_FLAGS(sys_enter, TRACE_EVENT_FL_CAP_ANY)
44 TRACE_EVENT_FN(sys_exit,
46 TP_PROTO(struct pt_regs *regs, long ret),
56 __entry->id = syscall_get_nr(current, regs);
60 TP_printk("NR %ld = %ld",
61 __entry->id, __entry->ret),
63 syscall_regfunc, syscall_unregfunc
66 TRACE_EVENT_FLAGS(sys_exit, TRACE_EVENT_FL_CAP_ANY)
68 #endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */
70 #endif /* _TRACE_EVENTS_SYSCALLS_H */
72 /* This part must be outside protection */
73 #include <trace/define_trace.h>