libtracefs: Update tracing_dir in loading mapping files

If tracing_dir is not a path to a tracing dir or simply NULL, then
load_saved_cmdlines() and load_printk_formats() will fail to load any
mappings.

Add a check for tracing_dir in the callers of those functions
(load_mappings() and tracefs_load_cmdlines()) to update tracing_dir to the
appropriate directory.

Link: https://lore.kernel.org/linux-trace-devel/20210412104349.4d8f83b8@gandalf.local.home

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 file changed