qemu/tests/plugin
Alex Bennée c81950a2f1 plugins: new lockstep plugin for debugging TCG changes
When we make changes to the TCG we sometimes cause regressions that
are deep into the execution cycle of the guest. Debugging this often
requires comparing large volumes of trace information to figure out
where behaviour has diverged.

The lockstep plugin utilises a shared socket so two QEMU's running
with the plugin will write their current execution position and wait
to receive the position of their partner process. When execution
diverges the plugins output where they were and the previous few
blocks before unloading themselves and letting execution continue.

Originally I planned for this to be most useful with -icount but it
turns out you can get divergence pretty quickly due to asynchronous
qemu_cpu_kick_rr_cpus() events causing one side to eventually run into
a short block a few cycles before the other side. For this reason I've
added a bit of tracking and I think the divergence reporting could be
finessed to report only if we really start to diverge in execution.

An example run would be:

  qemu-system-sparc -monitor none -parallel none -net none \
    -M SS-20 -m 256 -kernel day11/zImage.elf \
    -plugin ./tests/plugin/liblockstep.so,arg=lockstep-sparc.sock \
    -d plugin,nochain

with an identical command in another window in the same working
directory.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Robert Foley <robert.foley@linaro.org>
Tested-by: Robert Foley <robert.foley@linaro.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20200610155509.12850-3-alex.bennee@linaro.org>
2020-06-16 14:49:05 +01:00
..
bb.c tests/plugin: prevent uninitialized warning 2020-02-25 20:20:23 +00:00
empty.c tcg plugins: expose an API version concept 2019-11-12 14:32:55 +00:00
hotblocks.c tcg plugins: expose an API version concept 2019-11-12 14:32:55 +00:00
hotpages.c tcg plugins: expose an API version concept 2019-11-12 14:32:55 +00:00
howvec.c tests/plugins: make howvec clean-up after itself. 2020-02-25 20:20:23 +00:00
insn.c tests/plugin: prevent uninitialized warning 2020-02-25 20:20:23 +00:00
lockstep.c plugins: new lockstep plugin for debugging TCG changes 2020-06-16 14:49:05 +01:00
Makefile plugins: new lockstep plugin for debugging TCG changes 2020-06-16 14:49:05 +01:00
mem.c tests/plugin: correctly honour io_count 2020-06-08 16:59:31 +01:00