]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ftrace: add ftrace_kill_atomic
authorSteven Rostedt <rostedt@goodmis.org>
Fri, 11 Jul 2008 00:58:15 +0000 (20:58 -0400)
committerIngo Molnar <mingo@elte.hu>
Fri, 11 Jul 2008 13:49:21 +0000 (15:49 +0200)
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>
include/linux/ftrace.h
kernel/trace/ftrace.c

index 3121b95443d97844abccee9215465eefe76b8a28..f368d041e02d1f41ccb36bda3a4c5da59c65df3d 100644 (file)
@@ -89,6 +89,7 @@ void ftrace_enable_daemon(void);
 
 /* totally disable ftrace - can not re-enable after this */
 void ftrace_kill(void);
+void ftrace_kill_atomic(void);
 
 static inline void tracer_disable(void)
 {
index 0f271c45cd02c9ed2b4130f30f7c8a8d40117dfc..1359632668a44ac8d4c5c2527a5373684d34bd4c 100644 (file)
@@ -1601,6 +1601,21 @@ core_initcall(ftrace_dynamic_init);
 # define ftrace_force_shutdown()       do { } while (0)
 #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
  *