summaryrefslogtreecommitdiff
path: root/lib/igt_aux.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-11-14 13:19:01 +0000
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2017-11-16 16:27:54 +0200
commit936b97165308e179880fc0f218192881953f2544 (patch)
treec677b1ce7ba5b03269bb12c9d8dd5710db131ff2 /lib/igt_aux.c
parent405ae11df35c883df446e7e2539d2df0c9c19a1e (diff)
lib: Dump /sys/kernel/debug/suspend_stats after suspend failure
I noticed that dpm was storing some information about which phase of suspend failed inside suspend_stats. That will be useful to help debug such failures, so automatically dump it after suspend fails. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r--lib/igt_aux.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index ee53559c..0bcf792c 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -803,10 +803,24 @@ static void suspend_via_rtcwake(enum igt_suspend_state state)
snprintf(cmd, sizeof(cmd), "rtcwake -s %d -m %s ",
delay, suspend_state_name[state]);
ret = igt_system(cmd);
- igt_assert_f(ret == 0,
- "rtcwake failed with %i\n"
- "Check dmesg for further details.\n",
- ret);
+ if (ret) {
+ const char *path = "suspend_stats";
+ char *info;
+ int dir;
+
+ igt_warn("rtcwake failed with %i\n"
+ "Check dmesg for further details.\n",
+ ret);
+
+ dir = open(igt_debugfs_mount(), O_RDONLY);
+ info = igt_sysfs_get(dir, path);
+ close(dir);
+ if (info) {
+ igt_debug("%s:\n%s\n", path, info);
+ free(info);
+ }
+ }
+ igt_assert_eq(ret, 0);
}
static void suspend_via_sysfs(int power_dir, enum igt_suspend_state state)