Skip to content

Commit c200784

Browse files
committed
tracing: Add a trace print when traceoff_on_warning is triggered
When "traceoff_on_warning" is enabled and a warning happens, there can still be many trace events happening on other CPUs between the time the warning occurred and the last trace event on that same CPU. This can cause confusion in examining the trace, as it may not be obvious where the warning happened. By adding a trace print into the trace just before disabling tracing, it makes it obvious where the warning occurred, and the developer doesn't have to look at other means to see what CPU it occurred on. Cc: Peter Zijlstra <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 58f6e38 commit c200784

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/trace/trace.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,8 +1299,11 @@ EXPORT_SYMBOL_GPL(tracing_off);
12991299

13001300
void disable_trace_on_warning(void)
13011301
{
1302-
if (__disable_trace_on_warning)
1302+
if (__disable_trace_on_warning) {
1303+
trace_array_printk_buf(global_trace.array_buffer.buffer, _THIS_IP_,
1304+
"Disabling tracing due to warning\n");
13031305
tracing_off();
1306+
}
13041307
}
13051308

13061309
/**

0 commit comments

Comments
 (0)