tools lib api fs: Replace debugfs/tracefs objects interface with fs.c
authorJiri Olsa <jolsa@kernel.org>
Wed, 2 Sep 2015 07:56:43 +0000 (09:56 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 14 Sep 2015 15:50:15 +0000 (12:50 -0300)
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>
tools/lib/api/fs/fs.c
tools/lib/api/fs/tracing_path.c
tools/perf/builtin-kvm.c
tools/perf/builtin-probe.c
tools/perf/tests/openat-syscall-all-cpus.c
tools/perf/tests/openat-syscall.c
tools/perf/tests/parse-events.c
tools/perf/util/evsel.c
tools/perf/util/probe-event.c
tools/perf/util/probe-file.c
tools/perf/util/util.h

index 8afe08a99bc66fe3a53a0767ff99de0c56a34072..791509346178ebfdf7ad2dd92d81e8b523859ea8 100644 (file)
@@ -11,7 +11,6 @@
 #include <unistd.h>
 #include <sys/mount.h>
 
-#include "debugfs.h"
 #include "fs.h"
 
 #define _STR(x) #x
index 1e0bb0da5e4f2b4eb1a5345ba27ca50d91846cdf..38aca2dd19461a9bea909a27f77b95874b846fef 100644 (file)
@@ -7,8 +7,7 @@
 #include <string.h>
 #include <errno.h>
 #include <unistd.h>
-#include "debugfs.h"
-#include "tracefs.h"
+#include "fs.h"
 
 #include "tracing_path.h"
 
@@ -29,7 +28,7 @@ static const char *tracing_path_tracefs_mount(void)
 {
        const char *mnt;
 
-       mnt = tracefs_mount(NULL);
+       mnt = tracefs__mount();
        if (!mnt)
                return NULL;
 
@@ -42,7 +41,7 @@ static const char *tracing_path_debugfs_mount(void)
 {
        const char *mnt;
 
-       mnt = debugfs_mount(NULL);
+       mnt = debugfs__mount();
        if (!mnt)
                return NULL;
 
@@ -96,7 +95,7 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename)
                 * want some tracepoint which wasn't compiled in your kernel.
                 * - jirka
                 */
-               if (debugfs_configured() || tracefs_configured()) {
+               if (debugfs__configured() || tracefs__configured()) {
                        snprintf(buf, size,
                                 "Error:\tFile %s/%s not found.\n"
                                 "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
@@ -110,13 +109,13 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename)
                         "Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'");
                break;
        case EACCES: {
-               const char *mountpoint = debugfs_find_mountpoint();
+               const char *mountpoint = debugfs__mountpoint();
 
                if (!access(mountpoint, R_OK) && strncmp(filename, "tracing/", 8) == 0) {
-                       const char *tracefs_mntpoint = tracefs_find_mountpoint();
+                       const char *tracefs_mntpoint = tracefs__mountpoint();
 
                        if (tracefs_mntpoint)
-                               mountpoint = tracefs_find_mountpoint();
+                               mountpoint = tracefs__mountpoint();
                }
 
                snprintf(buf, size,
index fc1cffb1b7a28c9b0d9856770530a0e8b3bf9606..dd94b4ca22131a211729082925bbbf082d19c73e 100644 (file)
@@ -13,7 +13,6 @@
 #include "util/parse-options.h"
 #include "util/trace-event.h"
 #include "util/debug.h"
-#include <api/fs/debugfs.h>
 #include "util/tool.h"
 #include "util/stat.h"
 #include "util/top.h"
index ee2c46d8353e949e3ce315e21edca14d326c8ee4..2bec9c1ef2a3e4f8f6467065a1977dd85015d951 100644 (file)
@@ -37,7 +37,6 @@
 #include "util/strfilter.h"
 #include "util/symbol.h"
 #include "util/debug.h"
-#include <api/fs/debugfs.h>
 #include "util/parse-options.h"
 #include "util/probe-finder.h"
 #include "util/probe-event.h"
index a572f87e9c8d8e25665bf75e1c45b1f86ff8a6e9..a38adf94c731ed09e42a5424c16b366d196fc005 100644 (file)
@@ -1,3 +1,4 @@
+#include <api/fs/fs.h>
 #include "evsel.h"
 #include "tests.h"
 #include "thread_map.h"
@@ -30,9 +31,9 @@ int test__openat_syscall_event_on_all_cpus(void)
 
        evsel = perf_evsel__newtp("syscalls", "sys_enter_openat");
        if (evsel == NULL) {
-               if (tracefs_configured())
+               if (tracefs__configured())
                        pr_debug("is tracefs mounted on /sys/kernel/tracing?\n");
-               else if (debugfs_configured())
+               else if (debugfs__configured())
                        pr_debug("is debugfs mounted on /sys/kernel/debug?\n");
                else
                        pr_debug("Neither tracefs or debugfs is enabled in this kernel\n");
index c9a37bc6b33ac336a128a4948623a1a93a5b388f..8048c7d7cd67c2225c2b9b86333195a803ff125d 100644 (file)
@@ -1,3 +1,4 @@
+#include <api/fs/fs.h>
 #include "thread_map.h"
 #include "evsel.h"
 #include "debug.h"
@@ -18,9 +19,9 @@ int test__openat_syscall_event(void)
 
        evsel = perf_evsel__newtp("syscalls", "sys_enter_openat");
        if (evsel == NULL) {
-               if (tracefs_configured())
+               if (tracefs__configured())
                        pr_debug("is tracefs mounted on /sys/kernel/tracing?\n");
-               else if (debugfs_configured())
+               else if (debugfs__configured())
                        pr_debug("is debugfs mounted on /sys/kernel/debug?\n");
                else
                        pr_debug("Neither tracefs or debugfs is enabled in this kernel\n");
index 9b6b2b6324a1d479835af199e4f02e129c949075..91fbfd593c4aa340ac23c00a890398a331939186 100644 (file)
@@ -3,11 +3,10 @@
 #include "evsel.h"
 #include "evlist.h"
 #include <api/fs/fs.h>
-#include <api/fs/tracefs.h>
-#include <api/fs/debugfs.h>
 #include "tests.h"
 #include "debug.h"
 #include <linux/hw_breakpoint.h>
+#include <api/fs/fs.h>
 
 #define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \
                             PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD)
@@ -1268,12 +1267,12 @@ static int count_tracepoints(void)
        DIR *events_dir;
        int cnt = 0;
 
-       mountpoint = tracefs_find_mountpoint();
+       mountpoint = tracefs__mountpoint();
        if (mountpoint) {
                scnprintf(events_path, PATH_MAX, "%s/events",
                          mountpoint);
        } else {
-               mountpoint = debugfs_find_mountpoint();
+               mountpoint = debugfs__mountpoint();
                scnprintf(events_path, PATH_MAX, "%s/tracing/events",
                          mountpoint);
        }
index c53f79123b37f4ab506f3a914263d59c3122cfb6..771ade4d596640b32143b89aa1c97f34c1f912b9 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <byteswap.h>
 #include <linux/bitops.h>
-#include <api/fs/debugfs.h>
+#include <api/fs/tracing_path.h>
 #include <traceevent/event-parse.h>
 #include <linux/hw_breakpoint.h>
 #include <linux/perf_event.h>
index 3da9e1c792fa000b911efb9ddaf7e41998ba519e..5964eccbe94d68b5fb0906e82f7069e34253b673 100644 (file)
@@ -40,8 +40,7 @@
 #include "color.h"
 #include "symbol.h"
 #include "thread.h"
-#include <api/fs/debugfs.h>
-#include <api/fs/tracefs.h>
+#include <api/fs/fs.h>
 #include "trace-event.h"       /* For __maybe_unused */
 #include "probe-event.h"
 #include "probe-finder.h"
@@ -2054,7 +2053,7 @@ static void kprobe_blacklist__delete(struct list_head *blacklist)
 static int kprobe_blacklist__load(struct list_head *blacklist)
 {
        struct kprobe_blacklist_node *node;
-       const char *__debugfs = debugfs_find_mountpoint();
+       const char *__debugfs = debugfs__mountpoint();
        char buf[PATH_MAX], *p;
        FILE *fp;
        int ret;
index 38c0a62039cc5ac52f430e3c65b1f3b36400e9ce..499c83ccd44bf239ce46a9d67010f0519ccf9966 100644 (file)
@@ -22,8 +22,7 @@
 #include "color.h"
 #include "symbol.h"
 #include "thread.h"
-#include <api/fs/debugfs.h>
-#include <api/fs/tracefs.h>
+#include <api/fs/fs.h>
 #include "probe-event.h"
 #include "probe-file.h"
 #include "session.h"
@@ -77,11 +76,11 @@ static int open_probe_events(const char *trace_file, bool readwrite)
        const char *tracing_dir = "";
        int ret;
 
-       __debugfs = tracefs_find_mountpoint();
+       __debugfs = tracefs__mountpoint();
        if (__debugfs == NULL) {
                tracing_dir = "tracing/";
 
-               __debugfs = debugfs_find_mountpoint();
+               __debugfs = debugfs__mountpoint();
                if (__debugfs == NULL)
                        return -ENOTSUP;
        }
index 495b99ccb5880ab2f7d0be60eac691dd6cba3e66..3d5b01e8978fe3f0216a45a19149d15f79b6dd5a 100644 (file)
@@ -74,8 +74,7 @@
 #include <linux/magic.h>
 #include <linux/types.h>
 #include <sys/ttydefaults.h>
-#include <api/fs/debugfs.h>
-#include <api/fs/tracefs.h>
+#include <api/fs/tracing_path.h>
 #include <termios.h>
 #include <linux/bitops.h>
 #include <termios.h>