thesofproject / qemu

Official QEMU mirror. Please see http://wiki.qemu.org/Contribute/SubmitAPatch for how to submit changes to QEMU. Pull Requests are ignored. Please only use release tarballs from the QEMU website. SOF - Please use sof-stable branch for SOF development.
http://www.qemu.org
Other
4 stars 14 forks source link

xtensa-host.sh: log the full command including the timeout prefix #44

Closed marc-hb closed 4 years ago

marc-hb commented 4 years ago

Replace the custom and incomplete command logging with a simpler set -x.

../sof/qemu-check.sh and maybe others invoke this script with a non-zero ${TIMEOUT} to stop qemu. This prints the following line every time; even in successful cases which can be confusing qemu-system-xtensa: terminating on signal 15 from pid 9823 (timeout)

Logging the timeout prefix reduces this confusion

Signed-off-by: Marc Herbert marc.herbert@intel.com

crazoes commented 4 years ago

looks good :+1:

crazoes commented 4 years ago

../sof/qemu-check.sh and maybe others invoke this script with a non-zero ${TIMEOUT} to stop qemu. This prints the following line every time; even in successful cases which can be confusing qemu-system-xtensa: terminating on signal 15 from pid 9823 (timeout)

Why'd timeout send TERM if it didn't actually timeout though? This message gets printed by qemu after receiving a shutdown request. And TERM is sent on timeout..?

marc-hb commented 4 years ago

It's possible to tell qemu to quit but it requires much more code than simply asking timeout to send TERM to qemu.

crazoes commented 4 years ago

This prints the following line every time; even in successful cases which can be confusing qemu-system-xtensa: terminating on signal 15 from pid 9823 (timeout)

I don't understand how this(printing timeout even in successful cases) happens? timeout cannot send a SIGTERM without the timeout happening and qemu prints qemu-system-xtensa: terminating on signal 15 from pid 9823 (timeout) on receiving SIGTERM before quitting.

marc-hb commented 4 years ago

This script is not a test. The test is not here, it's in qemu-check.sh. See https://github.com/thesofproject/sof/pull/3101

When invoked by qemu-check.sh, this script runs qemu for 2 seconds and kills it after 2 seconds. That's all it does and it always prints the timeout message. Then, later, qemu-check.sh decides whether the test has been successful or not.