summaryrefslogtreecommitdiff
path: root/lib/igt_aux.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-07-27 14:48:59 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-07-28 14:21:50 +0200
commit6e1ccfa1430170c975f8c474b7a49be5bd121ed7 (patch)
tree43f2dac0d38128e8bc6f79fd7b6a09af6aa09cd3 /lib/igt_aux.c
parentf145475173b6d28e550dde27cc361cfb517cbbc3 (diff)
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 <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r--lib/igt_aux.c17
1 files changed, 11 insertions, 6 deletions
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)