diff options
-rw-r--r-- | tools/lib/api/fs/tracing_path.c | 4 | ||||
-rw-r--r-- | tools/lib/api/fs/tracing_path.h | 1 | ||||
-rw-r--r-- | tools/perf/perf.c | 5 | ||||
-rw-r--r-- | tools/perf/util/probe-file.c | 3 |
4 files changed, 4 insertions, 9 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); |
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index cd6ea55d4b0c..d5a0878de816 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -238,7 +238,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) | |||
238 | (*argc)--; | 238 | (*argc)--; |
239 | } else if (strstarts(cmd, CMD_DEBUGFS_DIR)) { | 239 | } else if (strstarts(cmd, CMD_DEBUGFS_DIR)) { |
240 | tracing_path_set(cmd + strlen(CMD_DEBUGFS_DIR)); | 240 | tracing_path_set(cmd + strlen(CMD_DEBUGFS_DIR)); |
241 | fprintf(stderr, "dir: %s\n", tracing_path); | 241 | fprintf(stderr, "dir: %s\n", tracing_path_mount()); |
242 | if (envchanged) | 242 | if (envchanged) |
243 | *envchanged = 1; | 243 | *envchanged = 1; |
244 | } else if (!strcmp(cmd, "--list-cmds")) { | 244 | } else if (!strcmp(cmd, "--list-cmds")) { |
@@ -463,9 +463,6 @@ int main(int argc, const char **argv) | |||
463 | return err; | 463 | return err; |
464 | set_buildid_dir(NULL); | 464 | set_buildid_dir(NULL); |
465 | 465 | ||
466 | /* get debugfs/tracefs mount point from /proc/mounts */ | ||
467 | tracing_path_mount(); | ||
468 | |||
469 | /* | 466 | /* |
470 | * "perf-xxxx" is the same as "perf xxxx", but we obviously: | 467 | * "perf-xxxx" is the same as "perf xxxx", but we obviously: |
471 | * | 468 | * |
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c index 4ae1123c6794..b76088fadf3d 100644 --- a/tools/perf/util/probe-file.c +++ b/tools/perf/util/probe-file.c | |||
@@ -84,8 +84,7 @@ int open_trace_file(const char *trace_file, bool readwrite) | |||
84 | char buf[PATH_MAX]; | 84 | char buf[PATH_MAX]; |
85 | int ret; | 85 | int ret; |
86 | 86 | ||
87 | ret = e_snprintf(buf, PATH_MAX, "%s/%s", | 87 | ret = e_snprintf(buf, PATH_MAX, "%s/%s", tracing_path_mount(), trace_file); |
88 | tracing_path, trace_file); | ||
89 | if (ret >= 0) { | 88 | if (ret >= 0) { |
90 | pr_debug("Opening %s write=%d\n", buf, readwrite); | 89 | pr_debug("Opening %s write=%d\n", buf, readwrite); |
91 | if (readwrite && !probe_event_dry_run) | 90 | if (readwrite && !probe_event_dry_run) |