summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_stack.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-12-17 09:43:00 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-18 12:56:56 +0100
commite05a43b744fb9518cbf8539a7ef33164ac60a70f (patch)
treece45f7e86fe15b3b021cf416caa85bcf4dd38001 /kernel/trace/trace_stack.c
parentf38f1d2aa5a3520cf05da7cd6bd12fe2b0c509b7 (diff)
downloadblackbird-op-linux-e05a43b744fb9518cbf8539a7ef33164ac60a70f.tar.gz
blackbird-op-linux-e05a43b744fb9518cbf8539a7ef33164ac60a70f.zip
trace: better use of stack_trace_enabled for boot up code
Impact: clean up Andrew Morton suggested to use the stack_tracer_enabled variable to decide whether or not to start stack tracing on bootup. This lets us remove the start_stack_trace variable. Reported-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_stack.c')
-rw-r--r--kernel/trace/trace_stack.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index 4842c969c785..d0871bc0aca5 100644
--- a/kernel/trace/trace_stack.c
+++ b/kernel/trace/trace_stack.c
@@ -308,7 +308,7 @@ stack_trace_sysctl(struct ctl_table *table, int write,
mutex_lock(&stack_sysctl_mutex);
- ret = proc_dointvec(table, write, file, buffer, lenp, ppos);
+ ret = proc_dointvec(table, write, file, buffer, lenp, ppos);
if (ret || !write ||
(last_stack_tracer_enabled == stack_tracer_enabled))
@@ -326,11 +326,10 @@ stack_trace_sysctl(struct ctl_table *table, int write,
return ret;
}
-static int start_stack_trace __initdata;
-
static __init int enable_stacktrace(char *str)
{
- start_stack_trace = 1;
+ stack_tracer_enabled = 1;
+ last_stack_tracer_enabled = 1;
return 1;
}
__setup("stacktrace", enable_stacktrace);
@@ -352,10 +351,8 @@ static __init int stack_trace_init(void)
if (!entry)
pr_warning("Could not create debugfs 'stack_trace' entry\n");
- if (start_stack_trace) {
+ if (stack_tracer_enabled)
register_ftrace_function(&trace_ops);
- stack_tracer_enabled = 1;
- }
return 0;
}
OpenPOWER on IntegriCloud