[PATCH i-g-t 1/2] tests/intel/xe_pm_residency: [DO NOT REVIEW] Assert if sleep more than 120 s

Karthik Poosa karthik.poosa at intel.com
Tue Sep 17 11:38:58 UTC 2024


Assert if sleep > 120 seconds in xe_pm_residency.
Change a print from igt_debug to igt_info to get execution time of
current run.

Signed-off-by: Karthik Poosa <karthik.poosa at intel.com>
---
 tests/intel/xe_pm_residency.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_pm_residency.c b/tests/intel/xe_pm_residency.c
index 0e687558b..716ddc24a 100644
--- a/tests/intel/xe_pm_residency.c
+++ b/tests/intel/xe_pm_residency.c
@@ -139,7 +139,7 @@ static void exec_load(int fd, struct drm_xe_engine_class_instance *hwe, unsigned
 		elapsed = igt_nsec_elapsed(&tv);
 		igt_assert_eq(data->data, done[1]);
 
-		igt_debug("Execution took %.3fms (submit %.1fus, wait %.1fus)\n",
+		igt_info("Execution took %.3fms (submit %.1fus, wait %.1fus)\n",
 			  1e-6 * elapsed,
 			  1e-3 * submit,
 			  1e-3 * (elapsed - submit));
@@ -150,6 +150,9 @@ static void exec_load(int fd, struct drm_xe_engine_class_instance *hwe, unsigned
 		 * Execute the above workload for ~1% of the elapsed time and sleep for
 		 * the rest of the time (~99%)
 		 */
+		igt_info("sleeping for %ld ms\n", ((elapsed / 10)/1000));
+		igt_assert((uint64_t)(elapsed / 10) < (uint64_t)(120 * USEC_PER_SEC));
+
 		usleep(elapsed / 10);
 	} while (!READ_ONCE(*done));
 
-- 
2.25.1



More information about the igt-dev mailing list