Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
tracing: Call clear_boot_tracer() at lateinit_sync
Browse files Browse the repository at this point in the history
commit 4bb0f0e upstream.

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

Fixes: e7c15cd ("tracing: Added hardware latency tracer")
Reported-by: Zamir SUN <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
rostedt authored and gregkh committed Aug 30, 2017
1 parent 46cd0a3 commit 3170d9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -7767,4 +7767,4 @@ __init static int clear_boot_tracer(void)
}

fs_initcall(tracer_init_tracefs);
late_initcall(clear_boot_tracer);
late_initcall_sync(clear_boot_tracer);

0 comments on commit 3170d9a

Please sign in to comment.