[igt-dev] [PATCH i-g-t v3] runner: Show kernel state on detecting test timeout

Petri Latvala petri.latvala at intel.com
Mon Oct 14 06:58:35 UTC 2019


On Fri, Oct 11, 2019 at 02:22:37PM +0100, Chris Wilson wrote:
> When our watchdog expires and we declare the test has timed out, we send
> it a signal to terminate. The test will produce a backtrace upon receipt
> of that signal, but often times (especially as we do test and debug the
> kernel), the test is hung inside the kernel. So we need the kernel state
> to see where the live/deadlock is occuring. Enter sysrq-t to show the
> backtraces of all processes (as the one we are searching for may be
> sleeping).
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Petri Latvala <petri.latvala at intel.com>
> ---
>  runner/executor.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/runner/executor.c b/runner/executor.c
> index 1a00237fc..2bb828278 100644
> --- a/runner/executor.c
> +++ b/runner/executor.c
> @@ -638,6 +638,25 @@ static const char *get_cmdline(pid_t pid, char *buf, ssize_t len)
>  	return buf;
>  }
>  
> +static bool sysrq(char cmd)
> +{
> +	bool success = false;
> +	int fd;
> +
> +	fd = open("/proc/sysrq-trigger", O_WRONLY);
> +	if (fd >= 0) {
> +		success = write(fd, &cmd, 1) == 1;
> +		close(fd);
> +	}


Where does the dump go? Are we able to grab it in the test's dmesg?

-- 
Petri Latvala


More information about the igt-dev mailing list