diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-11-21 12:59:38 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-23 05:45:34 -0500 |
commit | 69bb54ec05f57da7f6fac2cec0820cbc970df20f (patch) | |
tree | cdee5802117c2e78cf18df7fa524c7390d1bdb67 /kernel/trace | |
parent | e58918ab9d4cd375f6d842e6d88cf4d7a55cbfcc (diff) |
ftrace: add ftrace_off_permanent
Impact: add new API to disable all of ftrace on anomalies
It case of a serious anomaly being detected (like something caught by
lockdep) it is a good idea to disable all tracing immediately, without
grabing any locks.
This patch adds ftrace_off_permanent that disables the tracers, function
tracing and ring buffers without a way to enable them again. This should
only be used when something serious has been detected.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace.c | 15 |
1 files changed, 15 insertions, 0 deletions
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, |