diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/builtin-probe.c | 4 | ||||
| -rw-r--r-- | tools/perf/util/probe-event.c | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 64bc11a183bf..c1e54035e8cf 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c | |||
| @@ -40,7 +40,6 @@ | |||
| 40 | #include "util/debug.h" | 40 | #include "util/debug.h" |
| 41 | #include "util/debugfs.h" | 41 | #include "util/debugfs.h" |
| 42 | #include "util/parse-options.h" | 42 | #include "util/parse-options.h" |
| 43 | #include "util/parse-events.h" /* For debugfs_path */ | ||
| 44 | #include "util/probe-finder.h" | 43 | #include "util/probe-finder.h" |
| 45 | #include "util/probe-event.h" | 44 | #include "util/probe-event.h" |
| 46 | 45 | ||
| @@ -205,9 +204,6 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) | |||
| 205 | !params.show_lines)) | 204 | !params.show_lines)) |
| 206 | usage_with_options(probe_usage, options); | 205 | usage_with_options(probe_usage, options); |
| 207 | 206 | ||
| 208 | if (debugfs_valid_mountpoint(debugfs_path) < 0) | ||
| 209 | die("Failed to find debugfs path."); | ||
| 210 | |||
| 211 | if (params.list_events) { | 207 | if (params.list_events) { |
| 212 | if (params.nevents != 0 || params.dellist) { | 208 | if (params.nevents != 0 || params.dellist) { |
| 213 | pr_err(" Error: Don't use --list with --add/--del.\n"); | 209 | pr_err(" Error: Don't use --list with --add/--del.\n"); |
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index ca108b2cd15f..1c4a20a284c0 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
| @@ -42,8 +42,8 @@ | |||
| 42 | #include "color.h" | 42 | #include "color.h" |
| 43 | #include "symbol.h" | 43 | #include "symbol.h" |
| 44 | #include "thread.h" | 44 | #include "thread.h" |
| 45 | #include "debugfs.h" | ||
| 45 | #include "trace-event.h" /* For __unused */ | 46 | #include "trace-event.h" /* For __unused */ |
| 46 | #include "parse-events.h" /* For debugfs_path */ | ||
| 47 | #include "probe-event.h" | 47 | #include "probe-event.h" |
| 48 | #include "probe-finder.h" | 48 | #include "probe-finder.h" |
| 49 | 49 | ||
| @@ -1075,10 +1075,18 @@ void clear_kprobe_trace_event(struct kprobe_trace_event *tev) | |||
| 1075 | static int open_kprobe_events(bool readwrite) | 1075 | static int open_kprobe_events(bool readwrite) |
| 1076 | { | 1076 | { |
| 1077 | char buf[PATH_MAX]; | 1077 | char buf[PATH_MAX]; |
| 1078 | const char *__debugfs; | ||
| 1078 | int ret; | 1079 | int ret; |
| 1079 | 1080 | ||
| 1080 | ret = e_snprintf(buf, PATH_MAX, "%s/../kprobe_events", debugfs_path); | 1081 | __debugfs = debugfs_find_mountpoint(); |
| 1082 | if (__debugfs == NULL) { | ||
| 1083 | pr_warning("Debugfs is not mounted.\n"); | ||
| 1084 | return -ENOENT; | ||
| 1085 | } | ||
| 1086 | |||
| 1087 | ret = e_snprintf(buf, PATH_MAX, "%stracing/kprobe_events", __debugfs); | ||
| 1081 | if (ret >= 0) { | 1088 | if (ret >= 0) { |
| 1089 | pr_debug("Opening %s write=%d\n", buf, readwrite); | ||
| 1082 | if (readwrite && !probe_event_dry_run) | 1090 | if (readwrite && !probe_event_dry_run) |
| 1083 | ret = open(buf, O_RDWR, O_APPEND); | 1091 | ret = open(buf, O_RDWR, O_APPEND); |
| 1084 | else | 1092 | else |
