[igt-dev] [PATCH i-g-t 2/2] runner/resume: change exit code for results gen fail

Petri Latvala adrinael at adrinael.net
Wed Mar 1 13:24:55 UTC 2023


On Tue, Feb 28, 2023 at 10:25:38PM +0100, Kamil Konieczny wrote:
> When results generation fails exit with code 3, it will help
> to differentiate from failed exection at resume runs. Added
> also some debug messages at different error points.
> 
> Cc: Petri Latvala <adrinael at adrinael.net>
> Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

Reviewed-by: Petri Latvala <adrinael at adrinael.net>


> ---
>  runner/resume.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/runner/resume.c b/runner/resume.c
> index eb8074e3..0f4e42bf 100644
> --- a/runner/resume.c
> +++ b/runner/resume.c
> @@ -31,10 +31,13 @@ int main(int argc, char **argv)
>  		return 127;
>  	}
>  
> -	if (!initialize_execute_state_from_resume(dirfd, &state, &settings, &job_list))
> +	if (!initialize_execute_state_from_resume(dirfd, &state, &settings, &job_list)) {
> +		fprintf(stderr, "resume failed at initialization step\n");
>  		return 127;
> +	}
>  
>  	if (!execute(&state, &settings, &job_list)) {
> +		fprintf(stderr, "resume failed at execute step\n");
>  		exitcode = 1;
>  	}
>  
> @@ -43,11 +46,13 @@ int main(int argc, char **argv)
>  		 * Overall timeout happened. Results generation can
>  		 * override this
>  		 */
> +		fprintf(stderr, "resume failed at timeout\n");
>  		exitcode = 2;
>  	}
>  
>  	if (!generate_results_path(settings.results_path)) {
> -		exitcode = 1;
> +		fprintf(stderr, "resume failed at generating results\n");
> +		exitcode = 3;
>  	}
>  
>  	printf("Done.\n");
> -- 
> 2.37.2
> 


More information about the igt-dev mailing list