From: Cristian Ciocaltea Date: Tue, 4 Jan 2022 16:56:46 +0000 (+0200) Subject: virgl/ci: Do not hide crosvm output messages X-Git-Tag: upstream/22.3.5~13875 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aec7eaf3e3ff17d77b95399a7e2272e654aaff28;p=platform%2Fupstream%2Fmesa.git virgl/ci: Do not hide crosvm output messages In some corner cases like the kernel oops, we do not get the relevant log messages from crosvm process to help with debugging. Note there is currently a double redirection of its stdout stream, but the content eventually ends up in /dev/null. Let's fix this by redirecting both stdout and stderr streams to a dedicated file, to avoid clobbering the output from the script/program running inside crosvm. This is particularly required for the scenario that involves deqp-runner starting crosvm via a *.toml suite. Additionally, drop the unnecessary usage of 'stdbuf' and set the 'quiet' kernel command-line parameter to get rid of the noise generated during crosvm boot process. Although not directly related, do some cleanup by removing the temporary folder on script exit. Signed-off-by: Cristian Ciocaltea Reviewed-by: Rohan Garg Reviewed-by: Tomeu Vizoso Part-of: --- diff --git a/.gitlab-ci/crosvm-runner.sh b/.gitlab-ci/crosvm-runner.sh index d908aa2..119a427 100755 --- a/.gitlab-ci/crosvm-runner.sh +++ b/.gitlab-ci/crosvm-runner.sh @@ -12,7 +12,7 @@ fi export -p > $DEQP_TEMP_DIR/crosvm-env.sh -CROSVM_KERNEL_ARGS="console=null root=my_root rw rootfstype=virtiofs init=$CI_PROJECT_DIR/install/crosvm-init.sh ip=192.168.30.2::192.168.30.1:255.255.255.0:crosvm:eth0 -- $DEQP_TEMP_DIR" +CROSVM_KERNEL_ARGS="quiet console=null root=my_root rw rootfstype=virtiofs init=$CI_PROJECT_DIR/install/crosvm-init.sh ip=192.168.30.2::192.168.30.1:255.255.255.0:crosvm:eth0 -- $DEQP_TEMP_DIR" echo $@ > $DEQP_TEMP_DIR/crosvm-script.sh @@ -30,10 +30,10 @@ tail -f $DEQP_TEMP_DIR/stdout > /dev/stdout & OUT_TAIL_PID=$! trap "exit \$exit_code" INT TERM -trap "exit_code=\$?; kill $ERR_TAIL_PID $OUT_TAIL_PID" EXIT +trap "exit_code=\$?; kill $ERR_TAIL_PID $OUT_TAIL_PID; rm -rf $DEQP_TEMP_DIR" EXIT # We aren't testing LLVMPipe here, so we don't need to validate NIR on the host -NIR_DEBUG="novalidate" LIBGL_ALWAYS_SOFTWARE="true" GALLIUM_DRIVER="$CROSVM_GALLIUM_DRIVER" stdbuf -oL crosvm run \ +NIR_DEBUG="novalidate" LIBGL_ALWAYS_SOFTWARE="true" GALLIUM_DRIVER="$CROSVM_GALLIUM_DRIVER" crosvm run \ --gpu "$CROSVM_GPU_ARGS" \ -m 4096 \ -c 2 \ @@ -41,7 +41,11 @@ NIR_DEBUG="novalidate" LIBGL_ALWAYS_SOFTWARE="true" GALLIUM_DRIVER="$CROSVM_GALL --shared-dir /:my_root:type=fs:writeback=true:timeout=60:cache=always \ --host_ip=192.168.30.1 --netmask=255.255.255.0 --mac "AA:BB:CC:00:00:12" \ -p "$CROSVM_KERNEL_ARGS" \ - /lava-files/bzImage >> $DEQP_TEMP_DIR/stderr > /dev/null + /lava-files/bzImage > $DEQP_TEMP_DIR/crosvm 2>&1 + +RET=$(cat $DEQP_TEMP_DIR/exit_code || true) + +# Got no exit code from the script, show crosvm output to help with debugging +[ -n "$RET" ] || cat $DEQP_TEMP_DIR/crosvm || true -RET=$(cat $DEQP_TEMP_DIR/exit_code) exit ${RET:-1}