aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-probe.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2009-12-16 17:24:00 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-17 03:42:43 -0500
commit96c96612e952f63cc0055db9df7d8b5b1ada02be (patch)
tree63449cbf9733ee5b23bddd5a563068cf666be575 /tools/perf/builtin-probe.c
parent27f3b24de03fc7cec6f2406f8525ad18086c2121 (diff)
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>
Diffstat (limited to 'tools/perf/builtin-probe.c')
-rw-r--r--tools/perf/builtin-probe.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 7e741f54d798..c1e6774fd3ed 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -38,6 +38,7 @@
38#include "util/strlist.h" 38#include "util/strlist.h"
39#include "util/event.h" 39#include "util/event.h"
40#include "util/debug.h" 40#include "util/debug.h"
41#include "util/debugfs.h"
41#include "util/symbol.h" 42#include "util/symbol.h"
42#include "util/thread.h" 43#include "util/thread.h"
43#include "util/session.h" 44#include "util/session.h"
@@ -205,6 +206,9 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
205 if ((!session.nr_probe && !session.dellist && !session.list_events)) 206 if ((!session.nr_probe && !session.dellist && !session.list_events))
206 usage_with_options(probe_usage, options); 207 usage_with_options(probe_usage, options);
207 208
209 if (debugfs_valid_mountpoint(debugfs_path) < 0)
210 die("Failed to find debugfs path.");
211
208 if (session.list_events) { 212 if (session.list_events) {
209 if (session.nr_probe != 0 || session.dellist) { 213 if (session.nr_probe != 0 || session.dellist) {
210 pr_warning(" Error: Don't use --list with" 214 pr_warning(" Error: Don't use --list with"