Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@xxxxxxxxx> --- tests/perf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/perf.c b/tests/perf.c index 279ff0c6..65a1606d 100644 --- a/tests/perf.c +++ b/tests/perf.c @@ -1271,9 +1271,7 @@ read_2_oa_reports(int format_id, /* Note: we allocate a large buffer so that each read() iteration * should scrape *all* pending records. * - * The largest buffer the OA unit supports is 16MB and the smallest - * OA report format is 64bytes allowing up to 262144 reports to - * be buffered. + * The largest buffer the OA unit supports is 16MB. * * Being sure we are fetching all buffered reports allows us to * potentially throw away / skip all reports whenever we see @@ -1286,7 +1284,8 @@ read_2_oa_reports(int format_id, * to indicate that the OA unit may be over taxed if lots of reports * are being lost. */ - int buf_size = 262144 * (64 + sizeof(struct drm_i915_perf_record_header)); + int max_reports = (16 * 1024 * 1024) / format_size; + int buf_size = sample_size * max_reports * 1.5; uint8_t *buf = malloc(buf_size); int n = 0; @@ -1298,6 +1297,7 @@ read_2_oa_reports(int format_id, ; igt_assert(len > 0); + igt_debug("read %d bytes\n", (int)len); for (size_t offset = 0; offset < len; offset += header->size) { const uint32_t *report; -- 2.13.3 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx