[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 19/24] tests/avocado: reverse_debugging.py add snapshot testin
From: |
Nicholas Piggin |
Subject: |
[PATCH v4 19/24] tests/avocado: reverse_debugging.py add snapshot testing |
Date: |
Tue, 12 Mar 2024 03:40:21 +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 635ff7bacc..4bf4e6e1e5 100644
--- a/tests/avocado/reverse_debugging.py
+++ b/tests/avocado/reverse_debugging.py
@@ -50,7 +50,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()
@@ -124,6 +124,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, x86_workaround=False):
logger = logging.getLogger('replay')
@@ -162,6 +170,9 @@ def reverse_debugging(self, shift=7, args=None,
x86_workaround=False):
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 x86_workaround and i == 0 and self.vm_get_icount(vm) == 0:
logger.warn('failed to take first step, stepping again')
@@ -208,7 +219,9 @@ def reverse_debugging(self, shift=7, args=None,
x86_workaround=False):
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)
@@ -232,6 +245,8 @@ def reverse_debugging(self, shift=7, args=None,
x86_workaround=False):
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
- Re: [PATCH v4 11/24] net: Use virtual time for net announce, (continued)
[PATCH v4 12/24] savevm: Fix load_snapshot error path crash, Nicholas Piggin, 2024/03/11
[PATCH v4 13/24] tests/avocado: replay_linux.py remove the timeout expected guards, Nicholas Piggin, 2024/03/11
[PATCH v4 15/24] tests/avocado: reverse_debugging.py add test for x86-64 q35 machine, Nicholas Piggin, 2024/03/11
[PATCH v4 17/24] tests/avocado: reverse_debugging.py stop VM before sampling icount, Nicholas Piggin, 2024/03/11
[PATCH v4 18/24] tests/avocado: reverse_debugging reverse-step at the end of the trace, Nicholas Piggin, 2024/03/11
[PATCH v4 14/24] tests/avocado/reverse_debugging.py: mark aarch64 and pseries as not flaky, Nicholas Piggin, 2024/03/11
[PATCH v4 16/24] tests/avocado: reverse_debugging.py verify addresses between record and replay, Nicholas Piggin, 2024/03/11
[PATCH v4 19/24] tests/avocado: reverse_debugging.py add snapshot testing,
Nicholas Piggin <=
[PATCH v4 21/24] tests/avocado: reverse_debugging.py test auto-snapshot mode, Nicholas Piggin, 2024/03/11
[PATCH v4 20/24] replay: simple auto-snapshot mode for record, Nicholas Piggin, 2024/03/11
[PATCH v4 22/24] target/ppc: fix timebase register reset state, Nicholas Piggin, 2024/03/11
[PATCH v4 23/24] spapr: Fix vpa dispatch count for record-replay, Nicholas Piggin, 2024/03/11
[PATCH v4 24/24] tests/avocado: replay_linux.py add ppc64 pseries test, Nicholas Piggin, 2024/03/11