diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-16 15:27:14 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-16 15:27:14 -0400 |
commit | 17c257e867be1880eaf7c1b9dac286086d75d1ec (patch) | |
tree | daa6a7bd9c5787796b12793f59d2de0d1490f7e8 /tools/lib/api/fs | |
parent | 00a6270361c025bfaae1d70ef1b596d182e05e8a (diff) |
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 <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-fci4yll35idd9yuslp67vqc2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/api/fs')
-rw-r--r-- | tools/lib/api/fs/tracing_path.c | 4 | ||||
-rw-r--r-- | tools/lib/api/fs/tracing_path.h | 1 |
2 files changed, 2 insertions, 3 deletions
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 @@ | |||
14 | #include "tracing_path.h" | 14 | #include "tracing_path.h" |
15 | 15 | ||
16 | static char tracing_mnt[PATH_MAX] = "/sys/kernel/debug"; | 16 | static char tracing_mnt[PATH_MAX] = "/sys/kernel/debug"; |
17 | char tracing_path[PATH_MAX] = "/sys/kernel/debug/tracing"; | 17 | static char tracing_path[PATH_MAX] = "/sys/kernel/debug/tracing"; |
18 | char tracing_events_path[PATH_MAX] = "/sys/kernel/debug/tracing/events"; | 18 | char tracing_events_path[PATH_MAX] = "/sys/kernel/debug/tracing/events"; |
19 | 19 | ||
20 | 20 | ||
@@ -75,7 +75,7 @@ char *get_tracing_file(const char *name) | |||
75 | { | 75 | { |
76 | char *file; | 76 | char *file; |
77 | 77 | ||
78 | if (asprintf(&file, "%s/%s", tracing_path, name) < 0) | 78 | if (asprintf(&file, "%s/%s", tracing_path_mount(), name) < 0) |
79 | return NULL; | 79 | return NULL; |
80 | 80 | ||
81 | return file; | 81 | 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 @@ | |||
4 | 4 | ||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | 6 | ||
7 | extern char tracing_path[]; | ||
8 | extern char tracing_events_path[]; | 7 | extern char tracing_events_path[]; |
9 | 8 | ||
10 | void tracing_path_set(const char *mountpoint); | 9 | void tracing_path_set(const char *mountpoint); |