diff options
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/Kconfig | 6 | ||||
| -rw-r--r-- | kernel/trace/blktrace.c | 1 | ||||
| -rw-r--r-- | kernel/trace/ftrace.c | 9 | ||||
| -rw-r--r-- | kernel/trace/trace.c | 1 | ||||
| -rw-r--r-- | kernel/trace/trace_event_types.h | 3 | ||||
| -rw-r--r-- | kernel/trace/trace_functions.c | 2 | ||||
| -rw-r--r-- | kernel/trace/trace_output.c | 3 | ||||
| -rw-r--r-- | kernel/trace/trace_stack.c | 4 |
8 files changed, 16 insertions, 13 deletions
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 1551f47e7669..019f380fd764 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
| @@ -226,13 +226,13 @@ config BOOT_TRACER | |||
| 226 | the timings of the initcalls and traces key events and the identity | 226 | the timings of the initcalls and traces key events and the identity |
| 227 | of tasks that can cause boot delays, such as context-switches. | 227 | of tasks that can cause boot delays, such as context-switches. |
| 228 | 228 | ||
| 229 | Its aim is to be parsed by the /scripts/bootgraph.pl tool to | 229 | Its aim is to be parsed by the scripts/bootgraph.pl tool to |
| 230 | produce pretty graphics about boot inefficiencies, giving a visual | 230 | produce pretty graphics about boot inefficiencies, giving a visual |
| 231 | representation of the delays during initcalls - but the raw | 231 | representation of the delays during initcalls - but the raw |
| 232 | /debug/tracing/trace text output is readable too. | 232 | /debug/tracing/trace text output is readable too. |
| 233 | 233 | ||
| 234 | You must pass in ftrace=initcall to the kernel command line | 234 | You must pass in initcall_debug and ftrace=initcall to the kernel |
| 235 | to enable this on bootup. | 235 | command line to enable this on bootup. |
| 236 | 236 | ||
| 237 | config TRACE_BRANCH_PROFILING | 237 | config TRACE_BRANCH_PROFILING |
| 238 | bool | 238 | bool |
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 39af8af6fc30..1090b0aed9ba 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
| 23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
| 24 | #include <linux/debugfs.h> | 24 | #include <linux/debugfs.h> |
| 25 | #include <linux/smp_lock.h> | ||
| 25 | #include <linux/time.h> | 26 | #include <linux/time.h> |
| 26 | #include <linux/uaccess.h> | 27 | #include <linux/uaccess.h> |
| 27 | 28 | ||
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index f3716bf04df6..4521c77d1a1a 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -768,7 +768,7 @@ static struct tracer_stat function_stats __initdata = { | |||
| 768 | .stat_show = function_stat_show | 768 | .stat_show = function_stat_show |
| 769 | }; | 769 | }; |
| 770 | 770 | ||
| 771 | static void ftrace_profile_debugfs(struct dentry *d_tracer) | 771 | static __init void ftrace_profile_debugfs(struct dentry *d_tracer) |
| 772 | { | 772 | { |
| 773 | struct ftrace_profile_stat *stat; | 773 | struct ftrace_profile_stat *stat; |
| 774 | struct dentry *entry; | 774 | struct dentry *entry; |
| @@ -786,7 +786,6 @@ static void ftrace_profile_debugfs(struct dentry *d_tracer) | |||
| 786 | * The files created are permanent, if something happens | 786 | * The files created are permanent, if something happens |
| 787 | * we still do not free memory. | 787 | * we still do not free memory. |
| 788 | */ | 788 | */ |
| 789 | kfree(stat); | ||
| 790 | WARN(1, | 789 | WARN(1, |
| 791 | "Could not allocate stat file for cpu %d\n", | 790 | "Could not allocate stat file for cpu %d\n", |
| 792 | cpu); | 791 | cpu); |
| @@ -813,7 +812,7 @@ static void ftrace_profile_debugfs(struct dentry *d_tracer) | |||
| 813 | } | 812 | } |
| 814 | 813 | ||
| 815 | #else /* CONFIG_FUNCTION_PROFILER */ | 814 | #else /* CONFIG_FUNCTION_PROFILER */ |
| 816 | static void ftrace_profile_debugfs(struct dentry *d_tracer) | 815 | static __init void ftrace_profile_debugfs(struct dentry *d_tracer) |
| 817 | { | 816 | { |
| 818 | } | 817 | } |
| 819 | #endif /* CONFIG_FUNCTION_PROFILER */ | 818 | #endif /* CONFIG_FUNCTION_PROFILER */ |
| @@ -3160,10 +3159,10 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, | |||
| 3160 | 3159 | ||
| 3161 | ret = proc_dointvec(table, write, file, buffer, lenp, ppos); | 3160 | ret = proc_dointvec(table, write, file, buffer, lenp, ppos); |
| 3162 | 3161 | ||
| 3163 | if (ret || !write || (last_ftrace_enabled == ftrace_enabled)) | 3162 | if (ret || !write || (last_ftrace_enabled == !!ftrace_enabled)) |
| 3164 | goto out; | 3163 | goto out; |
| 3165 | 3164 | ||
| 3166 | last_ftrace_enabled = ftrace_enabled; | 3165 | last_ftrace_enabled = !!ftrace_enabled; |
| 3167 | 3166 | ||
| 3168 | if (ftrace_enabled) { | 3167 | if (ftrace_enabled) { |
| 3169 | 3168 | ||
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 3aa0a0dfdfa8..8bc8d8afea6a 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/writeback.h> | 17 | #include <linux/writeback.h> |
| 18 | #include <linux/kallsyms.h> | 18 | #include <linux/kallsyms.h> |
| 19 | #include <linux/seq_file.h> | 19 | #include <linux/seq_file.h> |
| 20 | #include <linux/smp_lock.h> | ||
| 20 | #include <linux/notifier.h> | 21 | #include <linux/notifier.h> |
| 21 | #include <linux/irqflags.h> | 22 | #include <linux/irqflags.h> |
| 22 | #include <linux/debugfs.h> | 23 | #include <linux/debugfs.h> |
diff --git a/kernel/trace/trace_event_types.h b/kernel/trace/trace_event_types.h index 5e32e375134d..6db005e12487 100644 --- a/kernel/trace/trace_event_types.h +++ b/kernel/trace/trace_event_types.h | |||
| @@ -26,6 +26,9 @@ TRACE_EVENT_FORMAT(funcgraph_exit, TRACE_GRAPH_RET, | |||
| 26 | ftrace_graph_ret_entry, ignore, | 26 | ftrace_graph_ret_entry, ignore, |
| 27 | TRACE_STRUCT( | 27 | TRACE_STRUCT( |
| 28 | TRACE_FIELD(unsigned long, ret.func, func) | 28 | TRACE_FIELD(unsigned long, ret.func, func) |
| 29 | TRACE_FIELD(unsigned long long, ret.calltime, calltime) | ||
| 30 | TRACE_FIELD(unsigned long long, ret.rettime, rettime) | ||
| 31 | TRACE_FIELD(unsigned long, ret.overrun, overrun) | ||
| 29 | TRACE_FIELD(int, ret.depth, depth) | 32 | TRACE_FIELD(int, ret.depth, depth) |
| 30 | ), | 33 | ), |
| 31 | TP_RAW_FMT("<-- %lx (%d)") | 34 | TP_RAW_FMT("<-- %lx (%d)") |
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index 7402144bff21..75ef000613c3 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c | |||
| @@ -363,7 +363,7 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable) | |||
| 363 | out_reg: | 363 | out_reg: |
| 364 | ret = register_ftrace_function_probe(glob, ops, count); | 364 | ret = register_ftrace_function_probe(glob, ops, count); |
| 365 | 365 | ||
| 366 | return ret; | 366 | return ret < 0 ? ret : 0; |
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | static struct ftrace_func_command ftrace_traceon_cmd = { | 369 | static struct ftrace_func_command ftrace_traceon_cmd = { |
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 7938f3ae93e3..e0c2545622e8 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
| @@ -27,8 +27,7 @@ void trace_print_seq(struct seq_file *m, struct trace_seq *s) | |||
| 27 | { | 27 | { |
| 28 | int len = s->len >= PAGE_SIZE ? PAGE_SIZE - 1 : s->len; | 28 | int len = s->len >= PAGE_SIZE ? PAGE_SIZE - 1 : s->len; |
| 29 | 29 | ||
| 30 | s->buffer[len] = 0; | 30 | seq_write(m, s->buffer, len); |
| 31 | seq_puts(m, s->buffer); | ||
| 32 | 31 | ||
| 33 | trace_seq_init(s); | 32 | trace_seq_init(s); |
| 34 | } | 33 | } |
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index 2d7aebd71dbd..e644af910124 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c | |||
| @@ -326,10 +326,10 @@ stack_trace_sysctl(struct ctl_table *table, int write, | |||
| 326 | ret = proc_dointvec(table, write, file, buffer, lenp, ppos); | 326 | ret = proc_dointvec(table, write, file, buffer, lenp, ppos); |
| 327 | 327 | ||
| 328 | if (ret || !write || | 328 | if (ret || !write || |
| 329 | (last_stack_tracer_enabled == stack_tracer_enabled)) | 329 | (last_stack_tracer_enabled == !!stack_tracer_enabled)) |
| 330 | goto out; | 330 | goto out; |
| 331 | 331 | ||
| 332 | last_stack_tracer_enabled = stack_tracer_enabled; | 332 | last_stack_tracer_enabled = !!stack_tracer_enabled; |
| 333 | 333 | ||
| 334 | if (stack_tracer_enabled) | 334 | if (stack_tracer_enabled) |
| 335 | register_ftrace_function(&trace_ops); | 335 | register_ftrace_function(&trace_ops); |
