lib: Tidy error message for a helper process who unexpectedly dies

Transform

gem_exec_suspend: igt_core.c:1429: igt_stop_helper: Assertion `(((signed char) ((((__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))) & 0x7f) + 1) >> 1) > 0) && (((__extension__ (((union { __typeof(status) __in; int __i; }) { .__in = (status) }).__i))) & 0x7f) == (proc->use_SIGKILL ? 9 : 15)' failed.

into

(gem_exec_suspend:16589) igt-core-DEBUG: Helper died too early with status=0
gem_exec_suspend: igt_core.c:1437: igt_stop_helper: Assertion `helper_was_alive(proc, status)' failed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-03-29 17:19:31 +01:00
parent 0bd117fa66
commit 2b804c33e7

View File

@ -1305,6 +1305,13 @@ int igt_wait_helper(struct igt_helper_process *proc)
return status;
}
static bool helper_was_alive(struct igt_helper_process *proc,
int status)
{
return (WIFSIGNALED(status) &&
WTERMSIG(status) == (proc->use_SIGKILL ? SIGKILL : SIGTERM));
}
/**
* igt_stop_helper:
* @proc: #igt_helper_process structure
@ -1320,8 +1327,9 @@ void igt_stop_helper(struct igt_helper_process *proc)
kill(proc->pid, proc->use_SIGKILL ? SIGKILL : SIGTERM);
status = igt_wait_helper(proc);
assert(WIFSIGNALED(status) &&
WTERMSIG(status) == (proc->use_SIGKILL ? SIGKILL : SIGTERM));
if (!helper_was_alive(proc, status))
igt_debug("Helper died too early with status=%d\n", status);
assert(helper_was_alive(proc, status));
}
static void children_exit_handler(int sig)