#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";
 
 
 {
        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;
 
 
 #include <linux/types.h>
 
-extern char tracing_path[];
 extern char tracing_events_path[];
 
 void tracing_path_set(const char *mountpoint);
 
                        (*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")) {
                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:
         *
 
        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)