From e7e6f709389be9744841d42dade3fcee8e8c6a30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcin=20=C5=9Alusarz?= Date: Wed, 10 Jun 2020 15:29:53 +0200 Subject: [PATCH] intel/perf: fix calculation of used counter space MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It matters only when counters are not ordered by offset. Signed-off-by: Marcin Ślusarz Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/perf/gen_perf_query.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/intel/perf/gen_perf_query.c b/src/intel/perf/gen_perf_query.c index 57b01203a6f..755ec9a83dd 100644 --- a/src/intel/perf/gen_perf_query.c +++ b/src/intel/perf/gen_perf_query.c @@ -1469,7 +1469,9 @@ get_oa_counter_data(struct gen_perf_context *perf_ctx, /* So far we aren't using uint32, double or bool32... */ unreachable("unexpected counter data type"); } - written = counter->offset + counter_size; + + if (counter->offset + counter_size > written) + written = counter->offset + counter_size; } } -- 2.30.2