diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-16 21:27:14 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-16 21:27:14 +0200 |
commit | 17c257e867be1880eaf7c1b9dac286086d75d1ec (patch) | |
tree | daa6a7bd9c5787796b12793f59d2de0d1490f7e8 /tools/perf | |
parent | tools lib api: The tracing_mnt variable doesn't need to be global (diff) | |
download | linux-17c257e867be1880eaf7c1b9dac286086d75d1ec.tar.xz linux-17c257e867be1880eaf7c1b9dac286086d75d1ec.zip |
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/perf')
-rw-r--r-- | tools/perf/perf.c | 5 | ||||
-rw-r--r-- | tools/perf/util/probe-file.c | 3 |
2 files changed, 2 insertions, 6 deletions
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) (*argc)--; } else if (strstarts(cmd, CMD_DEBUGFS_DIR)) { tracing_path_set(cmd + strlen(CMD_DEBUGFS_DIR)); - fprintf(stderr, "dir: %s\n", tracing_path); + fprintf(stderr, "dir: %s\n", tracing_path_mount()); if (envchanged) *envchanged = 1; } else if (!strcmp(cmd, "--list-cmds")) { @@ -463,9 +463,6 @@ int main(int argc, const char **argv) return err; set_buildid_dir(NULL); - /* get debugfs/tracefs mount point from /proc/mounts */ - tracing_path_mount(); - /* * "perf-xxxx" is the same as "perf xxxx", but we obviously: * 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) char buf[PATH_MAX]; int ret; - ret = e_snprintf(buf, PATH_MAX, "%s/%s", - tracing_path, trace_file); + ret = e_snprintf(buf, PATH_MAX, "%s/%s", tracing_path_mount(), trace_file); if (ret >= 0) { pr_debug("Opening %s write=%d\n", buf, readwrite); if (readwrite && !probe_event_dry_run) |