]> git.karo-electronics.de Git - linux-beck.git/blobdiff - kernel/trace/ftrace.c
ftrace: add ftrace_kill_atomic
[linux-beck.git] / kernel / trace / ftrace.c
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
  *