diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-09 13:37:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-09 13:37:46 -0400 |
commit | c2ea122cd7c4a094be71641f3961796398035513 (patch) | |
tree | 7150db3e27a078c8a4183964a882bb15ba9f3f64 | |
parent | 17b2e9bf27d417bc186cc922b4d6d5eaa048f9d8 (diff) | |
parent | 66bb74888eb4bef4ba7c87c931ecb7ecca3a240c (diff) |
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
tracing: consolidate documents
blktrace: pass the right pointer to kfree()
tracing/syscalls: use a dedicated file header
tracing: append a comma to INIT_FTRACE_GRAPH
-rw-r--r-- | Documentation/trace/ftrace.txt (renamed from Documentation/ftrace.txt) | 0 | ||||
-rw-r--r-- | Documentation/trace/kmemtrace.txt (renamed from Documentation/vm/kmemtrace.txt) | 0 | ||||
-rw-r--r-- | Documentation/trace/mmiotrace.txt (renamed from Documentation/tracers/mmiotrace.txt) | 0 | ||||
-rw-r--r-- | Documentation/trace/tracepoints.txt (renamed from Documentation/tracepoints.txt) | 0 | ||||
-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 | 31 | ||||
-rw-r--r-- | include/linux/syscalls.h | 2 | ||||
-rw-r--r-- | include/trace/syscall.h | 35 | ||||
-rw-r--r-- | kernel/trace/blktrace.c | 10 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 2 |
11 files changed, 47 insertions, 38 deletions
diff --git a/Documentation/ftrace.txt b/Documentation/trace/ftrace.txt index fd9a3e693813..fd9a3e693813 100644 --- a/Documentation/ftrace.txt +++ b/Documentation/trace/ftrace.txt | |||
diff --git a/Documentation/vm/kmemtrace.txt b/Documentation/trace/kmemtrace.txt index a956d9b7f943..a956d9b7f943 100644 --- a/Documentation/vm/kmemtrace.txt +++ b/Documentation/trace/kmemtrace.txt | |||
diff --git a/Documentation/tracers/mmiotrace.txt b/Documentation/trace/mmiotrace.txt index 5731c67abc55..5731c67abc55 100644 --- a/Documentation/tracers/mmiotrace.txt +++ b/Documentation/trace/mmiotrace.txt | |||
diff --git a/Documentation/tracepoints.txt b/Documentation/trace/tracepoints.txt index c0e1ceed75a4..c0e1ceed75a4 100644 --- a/Documentation/tracepoints.txt +++ b/Documentation/trace/tracepoints.txt | |||
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 da5405dce347..8a0c2f221e6b 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -357,7 +357,7 @@ struct ftrace_graph_ret { | |||
357 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 357 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
358 | 358 | ||
359 | /* for init task */ | 359 | /* for init task */ |
360 | #define INIT_FTRACE_GRAPH .ret_stack = NULL | 360 | #define INIT_FTRACE_GRAPH .ret_stack = NULL, |
361 | 361 | ||
362 | /* | 362 | /* |
363 | * Stack of return addresses for functions | 363 | * Stack of return addresses for functions |
@@ -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/blktrace.c b/kernel/trace/blktrace.c index b32ff446c3fb..921ef5d1f0ba 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -1377,12 +1377,12 @@ static int blk_trace_str2mask(const char *str) | |||
1377 | { | 1377 | { |
1378 | int i; | 1378 | int i; |
1379 | int mask = 0; | 1379 | int mask = 0; |
1380 | char *s, *token; | 1380 | char *buf, *s, *token; |
1381 | 1381 | ||
1382 | s = kstrdup(str, GFP_KERNEL); | 1382 | buf = kstrdup(str, GFP_KERNEL); |
1383 | if (s == NULL) | 1383 | if (buf == NULL) |
1384 | return -ENOMEM; | 1384 | return -ENOMEM; |
1385 | s = strstrip(s); | 1385 | s = strstrip(buf); |
1386 | 1386 | ||
1387 | while (1) { | 1387 | while (1) { |
1388 | token = strsep(&s, ","); | 1388 | token = strsep(&s, ","); |
@@ -1403,7 +1403,7 @@ static int blk_trace_str2mask(const char *str) | |||
1403 | break; | 1403 | break; |
1404 | } | 1404 | } |
1405 | } | 1405 | } |
1406 | kfree(s); | 1406 | kfree(buf); |
1407 | 1407 | ||
1408 | return mask; | 1408 | return mask; |
1409 | } | 1409 | } |
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" |