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

tools lib api fs: Replace debugfs/tracefs objects interface with fs.c

Switching to the fs.c related filesystem framework.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Raphael Beamonte <raphael.beamonte@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1441180605-24737-14-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
4605eab3 4f234f06

+23 -29
-1
tools/lib/api/fs/fs.c
··· 11 11 #include <unistd.h> 12 12 #include <sys/mount.h> 13 13 14 - #include "debugfs.h" 15 14 #include "fs.h" 16 15 17 16 #define _STR(x) #x
+7 -8
tools/lib/api/fs/tracing_path.c
··· 7 7 #include <string.h> 8 8 #include <errno.h> 9 9 #include <unistd.h> 10 - #include "debugfs.h" 11 - #include "tracefs.h" 10 + #include "fs.h" 12 11 13 12 #include "tracing_path.h" 14 13 ··· 28 29 { 29 30 const char *mnt; 30 31 31 - mnt = tracefs_mount(NULL); 32 + mnt = tracefs__mount(); 32 33 if (!mnt) 33 34 return NULL; 34 35 ··· 41 42 { 42 43 const char *mnt; 43 44 44 - mnt = debugfs_mount(NULL); 45 + mnt = debugfs__mount(); 45 46 if (!mnt) 46 47 return NULL; 47 48 ··· 95 96 * want some tracepoint which wasn't compiled in your kernel. 96 97 * - jirka 97 98 */ 98 - if (debugfs_configured() || tracefs_configured()) { 99 + if (debugfs__configured() || tracefs__configured()) { 99 100 snprintf(buf, size, 100 101 "Error:\tFile %s/%s not found.\n" 101 102 "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n", ··· 109 110 "Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'"); 110 111 break; 111 112 case EACCES: { 112 - const char *mountpoint = debugfs_find_mountpoint(); 113 + const char *mountpoint = debugfs__mountpoint(); 113 114 114 115 if (!access(mountpoint, R_OK) && strncmp(filename, "tracing/", 8) == 0) { 115 - const char *tracefs_mntpoint = tracefs_find_mountpoint(); 116 + const char *tracefs_mntpoint = tracefs__mountpoint(); 116 117 117 118 if (tracefs_mntpoint) 118 - mountpoint = tracefs_find_mountpoint(); 119 + mountpoint = tracefs__mountpoint(); 119 120 } 120 121 121 122 snprintf(buf, size,
-1
tools/perf/builtin-kvm.c
··· 13 13 #include "util/parse-options.h" 14 14 #include "util/trace-event.h" 15 15 #include "util/debug.h" 16 - #include <api/fs/debugfs.h> 17 16 #include "util/tool.h" 18 17 #include "util/stat.h" 19 18 #include "util/top.h"
-1
tools/perf/builtin-probe.c
··· 37 37 #include "util/strfilter.h" 38 38 #include "util/symbol.h" 39 39 #include "util/debug.h" 40 - #include <api/fs/debugfs.h> 41 40 #include "util/parse-options.h" 42 41 #include "util/probe-finder.h" 43 42 #include "util/probe-event.h"
+3 -2
tools/perf/tests/openat-syscall-all-cpus.c
··· 1 + #include <api/fs/fs.h> 1 2 #include "evsel.h" 2 3 #include "tests.h" 3 4 #include "thread_map.h" ··· 31 30 32 31 evsel = perf_evsel__newtp("syscalls", "sys_enter_openat"); 33 32 if (evsel == NULL) { 34 - if (tracefs_configured()) 33 + if (tracefs__configured()) 35 34 pr_debug("is tracefs mounted on /sys/kernel/tracing?\n"); 36 - else if (debugfs_configured()) 35 + else if (debugfs__configured()) 37 36 pr_debug("is debugfs mounted on /sys/kernel/debug?\n"); 38 37 else 39 38 pr_debug("Neither tracefs or debugfs is enabled in this kernel\n");
+3 -2
tools/perf/tests/openat-syscall.c
··· 1 + #include <api/fs/fs.h> 1 2 #include "thread_map.h" 2 3 #include "evsel.h" 3 4 #include "debug.h" ··· 19 18 20 19 evsel = perf_evsel__newtp("syscalls", "sys_enter_openat"); 21 20 if (evsel == NULL) { 22 - if (tracefs_configured()) 21 + if (tracefs__configured()) 23 22 pr_debug("is tracefs mounted on /sys/kernel/tracing?\n"); 24 - else if (debugfs_configured()) 23 + else if (debugfs__configured()) 25 24 pr_debug("is debugfs mounted on /sys/kernel/debug?\n"); 26 25 else 27 26 pr_debug("Neither tracefs or debugfs is enabled in this kernel\n");
+3 -4
tools/perf/tests/parse-events.c
··· 3 3 #include "evsel.h" 4 4 #include "evlist.h" 5 5 #include <api/fs/fs.h> 6 - #include <api/fs/tracefs.h> 7 - #include <api/fs/debugfs.h> 8 6 #include "tests.h" 9 7 #include "debug.h" 10 8 #include <linux/hw_breakpoint.h> 9 + #include <api/fs/fs.h> 11 10 12 11 #define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \ 13 12 PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD) ··· 1267 1268 DIR *events_dir; 1268 1269 int cnt = 0; 1269 1270 1270 - mountpoint = tracefs_find_mountpoint(); 1271 + mountpoint = tracefs__mountpoint(); 1271 1272 if (mountpoint) { 1272 1273 scnprintf(events_path, PATH_MAX, "%s/events", 1273 1274 mountpoint); 1274 1275 } else { 1275 - mountpoint = debugfs_find_mountpoint(); 1276 + mountpoint = debugfs__mountpoint(); 1276 1277 scnprintf(events_path, PATH_MAX, "%s/tracing/events", 1277 1278 mountpoint); 1278 1279 }
+1 -1
tools/perf/util/evsel.c
··· 9 9 10 10 #include <byteswap.h> 11 11 #include <linux/bitops.h> 12 - #include <api/fs/debugfs.h> 12 + #include <api/fs/tracing_path.h> 13 13 #include <traceevent/event-parse.h> 14 14 #include <linux/hw_breakpoint.h> 15 15 #include <linux/perf_event.h>
+2 -3
tools/perf/util/probe-event.c
··· 40 40 #include "color.h" 41 41 #include "symbol.h" 42 42 #include "thread.h" 43 - #include <api/fs/debugfs.h> 44 - #include <api/fs/tracefs.h> 43 + #include <api/fs/fs.h> 45 44 #include "trace-event.h" /* For __maybe_unused */ 46 45 #include "probe-event.h" 47 46 #include "probe-finder.h" ··· 2053 2054 static int kprobe_blacklist__load(struct list_head *blacklist) 2054 2055 { 2055 2056 struct kprobe_blacklist_node *node; 2056 - const char *__debugfs = debugfs_find_mountpoint(); 2057 + const char *__debugfs = debugfs__mountpoint(); 2057 2058 char buf[PATH_MAX], *p; 2058 2059 FILE *fp; 2059 2060 int ret;
+3 -4
tools/perf/util/probe-file.c
··· 22 22 #include "color.h" 23 23 #include "symbol.h" 24 24 #include "thread.h" 25 - #include <api/fs/debugfs.h> 26 - #include <api/fs/tracefs.h> 25 + #include <api/fs/fs.h> 27 26 #include "probe-event.h" 28 27 #include "probe-file.h" 29 28 #include "session.h" ··· 76 77 const char *tracing_dir = ""; 77 78 int ret; 78 79 79 - __debugfs = tracefs_find_mountpoint(); 80 + __debugfs = tracefs__mountpoint(); 80 81 if (__debugfs == NULL) { 81 82 tracing_dir = "tracing/"; 82 83 83 - __debugfs = debugfs_find_mountpoint(); 84 + __debugfs = debugfs__mountpoint(); 84 85 if (__debugfs == NULL) 85 86 return -ENOTSUP; 86 87 }
+1 -2
tools/perf/util/util.h
··· 74 74 #include <linux/magic.h> 75 75 #include <linux/types.h> 76 76 #include <sys/ttydefaults.h> 77 - #include <api/fs/debugfs.h> 78 - #include <api/fs/tracefs.h> 77 + #include <api/fs/tracing_path.h> 79 78 #include <termios.h> 80 79 #include <linux/bitops.h> 81 80 #include <termios.h>