tools lib api: Unexport 'tracing_path' variable

One should use tracing_path_mount() instead, so more things get done
lazily instead of at every 'perf' tool call startup.

Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Wang Nan <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
Arnaldo Carvalho de Melo 2018-05-16 16:27:14 -03:00
commit 17c257e867
4 changed files with 4 additions and 9 deletions

View file

@ -14,7 +14,7 @@
#include "tracing_path.h"
static char tracing_mnt[PATH_MAX] = "/sys/kernel/debug";
char tracing_path[PATH_MAX] = "/sys/kernel/debug/tracing";
static char tracing_path[PATH_MAX] = "/sys/kernel/debug/tracing";
char tracing_events_path[PATH_MAX] = "/sys/kernel/debug/tracing/events";
@ -75,7 +75,7 @@ char *get_tracing_file(const char *name)
{
char *file;
if (asprintf(&file, "%s/%s", tracing_path, name) < 0)
if (asprintf(&file, "%s/%s", tracing_path_mount(), name) < 0)
return NULL;
return file;

View file

@ -4,7 +4,6 @@
#include <linux/types.h>
extern char tracing_path[];
extern char tracing_events_path[];
void tracing_path_set(const char *mountpoint);