diff options
-rw-r--r-- | include/linux/ftrace.h | 2 | ||||
-rw-r--r-- | kernel/trace/trace.c | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index f7ba4ea5e128..13e9cfc09928 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -257,6 +257,7 @@ extern int ftrace_dump_on_oops; | |||
257 | 257 | ||
258 | extern void tracing_start(void); | 258 | extern void tracing_start(void); |
259 | extern void tracing_stop(void); | 259 | extern void tracing_stop(void); |
260 | extern void ftrace_off_permanent(void); | ||
260 | 261 | ||
261 | extern void | 262 | extern void |
262 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); | 263 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); |
@@ -290,6 +291,7 @@ ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0))); | |||
290 | 291 | ||
291 | static inline void tracing_start(void) { } | 292 | static inline void tracing_start(void) { } |
292 | static inline void tracing_stop(void) { } | 293 | static inline void tracing_stop(void) { } |
294 | static inline void ftrace_off_permanent(void) { } | ||
293 | static inline int | 295 | static inline int |
294 | ftrace_printk(const char *fmt, ...) | 296 | ftrace_printk(const char *fmt, ...) |
295 | { | 297 | { |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 4ee6f0375222..0dbfb23ced97 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -661,6 +661,21 @@ static int trace_stop_count; | |||
661 | static DEFINE_SPINLOCK(tracing_start_lock); | 661 | static DEFINE_SPINLOCK(tracing_start_lock); |
662 | 662 | ||
663 | /** | 663 | /** |
664 | * ftrace_off_permanent - disable all ftrace code permanently | ||
665 | * | ||
666 | * This should only be called when a serious anomally has | ||
667 | * been detected. This will turn off the function tracing, | ||
668 | * ring buffers, and other tracing utilites. It takes no | ||
669 | * locks and can be called from any context. | ||
670 | */ | ||
671 | void ftrace_off_permanent(void) | ||
672 | { | ||
673 | tracing_disabled = 1; | ||
674 | ftrace_stop(); | ||
675 | tracing_off_permanent(); | ||
676 | } | ||
677 | |||
678 | /** | ||
664 | * tracing_start - quick start of the tracer | 679 | * tracing_start - quick start of the tracer |
665 | * | 680 | * |
666 | * If tracing is enabled but was stopped by tracing_stop, | 681 | * If tracing is enabled but was stopped by tracing_stop, |