From 6e1ccfa1430170c975f8c474b7a49be5bd121ed7 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 27 Jul 2017 14:48:59 +0200 Subject: lib/aux: Better debug output for rtcwake Printing the error code is kinda useful. Also tune down the blame shifting away from i915, this could very well be an i915 bug, not just a setup issue. Also move the notice to the require test, not the failure, and suggest to look into dmesg. v2: Dont print errno, igt_require/assert already do that in the failure case (Chris). Acked-by: tomi.p.sarvela@intel.com Acked-by: Chris Wilson Signed-off-by: Daniel Vetter --- lib/igt_aux.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lib/igt_aux.c') diff --git a/lib/igt_aux.c b/lib/igt_aux.c index 86a213c2..f428f159 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -744,7 +744,7 @@ static void set_suspend_test(int power_dir, enum igt_suspend_test test) static void suspend_via_rtcwake(enum igt_suspend_state state) { char cmd[128]; - int delay; + int delay, ret; igt_assert(state < SUSPEND_STATE_NUM); @@ -756,14 +756,19 @@ static void suspend_via_rtcwake(enum igt_suspend_state state) */ snprintf(cmd, sizeof(cmd), "rtcwake -n -s %d -m %s " SQUELCH, delay, suspend_state_name[state]); - igt_require(system(cmd) == 0); + ret = system(cmd); + igt_require_f(ret == 0, "rtcwake test failed with %i\n" + "This failure could mean that something is wrong with " + "the rtcwake tool or how your distro is set up.\n", + ret); snprintf(cmd, sizeof(cmd), "rtcwake -s %d -m %s ", delay, suspend_state_name[state]); - igt_assert_f(system(cmd) == 0, - "This failure means that something is wrong with " - "the rtcwake tool or how your distro is set up. " - "This is not a i915.ko or i-g-t bug.\n"); + ret = system(cmd); + igt_assert_f(ret == 0, + "rtcwake failed with %i\n" + "Check dmesg for further details.\n", + ret); } static void suspend_via_sysfs(int power_dir, enum igt_suspend_state state) -- cgit v1.2.3