[PATCH i-g-t 1/1] lib/igt_core: capture logs for child processes

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Mar 13 14:28:28 UTC 2025


On Thu, Mar 13, 2025 at 01:50:04PM +0100, Pawel Sikora wrote:
> This change addresses the issue of missing logs for child
> processes in the IGT runner.
> 
> The '_igt_log_buffer_dump()' function is now called before
> exiting child processes, ensuring that logs are properly
> captured and not lost when IGT fails and child processes
> dump logs before exiting.
> 
> Signed-off-by: Pawel Sikora <pawel.sikora at linux.intel.com>
> ---
>  lib/igt_core.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 9702a9417..33e5ca7cd 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -1905,12 +1905,11 @@ void igt_fail(int exitcode)
>  		failed_one = true;
>  	}
>  
> -	/* Silent exit, parent will do the yelling. */
> +	_igt_log_buffer_dump();
> +
>  	if (test_child)
>  		exit(exitcode);
>  
> -	_igt_log_buffer_dump();
> -

I've tested your patch and it seems without it forked children
don't flush collected log (with backtrace). With runner there's
mixed collected interleaved logs but separated children backtraces
are better readable.

So from me:

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

--
Zbigniew


>  	if (test_multi_fork_child)
>  		exit(exitcode);
>  
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list