[PATCH 2/3] perf, tool: Skip event correctly for unknown id/machine

From: Jiri Olsa
Date: Thu Apr 12 2012 - 08:21:51 EST


In case the perf_session__process_event function fails, we
estimate the next event offset.

This is not necessary for sample event failing on unknown ID
or machine. In such case we know proper size of the event,
so we dont need to guess. Also failure statistics are updated
correctly so we don't miss any information.

Forcing perf_session__process_event to return 0 in case of
unknown ID or machine.

Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
---
tools/perf/util/session.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 9412e3b..9189751 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -868,11 +868,11 @@ static int perf_session_deliver_event(struct perf_session *session,
dump_sample(session, event, sample);
if (evsel == NULL) {
++session->hists.stats.nr_unknown_id;
- return -1;
+ return 0;
}
if (machine == NULL) {
++session->hists.stats.nr_unprocessable_samples;
- return -1;
+ return 0;
}
return tool->sample(tool, event, sample, evsel, machine);
case PERF_RECORD_MMAP:
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/