Mesa (main): virgl/ci: Do not hide crosvm output messages

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 18 19:13:49 UTC 2022


Module: Mesa
Branch: main
Commit: aec7eaf3e3ff17d77b95399a7e2272e654aaff28
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=aec7eaf3e3ff17d77b95399a7e2272e654aaff28

Author: Cristian Ciocaltea <cristian.ciocaltea at collabora.com>
Date:   Tue Jan  4 18:56:46 2022 +0200

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 <cristian.ciocaltea at collabora.com>
Reviewed-by: Rohan Garg <rohan.garg at intel.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14413>

---

 .gitlab-ci/crosvm-runner.sh | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci/crosvm-runner.sh b/.gitlab-ci/crosvm-runner.sh
index d908aa2e7eb..119a4276a70 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}



More information about the mesa-commit mailing list