[igt-dev] [PATCH i-g-t] igt/pm_rpm: Show the contents of i915_runtime_pm_status on setup

Chris Wilson chris at chris-wilson.co.uk
Wed Dec 5 10:48:18 UTC 2018


To try and help debug situations where the driver has leaked a runtime
reference before executing the pm_rpm tests, show the contents of
i915_runtime_pm_status at startup, which will include all currently held
wakerefs.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/pm_rpm.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index f0d6db525..7427958dc 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -725,6 +725,18 @@ static bool dmc_loaded(void)
 	return strstr(buf, "fw loaded: yes");
 }
 
+static void dump_file(int dir, const char *filename)
+{
+	char *contents;
+
+	contents = igt_sysfs_get(dir, filename);
+	if (!contents)
+		return;
+
+	igt_debug("%s:\n%s\n", filename, contents);
+	free(contents);
+}
+
 static bool setup_environment(void)
 {
 	if (has_runtime_pm)
@@ -744,6 +756,8 @@ static bool setup_environment(void)
 	has_runtime_pm = igt_setup_runtime_pm();
 	setup_pc8();
 
+	dump_file(debugfs, "i915_runtime_pm_status");
+
 	igt_info("Runtime PM support: %d\n", has_runtime_pm);
 	igt_info("PC8 residency support: %d\n", has_pc8);
 	igt_require(has_runtime_pm);
-- 
2.20.0.rc2



More information about the igt-dev mailing list