1 #ifndef _TRACE_SYSCALL_H
2 #define _TRACE_SYSCALL_H
4 #include <linux/tracepoint.h>
5 #include <linux/unistd.h>
6 #include <linux/ftrace_event.h>
8 #include <asm/ptrace.h>
11 extern void syscall_regfunc(void);
12 extern void syscall_unregfunc(void);
14 DECLARE_TRACE_WITH_CALLBACK(syscall_enter
,
15 TP_PROTO(struct pt_regs
*regs
, long id
),
21 DECLARE_TRACE_WITH_CALLBACK(syscall_exit
,
22 TP_PROTO(struct pt_regs
*regs
, long ret
),
29 * A syscall entry in the ftrace syscalls array.
31 * @name: name of the syscall
32 * @nb_args: number of parameters it takes
33 * @types: list of types as strings
34 * @args: list of args as strings (args[i] matches types[i])
35 * @enter_id: associated ftrace enter event id
36 * @exit_id: associated ftrace exit event id
38 struct syscall_metadata
{
47 #ifdef CONFIG_FTRACE_SYSCALLS
48 extern struct syscall_metadata
*syscall_nr_to_meta(int nr
);
49 extern int syscall_name_to_nr(char *name
);
50 void set_syscall_enter_id(int num
, int id
);
51 void set_syscall_exit_id(int num
, int id
);
52 extern struct trace_event event_syscall_enter
;
53 extern struct trace_event event_syscall_exit
;
54 extern int reg_event_syscall_enter(void *ptr
);
55 extern void unreg_event_syscall_enter(void *ptr
);
56 extern int reg_event_syscall_exit(void *ptr
);
57 extern void unreg_event_syscall_exit(void *ptr
);
58 enum print_line_t
print_syscall_enter(struct trace_iterator
*iter
, int flags
);
59 enum print_line_t
print_syscall_exit(struct trace_iterator
*iter
, int flags
);
62 #endif /* _TRACE_SYSCALL_H */