Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@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: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
a9862418 cf38fada

+19 -2
+14 -2
tools/perf/util/fs.c
··· 9 9 0, 10 10 }; 11 11 12 + static const char * const procfs__known_mountpoints[] = { 13 + "/proc", 14 + 0, 15 + }; 16 + 12 17 struct fs { 13 18 const char *name; 14 19 const char * const *mounts; ··· 23 18 }; 24 19 25 20 enum { 26 - FS__SYSFS = 0, 21 + FS__SYSFS = 0, 22 + FS__PROCFS = 1, 27 23 }; 28 24 29 25 static struct fs fs__entries[] = { ··· 32 26 .name = "sysfs", 33 27 .mounts = sysfs__fs_known_mountpoints, 34 28 .magic = SYSFS_MAGIC, 29 + }, 30 + [FS__PROCFS] = { 31 + .name = "proc", 32 + .mounts = procfs__known_mountpoints, 33 + .magic = PROC_SUPER_MAGIC, 35 34 }, 36 35 }; 37 36 ··· 115 104 return fs__mountpoint(idx); \ 116 105 } 117 106 118 - FS__MOUNTPOINT(sysfs, FS__SYSFS); 107 + FS__MOUNTPOINT(sysfs, FS__SYSFS); 108 + FS__MOUNTPOINT(procfs, FS__PROCFS);
+1
tools/perf/util/fs.h
··· 2 2 #define __PERF_FS 3 3 4 4 const char *sysfs__mountpoint(void); 5 + const char *procfs__mountpoint(void); 5 6 6 7 #endif /* __PERF_FS */
+4
tools/perf/util/include/linux/magic.h
··· 9 9 #define SYSFS_MAGIC 0x62656572 10 10 #endif 11 11 12 + #ifndef PROC_SUPER_MAGIC 13 + #define PROC_SUPER_MAGIC 0x9fa0 14 + #endif 15 + 12 16 #endif