summaryrefslogtreecommitdiff
path: root/tests/perf.c
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2017-04-25 11:02:11 -0700
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>2017-10-04 13:44:00 +0100
commitbe844d0811c5a1b2a742d1bbb01ee263c16cc9dd (patch)
treea87feba2c7e7ee57f97e209d1914bf4ab0628fee /tests/perf.c
parent8697ba5451c7068aacc3360a2162dd0bb190ac3d (diff)
tests/perf: update max buffer size for reading reports
Make it clear that we're using a 16Mb buffer. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Diffstat (limited to 'tests/perf.c')
-rw-r--r--tests/perf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/perf.c b/tests/perf.c
index b41867a3..fa9edfc4 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -1298,9 +1298,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
@@ -1313,7 +1311,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;
@@ -1325,6 +1324,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;