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>
This commit is contained in:
parent
27f3b24de0
commit
96c96612e9
|
@ -38,6 +38,7 @@
|
||||||
#include "util/strlist.h"
|
#include "util/strlist.h"
|
||||||
#include "util/event.h"
|
#include "util/event.h"
|
||||||
#include "util/debug.h"
|
#include "util/debug.h"
|
||||||
|
#include "util/debugfs.h"
|
||||||
#include "util/symbol.h"
|
#include "util/symbol.h"
|
||||||
#include "util/thread.h"
|
#include "util/thread.h"
|
||||||
#include "util/session.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))
|
if ((!session.nr_probe && !session.dellist && !session.list_events))
|
||||||
usage_with_options(probe_usage, options);
|
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.list_events) {
|
||||||
if (session.nr_probe != 0 || session.dellist) {
|
if (session.nr_probe != 0 || session.dellist) {
|
||||||
pr_warning(" Error: Don't use --list with"
|
pr_warning(" Error: Don't use --list with"
|
||||||
|
|
Loading…
Reference in a new issue