[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a9862418547e818aa5842840aecfa81d733b97e9@git.kernel.org>
Date: Tue, 5 Nov 2013 21:44:11 -0800
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, linux-kernel@...r.kernel.org, paulus@...ba.org,
hpa@...or.com, mingo@...nel.org, a.p.zijlstra@...llo.nl,
namhyung@...nel.org, jolsa@...hat.com, fweisbec@...il.com,
adrian.hunter@...el.com, dsahern@...il.com, tglx@...utronix.de,
cjashfor@...ux.vnet.ibm.com, mingo@...e.hu
Subject: [tip:perf/core] perf fs: Add procfs support
Commit-ID: a9862418547e818aa5842840aecfa81d733b97e9
Gitweb: http://git.kernel.org/tip/a9862418547e818aa5842840aecfa81d733b97e9
Author: Jiri Olsa <jolsa@...hat.com>
AuthorDate: Tue, 5 Nov 2013 15:14:46 +0100
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 5 Nov 2013 15:15:07 -0300
perf fs: Add procfs support
Adding procfs support into fs class.
The interface function:
const char *procfs__mountpoint(void);
provides existing mountpoint path for procfs.
Signed-off-by: Jiri Olsa <jolsa@...hat.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/1383660887-1734-3-git-send-email-jolsa@redhat.com
[ Fixup namespace ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/fs.c | 16 ++++++++++++++--
tools/perf/util/fs.h | 1 +
tools/perf/util/include/linux/magic.h | 4 ++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/fs.c b/tools/perf/util/fs.c
index 77bac4e..f5be1f2 100644
--- a/tools/perf/util/fs.c
+++ b/tools/perf/util/fs.c
@@ -9,6 +9,11 @@ static const char * const sysfs__fs_known_mountpoints[] = {
0,
};
+static const char * const procfs__known_mountpoints[] = {
+ "/proc",
+ 0,
+};
+
struct fs {
const char *name;
const char * const *mounts;
@@ -18,7 +23,8 @@ struct fs {
};
enum {
- FS__SYSFS = 0,
+ FS__SYSFS = 0,
+ FS__PROCFS = 1,
};
static struct fs fs__entries[] = {
@@ -27,6 +33,11 @@ static struct fs fs__entries[] = {
.mounts = sysfs__fs_known_mountpoints,
.magic = SYSFS_MAGIC,
},
+ [FS__PROCFS] = {
+ .name = "proc",
+ .mounts = procfs__known_mountpoints,
+ .magic = PROC_SUPER_MAGIC,
+ },
};
static bool fs__read_mounts(struct fs *fs)
@@ -104,4 +115,5 @@ const char *name##__mountpoint(void) \
return fs__mountpoint(idx); \
}
-FS__MOUNTPOINT(sysfs, FS__SYSFS);
+FS__MOUNTPOINT(sysfs, FS__SYSFS);
+FS__MOUNTPOINT(procfs, FS__PROCFS);
diff --git a/tools/perf/util/fs.h b/tools/perf/util/fs.h
index a7561c8..5e09ce1 100644
--- a/tools/perf/util/fs.h
+++ b/tools/perf/util/fs.h
@@ -2,5 +2,6 @@
#define __PERF_FS
const char *sysfs__mountpoint(void);
+const char *procfs__mountpoint(void);
#endif /* __PERF_FS */
diff --git a/tools/perf/util/include/linux/magic.h b/tools/perf/util/include/linux/magic.h
index 58b64ed..07d63cf 100644
--- a/tools/perf/util/include/linux/magic.h
+++ b/tools/perf/util/include/linux/magic.h
@@ -9,4 +9,8 @@
#define SYSFS_MAGIC 0x62656572
#endif
+#ifndef PROC_SUPER_MAGIC
+#define PROC_SUPER_MAGIC 0x9fa0
+#endif
+
#endif
--
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