summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-06-20 06:52:21 +0200
committerFrederic Weisbecker <fweisbec@gmail.com>2009-06-20 06:52:21 +0200
commit9ea1a153a4fb435c22e9988784bb476671286112 (patch)
tree0f13f65f1bb8edae5a2906d22a209ff013e283ec
parentc85a17e22695969aa24a7ffa40cf26d6e6fcfd50 (diff)
tracing/urgent: warn in case of ftrace_start_up inbalance
Prevent from further ftrace_start_up inbalances so that we avoid future nop patching omissions with dynamic ftrace. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--kernel/trace/ftrace.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index bb60732ade0..3718d55fb4c 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1224,6 +1224,13 @@ static void ftrace_shutdown(int command)
return;
ftrace_start_up--;
+ /*
+ * Just warn in case of unbalance, no need to kill ftrace, it's not
+ * critical but the ftrace_call callers may be never nopped again after
+ * further ftrace uses.
+ */
+ WARN_ON_ONCE(ftrace_start_up < 0);
+
if (!ftrace_start_up)
command |= FTRACE_DISABLE_CALLS;