summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-07-11 02:58:15 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-11 15:49:21 +0200
commita2bb6a3d85ef3124cd336403a95abc0540d3fbe2 (patch)
tree3048f355cc3ca814222ba34943c9a8f735e7a5e6 /kernel/trace
parentftrace: use current CPU for function startup (diff)
downloadlinux-a2bb6a3d85ef3124cd336403a95abc0540d3fbe2.tar.xz
linux-a2bb6a3d85ef3124cd336403a95abc0540d3fbe2.zip
ftrace: add ftrace_kill_atomic
It has been suggested that I add a way to disable the function tracer on an oops. This code adds a ftrace_kill_atomic. It is not meant to be used in normal situations. It will disable the ftrace tracer, but will not perform the nice shutdown that requires scheduling. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Cc: Steven Rostedt <srostedt@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/ftrace.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 0f271c45cd02..1359632668a4 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1602,6 +1602,21 @@ core_initcall(ftrace_dynamic_init);
#endif /* CONFIG_DYNAMIC_FTRACE */
/**
+ * ftrace_kill_atomic - kill ftrace from critical sections
+ *
+ * This function should be used by panic code. It stops ftrace
+ * but in a not so nice way. If you need to simply kill ftrace
+ * from a non-atomic section, use ftrace_kill.
+ */
+void ftrace_kill_atomic(void)
+{
+ ftrace_disabled = 1;
+ ftrace_enabled = 0;
+ ftraced_suspend = -1;
+ clear_ftrace_function();
+}
+
+/**
* ftrace_kill - totally shutdown ftrace
*
* This is a safety measure. If something was detected that seems