aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2011-05-21 20:17:22 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2011-05-21 21:38:49 -0400
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 8940fd871eae..948327d9e92b 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,
480 struct perf_sample sample; 480 struct perf_sample sample;
481 u64 limit = os->next_flush; 481 u64 limit = os->next_flush;
482 u64 last_ts = os->last_sample ? os->last_sample->timestamp : 0ULL; 482 u64 last_ts = os->last_sample ? os->last_sample->timestamp : 0ULL;
483 int ret;
483 484
484 if (!ops->ordered_samples || !limit) 485 if (!ops->ordered_samples || !limit)
485 return; 486 return;
@@ -488,9 +489,12 @@ static void flush_sample_queue(struct perf_session *s,
488 if (iter->timestamp > limit) 489 if (iter->timestamp > limit)
489 break; 490 break;
490 491
491 perf_session__parse_sample(s, iter->event, &sample); 492 ret = perf_session__parse_sample(s, iter->event, &sample);
492 perf_session_deliver_event(s, iter->event, &sample, ops, 493 if (ret)
493 iter->file_offset); 494 pr_err("Can't parse sample, err = %d\n", ret);
495 else
496 perf_session_deliver_event(s, iter->event, &sample, ops,
497 iter->file_offset);
494 498
495 os->last_flush = iter->timestamp; 499 os->last_flush = iter->timestamp;
496 list_del(&iter->list); 500 list_del(&iter->list);
@@ -806,7 +810,9 @@ static int perf_session__process_event(struct perf_session *session,
806 /* 810 /*
807 * For all kernel events we get the sample data 811 * For all kernel events we get the sample data
808 */ 812 */
809 perf_session__parse_sample(session, event, &sample); 813 ret = perf_session__parse_sample(session, event, &sample);
814 if (ret)
815 return ret;
810 816
811 /* Preprocess sample records - precheck callchains */ 817 /* Preprocess sample records - precheck callchains */
812 if (perf_session__preprocess_sample(session, event, &sample)) 818 if (perf_session__preprocess_sample(session, event, &sample))