This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[tip:perf/urgent] perf probe: Check whether debugfs path is correct
- From: tip-bot for Masami Hiramatsu <mhiramat at redhat dot com>
- To: linux-tip-commits at vger dot kernel dot org
- Cc: acme at redhat dot com, mingo at redhat dot com, peterz at infradead dot org, dle-develop at lists dot sourceforge dot net, fweisbec at gmail dot com, rostedt at goodmis dot org, jbaron at redhat dot com, tglx at linutronix dot de, mhiramat at redhat dot com, systemtap at sources dot redhat dot com, linux-kernel at vger dot kernel dot org, hpa at zytor dot com, paulus at samba dot org, jkenisto at us dot ibm dot com, hch at infradead dot org, ananth at in dot ibm dot com, srikar at linux dot vnet dot ibm dot com, mingo at elte dot hu, prasad at linux dot vnet dot ibm dot com
- Date: Thu, 17 Dec 2009 10:51:31 GMT
- Subject: [tip:perf/urgent] perf probe: Check whether debugfs path is correct
- Git-commit-id: 96c96612e952f63cc0055db9df7d8b5b1ada02be
- References: <20091216222400.14459.48162.stgit@dhcp-100-2-132.bos.redhat.com>
- Reply-to: mingo at redhat dot com, acme at redhat dot com, peterz at infradead dot org, dle-develop at lists dot sourceforge dot net, fweisbec at gmail dot com, rostedt at goodmis dot org, jbaron at redhat dot com, tglx at linutronix dot de, mhiramat at redhat dot com, systemtap at sources dot redhat dot com, linux-kernel at vger dot kernel dot org, hpa at zytor dot com, paulus at samba dot org, jkenisto at us dot ibm dot com, hch at infradead dot org, ananth at in dot ibm dot com, srikar at linux dot vnet dot ibm dot com, prasad at linux dot vnet dot ibm dot com, mingo at elte dot hu
Commit-ID: 96c96612e952f63cc0055db9df7d8b5b1ada02be
Gitweb: http://git.kernel.org/tip/96c96612e952f63cc0055db9df7d8b5b1ada02be
Author: Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Wed, 16 Dec 2009 17:24:00 -0500
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 17 Dec 2009 09:42:43 +0100
perf probe: Check whether debugfs path is correct
Check whether the debugfs path is correct before executing
a command, because perf-probe depends on debugfs.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Jason Baron <jbaron@redhat.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
LKML-Reference: <20091216222400.14459.48162.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/builtin-probe.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 7e741f5..c1e6774 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -38,6 +38,7 @@
#include "util/strlist.h"
#include "util/event.h"
#include "util/debug.h"
+#include "util/debugfs.h"
#include "util/symbol.h"
#include "util/thread.h"
#include "util/session.h"
@@ -205,6 +206,9 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
if ((!session.nr_probe && !session.dellist && !session.list_events))
usage_with_options(probe_usage, options);
+ if (debugfs_valid_mountpoint(debugfs_path) < 0)
+ die("Failed to find debugfs path.");
+
if (session.list_events) {
if (session.nr_probe != 0 || session.dellist) {
pr_warning(" Error: Don't use --list with"