public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Masami Hiramatsu <mhiramat@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, paulus@samba.org, linux-kernel@vger.kernel.org,
	hpa@zytor.com, mingo@redhat.com, efault@gmx.de,
	peterz@infradead.org, fweisbec@gmail.com, tglx@linutronix.de,
	mhiramat@redhat.com, mingo@elte.hu
Subject: [tip:perf/core] perf probe: Fix to use correct debugfs path finder
Date: Thu, 15 Apr 2010 07:30:42 GMT	[thread overview]
Message-ID: <tip-7ca5989dd065cbc48a958666c273794686ea7525@git.kernel.org> (raw)
In-Reply-To: <20100414223928.14630.38326.stgit@localhost6.localdomain6>

Commit-ID:  7ca5989dd065cbc48a958666c273794686ea7525
Gitweb:     http://git.kernel.org/tip/7ca5989dd065cbc48a958666c273794686ea7525
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Wed, 14 Apr 2010 18:39:28 -0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 14 Apr 2010 17:41:06 -0300

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>
---
 tools/perf/builtin-probe.c    |    4 ----
 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 64bc11a..c1e5403 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -40,7 +40,6 @@
 #include "util/debug.h"
 #include "util/debugfs.h"
 #include "util/parse-options.h"
-#include "util/parse-events.h"	/* For debugfs_path */
 #include "util/probe-finder.h"
 #include "util/probe-event.h"
 
@@ -205,9 +204,6 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
 	     !params.show_lines))
 		usage_with_options(probe_usage, options);
 
-	if (debugfs_valid_mountpoint(debugfs_path) < 0)
-		die("Failed to find debugfs path.");
-
 	if (params.list_events) {
 		if (params.nevents != 0 || params.dellist) {
 			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 ca108b2..1c4a20a 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -42,8 +42,8 @@
 #include "color.h"
 #include "symbol.h"
 #include "thread.h"
+#include "debugfs.h"
 #include "trace-event.h"	/* For __unused */
-#include "parse-events.h"	/* For debugfs_path */
 #include "probe-event.h"
 #include "probe-finder.h"
 
@@ -1075,10 +1075,18 @@ void clear_kprobe_trace_event(struct kprobe_trace_event *tev)
 static int open_kprobe_events(bool readwrite)
 {
 	char buf[PATH_MAX];
+	const char *__debugfs;
 	int ret;
 
-	ret = e_snprintf(buf, PATH_MAX, "%s/../kprobe_events", debugfs_path);
+	__debugfs = debugfs_find_mountpoint();
+	if (__debugfs == NULL) {
+		pr_warning("Debugfs is not mounted.\n");
+		return -ENOENT;
+	}
+
+	ret = e_snprintf(buf, PATH_MAX, "%stracing/kprobe_events", __debugfs);
 	if (ret >= 0) {
+		pr_debug("Opening %s write=%d\n", buf, readwrite);
 		if (readwrite && !probe_event_dry_run)
 			ret = open(buf, O_RDWR, O_APPEND);
 		else

  reply	other threads:[~2010-04-15  7:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14 22:39 [PATCH -tip 0/6] perf-probe bugfixes Masami Hiramatsu
2010-04-14 22:39 ` [PATCH -tip 1/6] perf probe: Fix to use correct debugfs path finder Masami Hiramatsu
2010-04-15  7:30   ` tip-bot for Masami Hiramatsu [this message]
2010-04-14 22:39 ` [PATCH -tip 2/6] perf probe: Fix mis-estimation for shortening filename Masami Hiramatsu
2010-04-15  7:30   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-04-14 22:39 ` [PATCH -tip 3/6] perf probe: Fix a bug that --line range can be overflow Masami Hiramatsu
2010-04-15  7:31   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-04-14 22:39 ` [PATCH -tip 4/6] perf probe: Fix line range to show end line Masami Hiramatsu
2010-04-15  7:31   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-04-14 22:39 ` [PATCH -tip 5/6] perf probe: Support DW_OP_plus_uconst in DW_AT_data_member_location Masami Hiramatsu
2010-04-14 22:40 ` [PATCH -tip 6/6] perf probe: Show function entry line as probe-able Masami Hiramatsu
2010-04-15  7:32   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-04-14 23:28 ` [PATCH -tip 0/6] perf-probe bugfixes Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-7ca5989dd065cbc48a958666c273794686ea7525@git.kernel.org \
    --to=mhiramat@redhat.com \
    --cc=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox