aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-event.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2010-04-14 18:39:28 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-04-14 16:41:06 -0400
commit7ca5989dd065cbc48a958666c273794686ea7525 (patch)
treebe35b0490b63440d0e38e1d3a45b45695e2e0618 /tools/perf/util/probe-event.c
parent02b95dadc8a1d2c302513e5fa24c492380d26e93 (diff)
perf probe: Fix to use correct debugfs path finder
Instead of using debugfs_path, use debugfs_find_mountpoint() to find actual debugfs path. LKML-Reference: <20100414223928.14630.38326.stgit@localhost6.localdomain6> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com> Reported-by: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-event.c')
-rw-r--r--tools/perf/util/probe-event.c12
1 files changed, 10 insertions, 2 deletions
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)
1075static int open_kprobe_events(bool readwrite) 1075static 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