[tip:perf/urgent] perf probe: Check hyphen only argument

From: tip-bot for Masami Hiramatsu
Date: Tue Dec 15 2009 - 14:29:38 EST


Commit-ID: ce11a603ae40e0ad32aeb378cff81e3fdaec390d
Gitweb: http://git.kernel.org/tip/ce11a603ae40e0ad32aeb378cff81e3fdaec390d
Author: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
AuthorDate: Tue, 15 Dec 2009 10:31:28 -0500
Committer: Ingo Molnar <mingo@xxxxxxx>
CommitDate: Tue, 15 Dec 2009 20:22:00 +0100

perf probe: Check hyphen only argument

Check hyphen only command argument, because perf-probe doesn't
support event recording feature yet.

e.g.

# perf probe -
Error: '-' is not supported.

Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Jim Keniston <jkenisto@xxxxxxxxxx>
Cc: Ananth N Mavinakayanahalli <ananth@xxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Cc: Frank Ch. Eigler <fche@xxxxxxxxxx>
Cc: Jason Baron <jbaron@xxxxxxxxxx>
Cc: K.Prasad <prasad@xxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>
Cc: systemtap <systemtap@xxxxxxxxxxxxxxxxxx>
Cc: DLE <dle-develop@xxxxxxxxxxxxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
LKML-Reference: <20091215153128.17436.9266.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
tools/perf/builtin-probe.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 559eeb4..919037b 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -205,8 +205,13 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)

argc = parse_options(argc, argv, options, probe_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
- if (argc > 0)
+ if (argc > 0) {
+ if (strcmp(argv[0], "-") == 0) {
+ pr_warning(" Error: '-' is not supported.\n");
+ usage_with_options(probe_usage, options);
+ }
parse_probe_event_argv(argc, argv);
+ }

if ((!session.nr_probe && !session.dellist && !session.list_events))
usage_with_options(probe_usage, options);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/