Commit a9862418 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarJiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1383660887-1734-3-git-send-email-jolsa@redhat.com
[ Fixup namespace ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent cf38fada
...@@ -9,6 +9,11 @@ static const char * const sysfs__fs_known_mountpoints[] = { ...@@ -9,6 +9,11 @@ static const char * const sysfs__fs_known_mountpoints[] = {
0, 0,
}; };
static const char * const procfs__known_mountpoints[] = {
"/proc",
0,
};
struct fs { struct fs {
const char *name; const char *name;
const char * const *mounts; const char * const *mounts;
...@@ -18,7 +23,8 @@ struct fs { ...@@ -18,7 +23,8 @@ struct fs {
}; };
enum { enum {
FS__SYSFS = 0, FS__SYSFS = 0,
FS__PROCFS = 1,
}; };
static struct fs fs__entries[] = { static struct fs fs__entries[] = {
...@@ -27,6 +33,11 @@ static struct fs fs__entries[] = { ...@@ -27,6 +33,11 @@ static struct fs fs__entries[] = {
.mounts = sysfs__fs_known_mountpoints, .mounts = sysfs__fs_known_mountpoints,
.magic = SYSFS_MAGIC, .magic = SYSFS_MAGIC,
}, },
[FS__PROCFS] = {
.name = "proc",
.mounts = procfs__known_mountpoints,
.magic = PROC_SUPER_MAGIC,
},
}; };
static bool fs__read_mounts(struct fs *fs) static bool fs__read_mounts(struct fs *fs)
...@@ -104,4 +115,5 @@ const char *name##__mountpoint(void) \ ...@@ -104,4 +115,5 @@ const char *name##__mountpoint(void) \
return fs__mountpoint(idx); \ return fs__mountpoint(idx); \
} }
FS__MOUNTPOINT(sysfs, FS__SYSFS); FS__MOUNTPOINT(sysfs, FS__SYSFS);
FS__MOUNTPOINT(procfs, FS__PROCFS);
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
#define __PERF_FS #define __PERF_FS
const char *sysfs__mountpoint(void); const char *sysfs__mountpoint(void);
const char *procfs__mountpoint(void);
#endif /* __PERF_FS */ #endif /* __PERF_FS */
...@@ -9,4 +9,8 @@ ...@@ -9,4 +9,8 @@
#define SYSFS_MAGIC 0x62656572 #define SYSFS_MAGIC 0x62656572
#endif #endif
#ifndef PROC_SUPER_MAGIC
#define PROC_SUPER_MAGIC 0x9fa0
#endif
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment