From 17c257e867be1880eaf7c1b9dac286086d75d1ec Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Wed, 16 May 2018 16:27:14 -0300 Subject: 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 Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-fci4yll35idd9yuslp67vqc2@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/api/fs/tracing_path.c | 4 ++-- tools/lib/api/fs/tracing_path.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'tools/lib/api/fs') diff --git a/tools/lib/api/fs/tracing_path.c b/tools/lib/api/fs/tracing_path.c index 4f8ec7d476b8..6f5fe942eff4 100644 --- a/tools/lib/api/fs/tracing_path.c +++ b/tools/lib/api/fs/tracing_path.c @@ -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; diff --git a/tools/lib/api/fs/tracing_path.h b/tools/lib/api/fs/tracing_path.h index 0066f06cc381..1b65decedfc0 100644 --- a/tools/lib/api/fs/tracing_path.h +++ b/tools/lib/api/fs/tracing_path.h @@ -4,7 +4,6 @@ #include -extern char tracing_path[]; extern char tracing_events_path[]; void tracing_path_set(const char *mountpoint); -- cgit v1.2.3-59-g8ed1b