From: "Steven Rostedt (Red Hat)" <[email protected]>

Instead of hard coding "/sys/kernel/debug" everywhere, create a macro to
hold where the default path exists.

Signed-off-by: Steven Rostedt <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
 tools/lib/api/fs/debugfs.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c
index 91e1668348ce..07d74b03d828 100644
--- a/tools/lib/api/fs/debugfs.c
+++ b/tools/lib/api/fs/debugfs.c
@@ -10,10 +10,14 @@
 
 #include "debugfs.h"
 
-char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug";
+#ifndef DEBUGFS_DEFAULT_PATH
+#define DEBUGFS_DEFAULT_PATH           "/sys/kernel/debug"
+#endif
+
+char debugfs_mountpoint[PATH_MAX + 1] = DEBUGFS_DEFAULT_PATH;
 
 static const char * const debugfs_known_mountpoints[] = {
-       "/sys/kernel/debug",
+       DEBUGFS_DEFAULT_PATH,
        "/debug",
        0,
 };
@@ -50,7 +54,7 @@ char *debugfs_mount(const char *mountpoint)
                mountpoint = getenv(PERF_DEBUGFS_ENVIRONMENT);
                /* if no environment variable, use default */
                if (mountpoint == NULL)
-                       mountpoint = "/sys/kernel/debug";
+                       mountpoint = DEBUGFS_DEFAULT_PATH;
        }
 
        if (mount(NULL, mountpoint, "debugfs", 0, NULL) < 0)
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to