]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
tracing: Avoid adding tracer option before update_tracer_options
authorMark-PK Tsai <mark-pk.tsai@mediatek.com>
Tue, 26 Apr 2022 12:24:06 +0000 (20:24 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:52:53 +0000 (10:52 +0200)
commite95321dd4021993731ec1f2ff325bca2e9210794
treeb88da68757ea59af3acfcc33c55ebfb3444e00e0
parentaa367e5f5b54371131bc8cf511be288df42fe1e2
tracing: Avoid adding tracer option before update_tracer_options

BugLink: https://bugs.launchpad.net/bugs/1982968
[ Upstream commit ef9188bcc6ca1d8a2ad83e826b548e6820721061 ]

To prepare for support asynchronous tracer_init_tracefs initcall,
avoid calling create_trace_option_files before __update_tracer_options.
Otherwise, create_trace_option_files will show warning because
some tracers in trace_types list are already in tr->topts.

For example, hwlat_tracer call register_tracer in late_initcall,
and global_trace.dir is already created in tracing_init_dentry,
hwlat_tracer will be put into tr->topts.
Then if the __update_tracer_options is executed after hwlat_tracer
registered, create_trace_option_files find that hwlat_tracer is
already in tr->topts.

Link: https://lkml.kernel.org/r/20220426122407.17042-2-mark-pk.tsai@mediatek.com
Link: https://lore.kernel.org/lkml/20220322133339.GA32582@xsang-OptiPlex-9020/
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
kernel/trace/trace.c