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 #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
13 extern void syscall_regfunc(void);
14 extern void syscall_unregfunc(void);
16 DECLARE_TRACE(syscall_enter,
17 TP_PROTO(struct pt_regs *regs, long id),
21 DECLARE_TRACE(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
37 * @enter_event: associated syscall_enter trace event
38 * @exit_event: associated syscall_exit trace event
40 struct syscall_metadata {
48 struct ftrace_event_call *enter_event;
49 struct ftrace_event_call *exit_event;
52 #ifdef CONFIG_FTRACE_SYSCALLS
53 extern struct syscall_metadata *syscall_nr_to_meta(int nr);
54 extern int syscall_name_to_nr(char *name);
55 void set_syscall_enter_id(int num, int id);
56 void set_syscall_exit_id(int num, int id);
57 extern struct trace_event event_syscall_enter;
58 extern struct trace_event event_syscall_exit;
59 extern int reg_event_syscall_enter(void *ptr);
60 extern void unreg_event_syscall_enter(void *ptr);
61 extern int reg_event_syscall_exit(void *ptr);
62 extern void unreg_event_syscall_exit(void *ptr);
63 extern int syscall_enter_format(struct ftrace_event_call *call,
65 extern int syscall_exit_format(struct ftrace_event_call *call,
67 extern int syscall_enter_define_fields(struct ftrace_event_call *call);
68 extern int syscall_exit_define_fields(struct ftrace_event_call *call);
69 enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags);
70 enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags);
72 #ifdef CONFIG_EVENT_PROFILE
73 int reg_prof_syscall_enter(char *name);
74 void unreg_prof_syscall_enter(char *name);
75 int reg_prof_syscall_exit(char *name);
76 void unreg_prof_syscall_exit(char *name);
80 #endif /* _TRACE_SYSCALL_H */