linux/kernel/trace
Steven Rostedt (VMware) 91495e01e8 tracing: Disable trace_printk() on post poned tests
commit 78041c0c9e upstream.

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: 9afecfbb95 ("tracing: Postpone tracer start-up tests till the system is more robust")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-05 16:42:18 +01:00
..
blktrace.c
bpf_trace.c bpf: fix nested bpf tracepoints with per-cpu data 2019-07-03 13:14:48 +02:00
ftrace.c ftrace: fpid_next() should increase position index 2020-02-24 08:34:52 +01:00
Kconfig
Makefile
power-traces.c
preemptirq_delay_test.c
ring_buffer_benchmark.c
ring_buffer.c trace: Fix preempt_enable_no_resched() abuse 2019-05-02 09:58:54 +02:00
rpm-traces.c
trace_benchmark.c
trace_benchmark.h
trace_branch.c Revert "x86/uaccess, ftrace: Fix ftrace_likely_update() vs. SMAP" 2019-07-03 13:14:41 +02:00
trace_clock.c
trace_entries.h
trace_event_perf.c tracing: Fix race in perf_trace_buf initialization 2019-10-29 09:20:03 +01:00
trace_events_filter_test.h
trace_events_filter.c tracing: Avoid memory leak in process_system_preds() 2020-01-09 10:19:02 +01:00
trace_events_hist.c tracing: Fix histogram code when expression has same var as value 2020-01-29 16:43:23 +01:00
trace_events_trigger.c trigger_next should increase position index 2020-02-24 08:34:52 +01:00
trace_events.c tracing: Fix lock inversion in trace_event_enable_tgid_record() 2020-01-09 10:19:02 +01:00
trace_export.c
trace_functions_graph.c tracing/fgraph: Fix set_graph_function from showing interrupts 2018-12-08 12:59:07 +01:00
trace_functions.c
trace_hwlat.c tracing/hwlat: Don't ignore outer-loop duration when calculating max_latency 2019-10-17 13:45:39 -07:00
trace_irqsoff.c tracing/fgraph: Fix set_graph_function from showing interrupts 2018-12-08 12:59:07 +01:00
trace_kdb.c tracing: Silence GCC 9 array bounds warning 2019-06-25 11:35:52 +08:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_kprobe.c tracing/kprobe: Check whether the non-suffixed symbol is notrace 2019-12-31 16:36:02 +01:00
trace_mmiotrace.c
trace_nop.c
trace_output.c
trace_output.h
trace_preemptirq.c
trace_printk.c
trace_probe.c
trace_probe.h
trace_sched_switch.c tracing: Fix sched switch start/stop refcount racy updates 2020-02-11 04:33:55 -08:00
trace_sched_wakeup.c kernel/trace: Fix do not unregister tracepoints when register sched_migrate_task fail 2020-01-14 20:06:59 +01:00
trace_selftest_dynamic.c
trace_selftest.c
trace_seq.c
trace_stack.c tracing: Have stack tracer compile when MCOUNT_INSN_SIZE is not defined 2020-01-14 20:06:59 +01:00
trace_stat.c tracing: Fix very unlikely race of registering two stat tracers 2020-02-24 08:34:39 +01:00
trace_stat.h
trace_syscalls.c
trace_uprobe.c tracing/uprobes: Fix output for multiple string arguments 2019-02-20 10:25:48 +01:00
trace.c tracing: Disable trace_printk() on post poned tests 2020-03-05 16:42:18 +01:00
trace.h ftrace: Protect ftrace_graph_hash with ftrace_sync 2020-02-11 04:34:05 -08:00
tracing_map.c tracing: Have the histogram compare functions convert to u64 first 2020-01-09 10:19:02 +01:00
tracing_map.h