From: Masami Hiramatsu Date: Tue, 15 Dec 2009 15:31:28 +0000 (-0500) Subject: perf probe: Check hyphen only argument X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ce11a603ae40e0ad32aeb378cff81e3fdaec390d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo Cc: Steven Rostedt Cc: Jim Keniston Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Frank Ch. Eigler Cc: Jason Baron Cc: K.Prasad Cc: Peter Zijlstra Cc: Srikar Dronamraju Cc: systemtap Cc: DLE Cc: Frederic Weisbecker LKML-Reference: <20091215153128.17436.9266.stgit@dhcp-100-2-132.bos.redhat.com> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 559eeb42c5e7..919037bc9808 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);