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>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	stable@vger.kernel.org
Subject: [for-linus][PATCH 06/15] tracing: Disable trace_printk() on post poned tests
Date: Mon, 24 Feb 2020 12:20:28 -0500	[thread overview]
Message-ID: <20200224172116.787739363@goodmis.org> (raw)
In-Reply-To: 20200224172022.330525468@goodmis.org

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

The tracing seftests checks various aspects of the tracing infrastructure,
and one is filtering. If trace_printk() is active during a self test, it can
cause the filtering to fail, which will disable that part of the trace.

To keep the selftests from failing because of trace_printk() calls,
trace_printk() checks the variable tracing_selftest_running, and if set, it
does not write to the tracing buffer.

As some tracers were registered earlier in boot, the selftest they triggered
would fail because not all the infrastructure was set up for the full
selftest. Thus, some of the tests were post poned to when their
infrastructure was ready (namely file system code). The postpone code did
not set the tracing_seftest_running variable, and could fail if a
trace_printk() was added and executed during their run.

Cc: stable@vger.kernel.org
Fixes: 9afecfbb95198 ("tracing: Postpone tracer start-up tests till the system is more robust")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/trace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 183b031a3828..a89c562ffb8f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1837,6 +1837,7 @@ static __init int init_trace_selftests(void)
 
 	pr_info("Running postponed tracer tests:\n");
 
+	tracing_selftest_running = true;
 	list_for_each_entry_safe(p, n, &postponed_selftests, list) {
 		/* This loop can take minutes when sanitizers are enabled, so
 		 * lets make sure we allow RCU processing.
@@ -1859,6 +1860,7 @@ static __init int init_trace_selftests(void)
 		list_del(&p->list);
 		kfree(p);
 	}
+	tracing_selftest_running = false;
 
  out:
 	mutex_unlock(&trace_types_lock);
-- 
2.25.0



  parent reply	other threads:[~2020-02-24 17:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 17:20 [for-linus][PATCH 00/15] tracing: Updates coming for 5.6 rc release Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 01/15] tracing: Make sure synth_event_trace() example always uses u64 Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 02/15] tracing: Make synth_event trace functions endian-correct Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 03/15] tracing: Check that number of vals matches number of synth event fields Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 04/15] tracing: Fix number printing bug in print_synth_event() Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 05/15] tracing: Have synthetic event test use raw_smp_processor_id() Steven Rostedt
2020-02-24 17:20 ` Steven Rostedt [this message]
2020-02-24 17:20 ` [for-linus][PATCH 07/15] bootconfig: Mark boot_config_checksum() static Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 08/15] tracing: Clear trace_state when starting trace Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 09/15] bootconfig: Set CONFIG_BOOT_CONFIG=n by default Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 10/15] bootconfig: Add bootconfig magic word for indicating bootconfig explicitly Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 11/15] tools/bootconfig: Remove unneeded error message silencer Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 12/15] bootconfig: Reject subkey and value on same parent key Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 13/15] bootconfig: Print array as multiple commands for legacy command line Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 14/15] bootconfig: Prohibit re-defining value on same key Steven Rostedt
2020-02-24 17:20 ` [for-linus][PATCH 15/15] bootconfig: Add append value operator support Steven Rostedt

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=20200224172116.787739363@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tom.zanussi@linux.intel.com \
    /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.