lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 Feb 2015 10:28:47 -0800
From:	"tip-bot for Steven Rostedt (Red Hat)" <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	acme@...hat.com, tglx@...utronix.de,
	masami.hiramatsu.pt@...achi.com, namhyung@...nel.org,
	jolsa@...nel.org, mingo@...nel.org, akpm@...ux-foundation.org,
	hpa@...or.com, linux-kernel@...r.kernel.org, rostedt@...dmis.org
Subject: [tip:perf/core] tools lib api debugfs:
  Add DEBUGFS_DEFAULT_PATH macro

Commit-ID:  a9edf60749a9483341facfa7c28bcf8afb3c8311
Gitweb:     http://git.kernel.org/tip/a9edf60749a9483341facfa7c28bcf8afb3c8311
Author:     Steven Rostedt (Red Hat) <rostedt@...dmis.org>
AuthorDate: Mon, 2 Feb 2015 14:35:05 -0500
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Sat, 7 Feb 2015 13:56:32 +0100

tools lib api debugfs: Add DEBUGFS_DEFAULT_PATH macro

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

Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Link: http://lkml.kernel.org/r/20150202193553.032117017@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 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 91e1668..07d74b0 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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ