[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 19/24] tests/avocado: reverse_debugging.py add snapshot testin
From: |
Nicholas Piggin |
Subject: |
[PATCH v5 19/24] tests/avocado: reverse_debugging.py add snapshot testing |
Date: |
Tue, 19 Mar 2024 01:46:16 +1000 |
Make a manual snapshot halfway though initial building of the address
map in record mode.
This will cause the reverse-step and reverse-continue tests to load that
snapshot when beginning from later points in the trace, exercising the
post-initial snapshot saving and loading.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
tests/avocado/reverse_debugging.py | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/tests/avocado/reverse_debugging.py
b/tests/avocado/reverse_debugging.py
index c0cf580d5c..185f055cf9 100644
--- a/tests/avocado/reverse_debugging.py
+++ b/tests/avocado/reverse_debugging.py
@@ -59,7 +59,7 @@ def run_vm(self, record, shift, args, replay_path,
image_path, port):
vm.add_args('-icount', 'shift=%s,rr=%s,rrfile=%s,rrsnapshot=init' %
(shift, mode, replay_path),
'-net', 'none')
- vm.add_args('-drive', 'file=%s,if=none' % image_path)
+ vm.add_args('-drive', 'file=%s,if=none,id=disk0' % image_path)
if args:
vm.add_args(*args)
vm.launch()
@@ -133,6 +133,14 @@ def gdb_bstep(g):
def vm_get_icount(vm):
return vm.qmp('query-replay')['return']['icount']
+ @staticmethod
+ def vm_snapshot(vm):
+ return vm.qmp('snapshot-save',
+ {'job-id': 'snapshot-job',
+ 'tag': 'manual',
+ 'vmstate': 'disk0',
+ 'devices': []})
+
def reverse_debugging(self, shift=7, args=None):
logger = logging.getLogger('replay')
@@ -171,6 +179,9 @@ def reverse_debugging(self, shift=7, args=None):
pc = self.get_pc(g)
logger.info('saving position %x' % pc)
steps.append(pc)
+ if i == self.STEPS//2:
+ logger.info('saving VM snapshot at step %x...' % i)
+ self.vm_snapshot(vm)
self.gdb_step(g)
if self.first_step_workaround and i == 0 and
self.vm_get_icount(vm) == 0:
logger.warn('failed to take first step, stepping again')
@@ -217,7 +228,9 @@ def reverse_debugging(self, shift=7, args=None):
self.gdb_step(g)
logger.info('found position %x' % addr)
- # Try reverse stepping
+ # Try reverse stepping. The manual snapshot taken in the record
+ # phase should be used for reverse-stepping until the machine
+ # reverses to an icount older than the snapshot.
logger.info('stepping backward')
for addr in steps[::-1]:
self.gdb_bstep(g)
@@ -242,6 +255,8 @@ def reverse_debugging(self, shift=7, args=None):
self.check_pc(g, last_pc)
logger.info('found position %x' % last_pc)
+ # This should load the last snapshot taken. Could that be verified
+ # with QMP?
logger.info('stepping backward')
self.gdb_bstep(g)
--
2.42.0
- [PATCH v5 10/24] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, (continued)
- [PATCH v5 10/24] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Nicholas Piggin, 2024/03/18
- [PATCH v5 09/24] replay: Fix migration replay_mutex locking, Nicholas Piggin, 2024/03/18
- [PATCH v5 11/24] virtio-net: Use virtual time for RSC timers, Nicholas Piggin, 2024/03/18
- [PATCH v5 12/24] savevm: Fix load_snapshot error path crash, Nicholas Piggin, 2024/03/18
- [PATCH v5 13/24] tests/avocado: replay_linux.py remove the timeout expected guards, Nicholas Piggin, 2024/03/18
- [PATCH v5 15/24] tests/avocado: reverse_debugging.py add test for x86-64 q35 machine, Nicholas Piggin, 2024/03/18
- [PATCH v5 16/24] tests/avocado: reverse_debugging.py verify addresses between record and replay, Nicholas Piggin, 2024/03/18
- [PATCH v5 17/24] tests/avocado: reverse_debugging.py stop VM before sampling icount, Nicholas Piggin, 2024/03/18
- [PATCH v5 14/24] tests/avocado: reverse_debugging.py mark aarch64 and pseries as not flaky, Nicholas Piggin, 2024/03/18
- [PATCH v5 18/24] tests/avocado: reverse_debugging reverse-step at the end of the trace, Nicholas Piggin, 2024/03/18
- [PATCH v5 19/24] tests/avocado: reverse_debugging.py add snapshot testing,
Nicholas Piggin <=
- [PATCH v5 20/24] replay: simple auto-snapshot mode for record, Nicholas Piggin, 2024/03/18
- [PATCH v5 21/24] tests/avocado: reverse_debugging.py test auto-snapshot mode, Nicholas Piggin, 2024/03/18
- [PATCH v5 22/24] target/ppc: fix timebase register reset state, Nicholas Piggin, 2024/03/18
- [PATCH v5 23/24] spapr: Fix vpa dispatch count for record-replay, Nicholas Piggin, 2024/03/18
- [PATCH v5 24/24] tests/avocado: replay_linux.py add ppc64 pseries test, Nicholas Piggin, 2024/03/18