diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2011-05-21 20:17:22 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2011-05-21 21:38:49 -0400 |
commit | 5538becaec9ca2ff21e7826372941dc46f498487 (patch) | |
tree | 66b51fae732a6993f4af1434a1ffe4a83110c71c /tools/perf/builtin-test.c | |
parent | 98e1da905cbe64bb023a165c7c01eef5e800609e (diff) |
perf tools: Propagate event parse error handling
Better handle event parsing error by propagating the details
in upper layers or by dumping some failure message. So that
the user knows he has some crazy events in the batch.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Diffstat (limited to 'tools/perf/builtin-test.c')
-rw-r--r-- | tools/perf/builtin-test.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c index 44d7df280430..1fa9f58c2af2 100644 --- a/tools/perf/builtin-test.c +++ b/tools/perf/builtin-test.c | |||
@@ -559,8 +559,13 @@ static int test__basic_mmap(void) | |||
559 | goto out_munmap; | 559 | goto out_munmap; |
560 | } | 560 | } |
561 | 561 | ||
562 | perf_event__parse_sample(event, attr.sample_type, sample_size, | 562 | err = perf_event__parse_sample(event, attr.sample_type, sample_size, |
563 | false, &sample); | 563 | false, &sample); |
564 | if (err) { | ||
565 | pr_err("Can't parse sample, err = %d\n", err); | ||
566 | goto out_munmap; | ||
567 | } | ||
568 | |||
564 | evsel = perf_evlist__id2evsel(evlist, sample.id); | 569 | evsel = perf_evlist__id2evsel(evlist, sample.id); |
565 | if (evsel == NULL) { | 570 | if (evsel == NULL) { |
566 | pr_debug("event with id %" PRIu64 | 571 | pr_debug("event with id %" PRIu64 |