diff options
author | Andi Kleen <ak@linux.intel.com> | 2012-10-26 16:30:06 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-28 09:29:52 -0400 |
commit | 9175ce1f1244edd9f4d39605aa06ce5b0a50b8e0 (patch) | |
tree | 1b988361153dfd19909e1130ee02545509927461 /tools/perf | |
parent | 9db55064940db1447976945d07402a923e818962 (diff) |
perf tools: Move parse_events error printing to parse_events_options
The callers of parse_events usually have their own error handling. Move
the fprintf for a bad event to parse_events_options, which is the only
one who should need it.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1351283415-13170-25-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/parse-events.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 3a3efcf3e4e9..c0b785b50849 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -827,8 +827,6 @@ int parse_events(struct perf_evlist *evlist, const char *str, | |||
827 | * Both call perf_evlist__delete in case of error, so we dont | 827 | * Both call perf_evlist__delete in case of error, so we dont |
828 | * need to bother. | 828 | * need to bother. |
829 | */ | 829 | */ |
830 | fprintf(stderr, "invalid or unsupported event: '%s'\n", str); | ||
831 | fprintf(stderr, "Run 'perf list' for a list of valid events\n"); | ||
832 | return ret; | 830 | return ret; |
833 | } | 831 | } |
834 | 832 | ||
@@ -836,7 +834,13 @@ int parse_events_option(const struct option *opt, const char *str, | |||
836 | int unset __maybe_unused) | 834 | int unset __maybe_unused) |
837 | { | 835 | { |
838 | struct perf_evlist *evlist = *(struct perf_evlist **)opt->value; | 836 | struct perf_evlist *evlist = *(struct perf_evlist **)opt->value; |
839 | return parse_events(evlist, str, unset); | 837 | int ret = parse_events(evlist, str, unset); |
838 | |||
839 | if (ret) { | ||
840 | fprintf(stderr, "invalid or unsupported event: '%s'\n", str); | ||
841 | fprintf(stderr, "Run 'perf list' for a list of valid events\n"); | ||
842 | } | ||
843 | return ret; | ||
840 | } | 844 | } |
841 | 845 | ||
842 | int parse_filter(const struct option *opt, const char *str, | 846 | int parse_filter(const struct option *opt, const char *str, |