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-top.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-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 7e3d6e310bf8..74f533cbf6ca 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -805,9 +805,14 @@ static void perf_session__mmap_read_cpu(struct perf_session *self, int cpu) | |||
805 | { | 805 | { |
806 | struct perf_sample sample; | 806 | struct perf_sample sample; |
807 | union perf_event *event; | 807 | union perf_event *event; |
808 | int ret; | ||
808 | 809 | ||
809 | while ((event = perf_evlist__read_on_cpu(top.evlist, cpu)) != NULL) { | 810 | while ((event = perf_evlist__read_on_cpu(top.evlist, cpu)) != NULL) { |
810 | perf_session__parse_sample(self, event, &sample); | 811 | ret = perf_session__parse_sample(self, event, &sample); |
812 | if (ret) { | ||
813 | pr_err("Can't parse sample, err = %d\n", ret); | ||
814 | continue; | ||
815 | } | ||
811 | 816 | ||
812 | if (event->header.type == PERF_RECORD_SAMPLE) | 817 | if (event->header.type == PERF_RECORD_SAMPLE) |
813 | perf_event__process_sample(event, &sample, self); | 818 | perf_event__process_sample(event, &sample, self); |