tracing: Add trace events for each syscall entry/exit
[deliverable/linux.git] / include / trace / syscall.h
1 #ifndef _TRACE_SYSCALL_H
2 #define _TRACE_SYSCALL_H
3
4 #include <linux/tracepoint.h>
5 #include <linux/unistd.h>
6 #include <linux/ftrace_event.h>
7
8 #include <asm/ptrace.h>
9
10
11 extern void syscall_regfunc(void);
12 extern void syscall_unregfunc(void);
13
14 DECLARE_TRACE_WITH_CALLBACK(syscall_enter,
15 TP_PROTO(struct pt_regs *regs, long id),
16 TP_ARGS(regs, id),
17 syscall_regfunc,
18 syscall_unregfunc
19 );
20
21 DECLARE_TRACE_WITH_CALLBACK(syscall_exit,
22 TP_PROTO(struct pt_regs *regs, long ret),
23 TP_ARGS(regs, ret),
24 syscall_regfunc,
25 syscall_unregfunc
26 );
27
28 /*
29 * A syscall entry in the ftrace syscalls array.
30 *
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 */
36 struct syscall_metadata {
37 const char *name;
38 int nb_args;
39 const char **types;
40 const char **args;
41 };
42
43 #ifdef CONFIG_FTRACE_SYSCALLS
44 extern struct syscall_metadata *syscall_nr_to_meta(int nr);
45 extern int syscall_name_to_nr(char *name);
46 extern struct trace_event event_syscall_enter;
47 extern struct trace_event event_syscall_exit;
48 extern int reg_event_syscall_enter(void *ptr);
49 extern void unreg_event_syscall_enter(void *ptr);
50 extern int reg_event_syscall_exit(void *ptr);
51 extern void unreg_event_syscall_exit(void *ptr);
52 #endif
53
54 #endif /* _TRACE_SYSCALL_H */
This page took 0.033966 seconds and 5 git commands to generate.