[PATCH i-g-t 4/8] Adding debug gem objects

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Jul 11 05:56:38 UTC 2022


---
 tests/i915/gem_ppgtt.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
index df5bdb4dac..24ed5e2074 100644
--- a/tests/i915/gem_ppgtt.c
+++ b/tests/i915/gem_ppgtt.c
@@ -299,6 +299,17 @@ static bool has_contexts(void)
 
 	return result;
 }
+static void dump_object_stats(int interval, int timeout)
+{
+	int i915;
+
+	i915 = drm_open_driver(DRIVER_INTEL);
+	for (int n = 0; n < timeout; n += interval) {
+		igt_debugfs_dump(i915, "i915_gem_objects");
+		sleep(interval);
+	}
+	close(i915);
+}
 
 igt_main
 {
@@ -318,6 +329,7 @@ igt_main
 		struct intel_buf *bcs[1], **rcs;
 		int nchild = ncpus + 1;
 		uint64_t mem_per_test;
+		int timeout = 30;
 
 		/* Temporary meminfo dump*/
 		dump_file("meminfo before drop-caches", "/proc/meminfo", 16);
@@ -333,8 +345,10 @@ igt_main
 		rcs = calloc(sizeof(*rcs), nchild);
 		igt_assert(rcs);
 
-		fork_bcs_copy(30, 0x4000, bcs, 1);
-		fork_rcs_copy(30, 0x8000 / nchild, rcs, nchild, 0);
+		fork_bcs_copy(timeout, 0x4000, bcs, 1);
+		fork_rcs_copy(timeout, 0x8000 / nchild, rcs, nchild, 0);
+
+		dump_object_stats(5, timeout);
 
 		igt_waitchildren();
 
@@ -355,6 +369,7 @@ igt_main
 		uint64_t mem_per_ctx = 2 * 128 * 1024; /* rough context sizes */
 		uint64_t mem_per_test;
 		int nchild = ncpus + 1;
+		int timeout = 30;
 
 		igt_require(has_contexts());
 
@@ -364,8 +379,10 @@ igt_main
 		rcs = calloc(sizeof(*rcs), nchild);
 		igt_assert(rcs);
 
-		fork_rcs_copy(30, 0x8000 / nchild, rcs, nchild, CREATE_CONTEXT);
-		fork_bcs_copy(30, 0x4000, bcs, 1);
+		fork_rcs_copy(timeout, 0x8000 / nchild, rcs, nchild, CREATE_CONTEXT);
+		fork_bcs_copy(timeout, 0x4000, bcs, 1);
+
+		dump_object_stats(5, timeout);
 
 		igt_waitchildren();
 
-- 
2.34.1



More information about the Intel-gfx-trybot mailing list