]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Call clear_boot_tracer() at lateinit_sync
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 1 Aug 2017 16:01:52 +0000 (12:01 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 2 Aug 2017 18:19:57 +0000 (14:19 -0400)
commitceaed481970042a93e56ff694b6867f1ec2e4436
tree32900a1f853442630ecf7f6236e80e0624cf2947
parent8b74f4f4576ba4882ca9e92e5c3794c2476fd0af
tracing: Call clear_boot_tracer() at lateinit_sync

The clear_boot_tracer function is used to reset the default_bootup_tracer
string to prevent it from being accessed after boot, as it originally points
to init data. But since clear_boot_tracer() is called via the
init_lateinit() call, it races with the initcall for registering the hwlat
tracer. If someone adds "ftrace=hwlat" to the kernel command line, depending
on how the linker sets up the text, the saved command line may be cleared,
and the hwlat tracer never is initialized.

Simply have the clear_boot_tracer() be called by initcall_lateinit_sync() as
that's for tasks to be called after lateinit.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=196551
Cc: stable@vger.kernel.org
Fixes: 3f7b6cf7b ("tracing: Added hardware latency tracer")
Reported-by: Zamir SUN <sztsian@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.c