From 58f6e384480ec97b902e44399a44862907840ba9 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Thu, 28 May 2020 16:52:40 +0200 Subject: ftrace,bug: Improve traceoff_on_warn 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. Link: https://lkml.kernel.org/r/20200528145240.GF706495@hirez.programming.kicks-ass.net Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Steven Rostedt (VMware) --- lib/bug.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') 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 #include #include +#include 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; -- cgit v1.2.3-59-g8ed1b