* [PATCH] ftrace,bug: Improve traceoff_on_warn
@ 2020-05-28 14:52 Peter Zijlstra
0 siblings, 0 replies; only message in thread
From: Peter Zijlstra @ 2020-05-28 14:52 UTC (permalink / raw)
To: Steven Rostedt; +Cc: x86, linux-kernel
Hai,
While doing some tracing, I found a huge portion of the per-cpu buffer
was taken by printk/serial output because we're disabling the trace far
too late (after printing the CUT string).
Improve matters for architectures that have GENERIC_BUG + _BUG_FLAGS by
killing the tracer in the exception handler before printing anything
much.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
lib/bug.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/bug.c b/lib/bug.c
index 8c98af0bf585..7103440c0ee1 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -47,6 +47,7 @@
#include <linux/bug.h>
#include <linux/sched.h>
#include <linux/rculist.h>
+#include <linux/ftrace.h>
extern struct bug_entry __start___bug_table[], __stop___bug_table[];
@@ -153,6 +154,8 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
if (!bug)
return BUG_TRAP_TYPE_NONE;
+ disable_trace_on_warning();
+
file = NULL;
line = 0;
warning = 0;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-05-28 14:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 14:52 [PATCH] ftrace,bug: Improve traceoff_on_warn Peter Zijlstra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®