summaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2013-06-14 22:21:43 +0200
committerSteven Rostedt <rostedt@goodmis.org>2013-06-20 05:32:07 +0200
commitde7edd31457b626e54a0b2a7e8ff4d65492f01ad (patch)
treefc98cad3155f6cded6192709c4cb496dd17282db /kernel/sysctl.c
parenttracing: Update documentation on tracepoint glob matching (diff)
downloadlinux-de7edd31457b626e54a0b2a7e8ff4d65492f01ad.tar.xz
linux-de7edd31457b626e54a0b2a7e8ff4d65492f01ad.zip
tracing: Disable tracing on warning
Add a traceoff_on_warning option in both the kernel command line as well as a sysctl option. When set, any WARN*() function that is hit will cause the tracing_on variable to be cleared, which disables writing to the ring buffer. This is useful especially when tracing a bug with function tracing. When a warning is hit, the print caused by the warning can flood the trace with the functions that producing the output for the warning. This can make the resulting trace useless by either hiding where the bug happened, or worse, by overflowing the buffer and losing the trace of the bug totally. Acked-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 9edcf456e0fc..5b0f18c12800 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -600,6 +600,13 @@ static struct ctl_table kern_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec,
},
+ {
+ .procname = "traceoff_on_warning",
+ .data = &__disable_trace_on_warning,
+ .maxlen = sizeof(__disable_trace_on_warning),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
#endif
#ifdef CONFIG_MODULES
{