From: Adrian Hunter Date: Tue, 12 Nov 2013 07:59:33 +0000 (+0200) Subject: perf tests: Handle throttle events in 'object code reading' test X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=48095b721ca54ffa70427185c00473530f4aef06;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git perf tests: Handle throttle events in 'object code reading' test Unhandled events cause an error that fails the test, fix it. Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Adrian Hunter Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/5281DFE5.3000909@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index 6d9dc198a200..85d4919dd623 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c @@ -275,8 +275,19 @@ static int process_event(struct machine *machine, struct perf_evlist *evlist, if (event->header.type == PERF_RECORD_SAMPLE) return process_sample_event(machine, evlist, event, state); - if (event->header.type < PERF_RECORD_MAX) - return machine__process_event(machine, event, NULL); + if (event->header.type == PERF_RECORD_THROTTLE || + event->header.type == PERF_RECORD_UNTHROTTLE) + return 0; + + if (event->header.type < PERF_RECORD_MAX) { + int ret; + + ret = machine__process_event(machine, event, NULL); + if (ret < 0) + pr_debug("machine__process_event failed, event type %u\n", + event->header.type); + return ret; + } return 0; }