[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-a32c7765e2796395aec49f699bd25c407155e9c5@git.kernel.org>
Date: Fri, 26 Jun 2009 18:51:31 GMT
From: tip-bot for Li Zefan <lizf@...fujitsu.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
fweisbec@...il.com, rostedt@...dmis.org, lizf@...fujitsu.com,
tglx@...utronix.de, mingo@...e.hu
Subject: [tip:tracing/urgent] tracing: Fix stack tracer sysctl handling
Commit-ID: a32c7765e2796395aec49f699bd25c407155e9c5
Gitweb: http://git.kernel.org/tip/a32c7765e2796395aec49f699bd25c407155e9c5
Author: Li Zefan <lizf@...fujitsu.com>
AuthorDate: Fri, 26 Jun 2009 16:55:51 +0800
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 26 Jun 2009 20:48:39 +0200
tracing: Fix stack tracer sysctl handling
This made my machine completely frozen:
# echo 1 > /proc/sys/kernel/stack_tracer_enabled
# echo 2 > /proc/sys/kernel/stack_tracer_enabled
The cause is register_ftrace_function() was called twice.
Also fix ftrace_enabled sysctl, though seems nothing bad happened
as I tested it.
Signed-off-by: Li Zefan <lizf@...fujitsu.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
LKML-Reference: <4A448D17.9010305@...fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/trace/ftrace.c | 4 ++--
kernel/trace/trace_stack.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index f3716bf..bce9e01 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3160,10 +3160,10 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
ret = proc_dointvec(table, write, file, buffer, lenp, ppos);
- if (ret || !write || (last_ftrace_enabled == ftrace_enabled))
+ if (ret || !write || (last_ftrace_enabled == !!ftrace_enabled))
goto out;
- last_ftrace_enabled = ftrace_enabled;
+ last_ftrace_enabled = !!ftrace_enabled;
if (ftrace_enabled) {
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index 2d7aebd..e644af9 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,
ret = proc_dointvec(table, write, file, buffer, lenp, ppos);
if (ret || !write ||
- (last_stack_tracer_enabled == stack_tracer_enabled))
+ (last_stack_tracer_enabled == !!stack_tracer_enabled))
goto out;
- last_stack_tracer_enabled = stack_tracer_enabled;
+ last_stack_tracer_enabled = !!stack_tracer_enabled;
if (stack_tracer_enabled)
register_ftrace_function(&trace_ops);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists