Skip to content

Commit 58f6e38

Browse files
Peter Zijlstrarostedt
authored andcommitted
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/[email protected] Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent bea24f7 commit 58f6e38

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/bug.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include <linux/bug.h>
4848
#include <linux/sched.h>
4949
#include <linux/rculist.h>
50+
#include <linux/ftrace.h>
5051

5152
extern struct bug_entry __start___bug_table[], __stop___bug_table[];
5253

@@ -153,6 +154,8 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
153154
if (!bug)
154155
return BUG_TRAP_TYPE_NONE;
155156

157+
disable_trace_on_warning();
158+
156159
file = NULL;
157160
line = 0;
158161
warning = 0;

0 commit comments

Comments
 (0)