[PATCH i-g-t 5/6] tests/intel/xe_oa: Reduce test_non_zero_reason execution time

Ashutosh Dixit ashutosh.dixit at intel.com
Tue Apr 8 18:12:09 UTC 2025


Only check every 128th report to reduce test execution time. Without this
patch execution times for buffer-size subtest for OA buffer sizes > 16
M (with PEC report sanity checks) are excessive. E.g. for 128 MB size:

	Starting subtest: buffer-size
	Starting dynamic subtest: ccs-0-128M
	Dynamic subtest ccs-0-128M: SUCCESS (133.654s)
	Subtest buffer-size: SUCCESS (133.654s)

With this patch:

	Starting subtest: buffer-size
	Starting dynamic subtest: ccs-0-128M
	Dynamic subtest ccs-0-128M: SUCCESS (11.209s)
	Subtest buffer-size: SUCCESS (11.209s)

Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
---
 tests/intel/xe_oa.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
index cc9702322d..f3ce37ff5a 100644
--- a/tests/intel/xe_oa.c
+++ b/tests/intel/xe_oa.c
@@ -2646,13 +2646,14 @@ test_non_zero_reason(const struct drm_xe_engine_class_instance *hwe, size_t oa_b
 	igt_debug("Got %u bytes\n", total_len);
 
 	last_report = NULL;
-	for (uint32_t offset = 0; offset < total_len; offset += report_size) {
+	for (uint32_t offset = 0, n = 0; offset < total_len; offset += report_size) {
 		const uint32_t *report = (void *) (buf + offset);
 		uint32_t reason = (report[0] >> OAREPORT_REASON_SHIFT) & OAREPORT_REASON_MASK;
 
 		igt_assert_neq(reason, 0);
 
-		if (last_report) {
+		/* Only check every 128th report to reduce test execution time */
+		if (last_report && !(n++ % 128)) {
 			sanity_check_reports(last_report, report, fmt);
 			pec_sanity_check_reports(last_report, report, metric_set(hwe));
 		}
-- 
2.48.1



More information about the igt-dev mailing list