libtracefs: Have tracefs_{tracing,debug}_dir() mount {tracefs,debugfs} if not mounted

tracefs_tracing_dir() and tracefs_debug_dir() would try to mount the
directories if they were not already mounted. But this broke, fix it.

Link: https://lore.kernel.org/all/20221128132106.291101-1-beanhuo@iokpp.de/
Link: https://lore.kernel.org/linux-trace-devel/20221208110739.6b2015df@gandalf.local.home

Reported-by: Bean Huo <beanhuo@iokpp.de>
Fixes: 7c2b882ed1 ("libtracefs: Add tracefs_tracing_dir_is_mounted() API")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed