aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2011-05-22 02:17:22 +0200
committerFrederic Weisbecker <fweisbec@gmail.com>2011-05-22 03:38:49 +0200
commit5538becaec9ca2ff21e7826372941dc46f498487 (patch)
tree66b51fae732a6993f4af1434a1ffe4a83110c71c /tools/perf/util/session.c
parent98e1da905cbe64bb023a165c7c01eef5e800609e (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/util/session.c')
-rw-r--r--tools/perf/util/session.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 8940fd871ea..948327d9e92 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -480,6 +480,7 @@ static void flush_sample_queue(struct perf_session *s,
struct perf_sample sample;
u64 limit = os->next_flush;
u64 last_ts = os->last_sample ? os->last_sample->timestamp : 0ULL;
+ int ret;
if (!ops->ordered_samples || !limit)
return;
@@ -488,9 +489,12 @@ static void flush_sample_queue(struct perf_session *s,
if (iter->timestamp > limit)
break;
- perf_session__parse_sample(s, iter->event, &sample);
- perf_session_deliver_event(s, iter->event, &sample, ops,
- iter->file_offset);
+ ret = perf_session__parse_sample(s, iter->event, &sample);
+ if (ret)
+ pr_err("Can't parse sample, err = %d\n", ret);
+ else
+ perf_session_deliver_event(s, iter->event, &sample, ops,
+ iter->file_offset);
os->last_flush = iter->timestamp;
list_del(&iter->list);
@@ -806,7 +810,9 @@ static int perf_session__process_event(struct perf_session *session,
/*
* For all kernel events we get the sample data
*/
- perf_session__parse_sample(session, event, &sample);
+ ret = perf_session__parse_sample(session, event, &sample);
+ if (ret)
+ return ret;
/* Preprocess sample records - precheck callchains */
if (perf_session__preprocess_sample(session, event, &sample))