Signed-off-by: Thomas Wood <thomas.wood@xxxxxxxxx> --- lib/igt_core.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/igt_core.c b/lib/igt_core.c index 925d78c..1307fa8 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -366,6 +366,7 @@ static void low_mem_killer_disable(bool disable) } #define write_log_msg(x) write(STDERR_FILENO, x, strlen(x)) +#define write_log_char(x) write(STDERR_FILENO, &x, 1) static void clear_log(void) { uint8_t i; @@ -439,6 +440,24 @@ static void common_exit_handler(int sig) * called. */ assert(sig != 0 || igt_exit_called); + if (sig) { + int sigtmp; + char c; + int start = 1; + + write_log_msg("--- Received signal "); + + /* write out the signal number, in a signal safe manner */ + sigtmp = sig; + for (sigtmp = sig; sigtmp > 10; sigtmp /= 10) + start *= 10; + for (; start != 0; start /= 10) { + c = '0' + (sig / start) % 10; + write_log_char(c); + } + write_log_msg("\n"); + } + /* write the log out to a file if a signal was received or a simple * test failed (tests with subtests write the log after the subtest * failure) */ -- 2.1.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx