diff options
-rw-r--r-- | arch/x86/kernel/ftrace.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/ptrace.c | 3 | ||||
-rw-r--r-- | include/linux/ftrace.h | 29 | ||||
-rw-r--r-- | include/linux/syscalls.h | 2 | ||||
-rw-r--r-- | include/trace/syscall.h | 35 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 2 |
6 files changed, 41 insertions, 32 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 70a10ca100f6..18dfa30795c9 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -18,6 +18,8 @@ | |||
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/list.h> | 19 | #include <linux/list.h> |
20 | 20 | ||
21 | #include <trace/syscall.h> | ||
22 | |||
21 | #include <asm/cacheflush.h> | 23 | #include <asm/cacheflush.h> |
22 | #include <asm/ftrace.h> | 24 | #include <asm/ftrace.h> |
23 | #include <asm/nops.h> | 25 | #include <asm/nops.h> |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index fe9345c967de..23b7c8f017e2 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/audit.h> | 21 | #include <linux/audit.h> |
22 | #include <linux/seccomp.h> | 22 | #include <linux/seccomp.h> |
23 | #include <linux/signal.h> | 23 | #include <linux/signal.h> |
24 | #include <linux/ftrace.h> | ||
25 | 24 | ||
26 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
27 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
@@ -35,6 +34,8 @@ | |||
35 | #include <asm/proto.h> | 34 | #include <asm/proto.h> |
36 | #include <asm/ds.h> | 35 | #include <asm/ds.h> |
37 | 36 | ||
37 | #include <trace/syscall.h> | ||
38 | |||
38 | #include "tls.h" | 39 | #include "tls.h" |
39 | 40 | ||
40 | enum x86_regset { | 41 | enum x86_regset { |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index ff112a872d75..8a0c2f221e6b 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -511,33 +511,4 @@ static inline void trace_hw_branch_oops(void) {} | |||
511 | 511 | ||
512 | #endif /* CONFIG_HW_BRANCH_TRACER */ | 512 | #endif /* CONFIG_HW_BRANCH_TRACER */ |
513 | 513 | ||
514 | /* | ||
515 | * A syscall entry in the ftrace syscalls array. | ||
516 | * | ||
517 | * @name: name of the syscall | ||
518 | * @nb_args: number of parameters it takes | ||
519 | * @types: list of types as strings | ||
520 | * @args: list of args as strings (args[i] matches types[i]) | ||
521 | */ | ||
522 | struct syscall_metadata { | ||
523 | const char *name; | ||
524 | int nb_args; | ||
525 | const char **types; | ||
526 | const char **args; | ||
527 | }; | ||
528 | |||
529 | #ifdef CONFIG_FTRACE_SYSCALLS | ||
530 | extern void arch_init_ftrace_syscalls(void); | ||
531 | extern struct syscall_metadata *syscall_nr_to_meta(int nr); | ||
532 | extern void start_ftrace_syscalls(void); | ||
533 | extern void stop_ftrace_syscalls(void); | ||
534 | extern void ftrace_syscall_enter(struct pt_regs *regs); | ||
535 | extern void ftrace_syscall_exit(struct pt_regs *regs); | ||
536 | #else | ||
537 | static inline void start_ftrace_syscalls(void) { } | ||
538 | static inline void stop_ftrace_syscalls(void) { } | ||
539 | static inline void ftrace_syscall_enter(struct pt_regs *regs) { } | ||
540 | static inline void ftrace_syscall_exit(struct pt_regs *regs) { } | ||
541 | #endif | ||
542 | |||
543 | #endif /* _LINUX_FTRACE_H */ | 514 | #endif /* _LINUX_FTRACE_H */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 6470f74074af..dabe4ad89141 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -65,7 +65,7 @@ struct old_linux_dirent; | |||
65 | #include <asm/signal.h> | 65 | #include <asm/signal.h> |
66 | #include <linux/quota.h> | 66 | #include <linux/quota.h> |
67 | #include <linux/key.h> | 67 | #include <linux/key.h> |
68 | #include <linux/ftrace.h> | 68 | #include <trace/syscall.h> |
69 | 69 | ||
70 | #define __SC_DECL1(t1, a1) t1 a1 | 70 | #define __SC_DECL1(t1, a1) t1 a1 |
71 | #define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) | 71 | #define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) |
diff --git a/include/trace/syscall.h b/include/trace/syscall.h new file mode 100644 index 000000000000..8cfe515cbc47 --- /dev/null +++ b/include/trace/syscall.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef _TRACE_SYSCALL_H | ||
2 | #define _TRACE_SYSCALL_H | ||
3 | |||
4 | #include <asm/ptrace.h> | ||
5 | |||
6 | /* | ||
7 | * A syscall entry in the ftrace syscalls array. | ||
8 | * | ||
9 | * @name: name of the syscall | ||
10 | * @nb_args: number of parameters it takes | ||
11 | * @types: list of types as strings | ||
12 | * @args: list of args as strings (args[i] matches types[i]) | ||
13 | */ | ||
14 | struct syscall_metadata { | ||
15 | const char *name; | ||
16 | int nb_args; | ||
17 | const char **types; | ||
18 | const char **args; | ||
19 | }; | ||
20 | |||
21 | #ifdef CONFIG_FTRACE_SYSCALLS | ||
22 | extern void arch_init_ftrace_syscalls(void); | ||
23 | extern struct syscall_metadata *syscall_nr_to_meta(int nr); | ||
24 | extern void start_ftrace_syscalls(void); | ||
25 | extern void stop_ftrace_syscalls(void); | ||
26 | extern void ftrace_syscall_enter(struct pt_regs *regs); | ||
27 | extern void ftrace_syscall_exit(struct pt_regs *regs); | ||
28 | #else | ||
29 | static inline void start_ftrace_syscalls(void) { } | ||
30 | static inline void stop_ftrace_syscalls(void) { } | ||
31 | static inline void ftrace_syscall_enter(struct pt_regs *regs) { } | ||
32 | static inline void ftrace_syscall_exit(struct pt_regs *regs) { } | ||
33 | #endif | ||
34 | |||
35 | #endif /* _TRACE_SYSCALL_H */ | ||
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index a2a3af29c943..5e579645ac86 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -1,5 +1,5 @@ | |||
1 | #include <trace/syscall.h> | ||
1 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
2 | #include <linux/ftrace.h> | ||
3 | #include <asm/syscall.h> | 3 | #include <asm/syscall.h> |
4 | 4 | ||
5 | #include "trace_output.h" | 5 | #include "trace_output.h" |