From: "Alex Bennée" <alex.bennee@linaro.org>
To: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Cc: qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Daniel P.Berrangé" <berrange@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"Brian Cain" <brian.cain@oss.qualcomm.com>,
"Gustavo Romero" <gustavo.romero@linaro.org>,
"Laurent Vivier" <laurent@vivier.eu>,
"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
"Helge Deller" <deller@gmx.de>,
"Richard Henderson" <richard.henderson@linaro.org>
Subject: Re: [PATCH v3 19/91] tests/tcg/meson.build: add wrapper record_replay
Date: Thu, 09 Jul 2026 17:12:53 +0100 [thread overview]
Message-ID: <878q7krvju.fsf@draig.linaro.org> (raw)
In-Reply-To: <decd7f0d-fd74-4314-8a44-df9f7a75d8d5@oss.qualcomm.com> (Pierrick Bouvier's message of "Thu, 9 Jul 2026 08:10:59 -0700")
Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> writes:
> On 7/9/2026 8:03 AM, Pierrick Bouvier wrote:
>> On 7/9/2026 7:52 AM, Alex Bennée wrote:
>>> Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> writes:
>>>
>>>> Runs a record and replay test, and make sure the output produced by
>>>> both runs is the same.
>>>>
>>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
>>>> ---
>>>> tests/tcg/meson.build | 1 +
>>>> tests/tcg/scripts/record_replay.sh | 16 ++++++++++++++++
>>>> 2 files changed, 17 insertions(+)
>>>> create mode 100755 tests/tcg/scripts/record_replay.sh
>>>>
>>>> diff --git a/tests/tcg/meson.build b/tests/tcg/meson.build
>>>> index 30178df0f7a..e610ce30f40 100644
>>>> --- a/tests/tcg/meson.build
>>>> +++ b/tests/tcg/meson.build
>>>> @@ -7,6 +7,7 @@ if config_host.has_key('GDB')
>>>> endif
>>>> gdb = find_program(gdb_progs, required: false)
>>>> prog_gdb_test = find_program('../guest-debug/run-test.py')
>>>> +prog_record_replay = find_program('./scripts/record_replay.sh')
>>>> prog_run_and_diff = find_program('./scripts/run_and_diff.sh')
>>>> prog_run_with_input = find_program('./scripts/run_with_input.sh')
>>>> prog_run_and_check_forbidden_output = find_program(
>>>> diff --git a/tests/tcg/scripts/record_replay.sh b/tests/tcg/scripts/record_replay.sh
>>>> new file mode 100755
>>>> index 00000000000..57775a2d4c1
>>>> --- /dev/null
>>>> +++ b/tests/tcg/scripts/record_replay.sh
>>>> @@ -0,0 +1,16 @@
>>>> +#!/usr/bin/env bash
>>>
>>> While at it is there any reason this couldn't be plain POSIX shell. I
>>> don't think we explicitly require bash although its super likely to be
>>> on most systems. configure is all POSIX shell.
>>>
>>
>> The main reason for me to use bash is that it supports set -uo pipefail
>> in combination with set -e.
>>
>> Which produces:
>> - exit if a variable is undefined
>> - exit if any command in a pipe sequence fails
>> Without this, script shells are pretty much house of cards waiting to
>> collapse on any corner case.
>>
>> bash is available out of the box at least on macos, msys2, and I expect,
>> every single linux distro out there. Not sure about bsds though.
>>
>> If that's such a big issue, I can port the scripts to sh.
>>
>
> Interestingly, QEMU main Makefile makes bash a defacto requirement,
> since it uses it for every single command to run. The reason is... to
> use -o pipefail.
>
> https://gitlab.com/qemu-project/qemu/-/blob/master/Makefile?ref_type=heads#L17
>
Well it looks like I misremembered as we list bash as a dependency in
qemu-minimal:
packages:
- bash
so I drop my objection.
>>>> +# SPDX-License-Identifier: GPL-2.0-or-later
>>>> +
>>>> +set -euo pipefail
>>>> +
>>>> +if [ $# -lt 2 ]; then
>>>> + echo "record_replay: qemu_bin [args]..." 1>&2
>>>> + exit 1
>>>> +fi
>>>> +qemu="$1";shift
>>>> +tmp=$(mktemp -d)
>>>> +trap "rm -rf $tmp" EXIT
>>>> +set -x
>>>> +$qemu -icount shift=5,rr=record,rrfile=$tmp/rr.bin "$@" |& tee $tmp/record
>>>> +$qemu -icount shift=5,rr=replay,rrfile=$tmp/rr.bin "$@" |& tee $tmp/replay
>>>> +diff $tmp/record $tmp/replay
>>>
>>
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2026-07-09 16:13 UTC|newest]
Thread overview: 144+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 22:32 [PATCH v3 00/91] tests/tcg: run tests with meson Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 01/91] tests/tcg/multiarch/system/memory.c: remove unused variable Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 02/91] tests/tcg/multiarch/plugin/check-plugin-output.sh: take test output as input Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 03/91] tests/tcg/multiarch/plugin: rename check-plugin-output to regex-compare Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 04/91] tests/tcg: introduce meson.build Pierrick Bouvier
2026-07-07 18:10 ` Richard Henderson
2026-07-06 22:32 ` [PATCH v3 05/91] tests/tcg/meson.build: introduce exe_name Pierrick Bouvier
2026-07-07 18:11 ` Richard Henderson
2026-07-06 22:32 ` [PATCH v3 06/91] tests/tcg/meson.build: introduce test_name Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 07/91] tests/tcg/meson.build: introduce cflags Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 08/91] tests/tcg/meson.build: introduce qemu_args Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 09/91] tests/tcg/meson.build: introduce env_var Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 10/91] tests/tcg/plugins: build list of test_plugins Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 11/91] tests/tcg/meson.build: introduce plugin_test Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 12/91] tests/tcg/meson.build: test gdb support and introduce gdb_arch Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 13/91] tests/tcg/meson.build: introduce gdb_test Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 14/91] tests/tcg/meson.build: add default flag for testing compiler support Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 15/91] tests/tcg/meson.build: introduce wrapper Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 16/91] tests/tcg/meson.build: introduce expected_output Pierrick Bouvier
2026-07-07 5:15 ` Manos Pitsidianakis
2026-07-06 22:32 ` [PATCH v3 17/91] tests/tcg/meson.build: add wrapper run_and_check_forbidden_output Pierrick Bouvier
2026-07-07 5:16 ` Manos Pitsidianakis
2026-07-06 22:32 ` [PATCH v3 18/91] tests/tcg/meson.build: add wrapper run_with_input Pierrick Bouvier
2026-07-07 5:21 ` Manos Pitsidianakis
2026-07-06 22:32 ` [PATCH v3 19/91] tests/tcg/meson.build: add wrapper record_replay Pierrick Bouvier
2026-07-09 14:49 ` Alex Bennée
2026-07-09 14:52 ` Alex Bennée
2026-07-09 15:03 ` Pierrick Bouvier
2026-07-09 15:10 ` Pierrick Bouvier
2026-07-09 16:12 ` Alex Bennée [this message]
2026-07-09 16:44 ` Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 20/91] tests/tcg/meson.build: add wrapper check_plugin_output Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 21/91] tests/tcg/meson.build: add logic to skip tests Pierrick Bouvier
2026-07-07 5:24 ` Manos Pitsidianakis
2026-07-09 10:49 ` Philippe Mathieu-Daudé
2026-07-09 16:20 ` Alex Bennée
2026-07-06 22:32 ` [PATCH v3 22/91] tests/tcg/meson.build: introduce cc_feat and cc_feat_cflags Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 23/91] tests/tcg/meson.build: introduce gdb_feat and gdb_feat_version Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 24/91] tests/tcg/meson.build: move gdb_arch support check Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 25/91] tests/tcg/meson.build: let test infrastructure detect compiler Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 26/91] tests/docker/docker.py: return error code if probe fails Pierrick Bouvier
2026-07-07 6:24 ` Philippe Mathieu-Daudé
2026-07-06 22:32 ` [PATCH v3 27/91] tests/docker/docker.py: remove "Image is up to date" info Pierrick Bouvier
2026-07-07 6:01 ` Philippe Mathieu-Daudé
2026-07-06 22:32 ` [PATCH v3 28/91] tests/tcg/meson.build: introduce cc_dockerfile and cc_docker_arch Pierrick Bouvier
2026-07-07 6:15 ` Philippe Mathieu-Daudé
2026-07-07 18:05 ` Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 29/91] tests/tcg/meson.build: introduce depends Pierrick Bouvier
2026-07-08 6:07 ` Manos Pitsidianakis
2026-07-06 22:32 ` [PATCH v3 30/91] tests/tcg/meson.build: add top-level 'tcg-tests' target Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 31/91] tests/tcg/multiarch: declare user tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 32/91] tests/tcg/multiarch: declare system tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 33/91] tests/tcg/meson.build: add generic plugin tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 34/91] tests/tcg/aarch64: user tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 35/91] tests/tcg/aarch64/system/gpc-test.c: remove unused variables Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 36/91] tests/tcg/aarch64: system tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 37/91] tests/tcg/aarch64_be: user tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 38/91] tests/tcg/alpha: add float reference files Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 39/91] tests/tcg/alpha: user tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 40/91] tests/tcg/alpha: system tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 41/91] tests/tcg/arm: user tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 42/91] tests/tcg/arm: system tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 43/91] tests/tcg/hexagon/overflow.c: add missing include Pierrick Bouvier
2026-07-07 6:24 ` Philippe Mathieu-Daudé
2026-07-06 22:32 ` [PATCH v3 44/91] tests/tcg/hexagon: user tests Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 45/91] tests/tcg/multiarch/sha1.c: fix big endian implementation Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 46/91] tests/tcg/hppa: add float reference files Pierrick Bouvier
2026-07-06 22:32 ` [PATCH v3 47/91] tests/tcg/hppa: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 48/91] tests/tcg/i386: add missing float reference files Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 49/91] tests/tcg/i386: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 50/91] tests/tcg/i386: system tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 51/91] tests/tcg/loongarch64: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 52/91] tests/tcg/loongarch64: system tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 53/91] tests/tcg/m68k: add float reference files Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 54/91] tests/tcg/m68k: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 55/91] scripts/probe-gdb-support.py: add mapping for mips architecture Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 56/91] tests/tcg/mips: add float reference files Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 57/91] test/tcg/mips: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 58/91] tests/tcg/mips64: add float reference files Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 59/91] tests/tcg/mips64: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 60/91] tests/tcg/mips64el: add float reference files Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 61/91] tests/tcg/mips64el: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 62/91] tests/docker/dockerfiles/debian-all-test-cross.docker: add or1k toolchain Pierrick Bouvier
2026-07-07 6:23 ` Philippe Mathieu-Daudé
2026-07-07 16:23 ` Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 63/91] tests/tcg/or1k/test_addic.c: remove unused variables Pierrick Bouvier
2026-07-07 6:20 ` Philippe Mathieu-Daudé
2026-07-06 22:33 ` [PATCH v3 64/91] tests/tcg/or1k/test_muli.c: remove set but unused variable Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 65/91] tests/tcg/or1k: add float reference files Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 66/91] plugins/api.c: identify or1k pc register and mark it as read only Pierrick Bouvier
2026-07-07 6:12 ` Philippe Mathieu-Daudé
2026-07-06 22:33 ` [PATCH v3 67/91] tests/tcg/or1k: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 68/91] tests/tcg/ppc64: add float reference files Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 69/91] tests/tcg/ppc64: remove dependency on qemu/compiler.h Pierrick Bouvier
2026-07-07 6:16 ` Philippe Mathieu-Daudé
2026-07-07 16:25 ` Pierrick Bouvier
2026-07-09 10:52 ` Philippe Mathieu-Daudé
2026-07-06 22:33 ` [PATCH v3 70/91] tests/tcg/ppc64: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 71/91] tests/tcg/ppc64le: add missing float reference file Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 72/91] tests/tcg/ppc64le: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 73/91] tests/tcg/riscv64: add float reference files Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 74/91] tests/tcg/riscv64: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 75/91] tests/tcg/riscv64: system tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 76/91] tests/tcg/s390x/head64.S: declare _exit symbol after main Pierrick Bouvier
2026-07-07 6:17 ` Philippe Mathieu-Daudé
2026-07-06 22:33 ` [PATCH v3 77/91] tests/tcg/s390x: add float reference files Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 78/91] tests/tcg/s390x: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 79/91] tests/tcg/s390x: system tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 80/91] tests/tcg/sh4: add float reference files Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 81/91] tests/tcg/sh4: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 82/91] tests/tcg/tricore: system tests Pierrick Bouvier
2026-07-07 18:09 ` Parthiban
2026-07-07 18:19 ` Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 83/91] Revert "tests/tcg/tricore: system tests" Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 84/91] tests/tcg/x86_64: add missing float reference file Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 85/91] tests/tcg/x86_64: user tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 86/91] tests/tcg/x86_64: system tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 87/91] tests/tcg/xtensa/crt.S: align .text section Pierrick Bouvier
2026-07-07 6:18 ` Philippe Mathieu-Daudé
2026-07-07 13:45 ` Max Filippov
2026-07-07 16:30 ` Pierrick Bouvier
2026-07-07 18:10 ` Pierrick Bouvier
2026-07-08 6:11 ` Max Filippov
2026-07-08 16:36 ` Pierrick Bouvier
2026-07-09 15:24 ` Pierrick Bouvier
2026-07-09 18:42 ` Max Filippov
2026-07-09 19:03 ` Pierrick Bouvier
2026-07-10 5:53 ` Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 88/91] tests/tcg/xtensa: system tests Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 89/91] tests: remove tcg tests machinery Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 90/91] tests/tcg: remove Makefiles Pierrick Bouvier
2026-07-09 12:46 ` Alex Bennée
2026-07-09 14:26 ` Pierrick Bouvier
2026-07-06 22:33 ` [PATCH v3 91/91] configure: remove --cross-cc* options Pierrick Bouvier
2026-07-06 22:48 ` [PATCH v3 00/91] tests/tcg: run tests with meson Pierrick Bouvier
2026-07-07 6:27 ` Philippe Mathieu-Daudé
2026-07-08 12:09 ` Ilya Leoshkevich
2026-07-08 16:25 ` Pierrick Bouvier
2026-07-08 18:56 ` Thomas Huth
2026-07-08 19:58 ` Pierrick Bouvier
2026-07-09 13:50 ` Alex Bennée
2026-07-09 16:22 ` Alex Bennée
2026-07-09 16:43 ` Pierrick Bouvier
2026-07-10 6:32 ` Pierrick Bouvier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878q7krvju.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=brian.cain@oss.qualcomm.com \
--cc=deller@gmx.de \
--cc=gustavo.romero@linaro.org \
--cc=iii@linux.ibm.com \
--cc=laurent@vivier.eu \
--cc=manos.pitsidianakis@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@oss.qualcomm.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.