From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754894AbbBRS3G (ORCPT ); Wed, 18 Feb 2015 13:29:06 -0500 Received: from terminus.zytor.com ([198.137.202.10]:40863 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753274AbbBRS3D (ORCPT ); Wed, 18 Feb 2015 13:29:03 -0500 Date: Wed, 18 Feb 2015 10:28:47 -0800 From: "tip-bot for Steven Rostedt (Red Hat)" Message-ID: Cc: acme@redhat.com, tglx@linutronix.de, masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org, jolsa@kernel.org, mingo@kernel.org, akpm@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org Reply-To: jolsa@kernel.org, namhyung@kernel.org, masami.hiramatsu.pt@hitachi.com, tglx@linutronix.de, acme@redhat.com, rostedt@goodmis.org, linux-kernel@vger.kernel.org, hpa@zytor.com, akpm@linux-foundation.org, mingo@kernel.org In-Reply-To: <20150202193553.032117017@goodmis.org> References: <20150202193553.032117017@goodmis.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools lib api debugfs: Add DEBUGFS_DEFAULT_PATH macro Git-Commit-ID: a9edf60749a9483341facfa7c28bcf8afb3c8311 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a9edf60749a9483341facfa7c28bcf8afb3c8311 Gitweb: http://git.kernel.org/tip/a9edf60749a9483341facfa7c28bcf8afb3c8311 Author: Steven Rostedt (Red Hat) AuthorDate: Mon, 2 Feb 2015 14:35:05 -0500 Committer: Arnaldo Carvalho de Melo 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 Acked-by: Jiri Olsa Cc: Andrew Morton Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20150202193553.032117017@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo --- 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)