All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: [for-next][PATCH 12/12] tracing: Add a trace print when traceoff_on_warning is triggered
Date: Mon, 01 Jun 2020 08:27:41 -0400	[thread overview]
Message-ID: <20200601122808.839838080@goodmis.org> (raw)
In-Reply-To: 20200601122729.727113609@goodmis.org

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

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 <peterz@infradead.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/trace.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 29615f15a820..760fd102dbe2 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1299,8 +1299,11 @@ EXPORT_SYMBOL_GPL(tracing_off);
 
 void disable_trace_on_warning(void)
 {
-	if (__disable_trace_on_warning)
+	if (__disable_trace_on_warning) {
+		trace_array_printk_buf(global_trace.array_buffer.buffer, _THIS_IP_,
+			"Disabling tracing due to warning\n");
 		tracing_off();
+	}
 }
 
 /**
-- 
2.26.2



      parent reply	other threads:[~2020-06-01 12:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 12:27 [for-next][PATCH 00/12] tracing: Updates for 5.8 (finally finished testing them) Steven Rostedt
2020-06-01 12:27 ` [for-next][PATCH 01/12] ftrace: show debugging information when panic_on_warn set Steven Rostedt
2020-06-01 12:27 ` [for-next][PATCH 02/12] tools/bootconfig: Add a summary of test cases and return error Steven Rostedt
2020-06-01 12:27 ` [for-next][PATCH 03/12] tracing/probe: reverse arguments to list_add Steven Rostedt
2020-06-01 12:27 ` [for-next][PATCH 04/12] tracing: Check state.disabled in synth event trace functions Steven Rostedt
2020-06-01 12:27 ` [for-next][PATCH 05/12] tracing: Add histogram-design document Steven Rostedt
2020-06-01 12:27 ` [for-next][PATCH 06/12] tracing: Add hist_debug trace event files for histogram debugging Steven Rostedt
2020-06-01 12:27 ` [for-next][PATCH 07/12] tracing/doc: Fix typos in histogram-design.rst Steven Rostedt
2020-06-01 12:27 ` [for-next][PATCH 09/12] tracing: Move synthetic events to a separate file Steven Rostedt
2020-06-01 12:27 ` [for-next][PATCH 10/12] selftests/ftrace: Distinguish between hist and synthetic event checks Steven Rostedt
2020-06-01 12:27 ` [for-next][PATCH 11/12] ftrace,bug: Improve traceoff_on_warn Steven Rostedt
2020-06-01 12:27 ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200601122808.839838080@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.