[Intel-gfx] [PATCH i-g-t] lib/aux: Better debug output for rtcwake
Daniel Vetter
daniel.vetter at ffwll.ch
Thu Jul 27 13:10:20 UTC 2017
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 at intel.com
Acked-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
lib/igt_aux.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 86a213c2032f..f428f1590bfa 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)
--
2.13.3
More information about the Intel-gfx
mailing list