From: Nicholas Piggin <npiggin@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Nicholas Piggin" <npiggin@gmail.com>,
qemu-ppc@nongnu.org,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
"Cédric Le Goater" <clg@kaod.org>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Greg Kurz" <groug@kaod.org>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"John Snow" <jsnow@redhat.com>, "Cleber Rosa" <crosa@redhat.com>,
"Pavel Dovgalyuk" <pavel.dovgaluk@ispras.ru>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Beraldo Leal" <bleal@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>
Subject: [PATCH 2/7] scripts/replay_dump.sh: Update to current rr record format
Date: Fri, 23 Jun 2023 22:57:02 +1000 [thread overview]
Message-ID: <20230623125707.323517-3-npiggin@gmail.com> (raw)
In-Reply-To: <20230623125707.323517-1-npiggin@gmail.com>
This thing seems to have fallen by the wayside. This quick hack gets
it vaguely working with the current format. It was some use in fixing
rr support for ppc, so maybe others will find it useful too.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
scripts/replay-dump.py | 89 +++++++++++++++++++++++++++++++++++++++---
1 file changed, 83 insertions(+), 6 deletions(-)
diff --git a/scripts/replay-dump.py b/scripts/replay-dump.py
index 3ba97a6d30..c46ff8ffd6 100755
--- a/scripts/replay-dump.py
+++ b/scripts/replay-dump.py
@@ -122,12 +122,19 @@ def swallow_async_qword(eid, name, dumpfile):
print(" %s(%d) @ %d" % (name, eid, step_id))
return True
+def swallow_bytes(eid, name, dumpfile, nr):
+ "Swallow nr bytes of data without looking at it"
+ for x in range(nr):
+ read_byte(dumpfile)
+ return True
+
async_decode_table = [ Decoder(0, "REPLAY_ASYNC_EVENT_BH", swallow_async_qword),
- Decoder(1, "REPLAY_ASYNC_INPUT", decode_unimp),
- Decoder(2, "REPLAY_ASYNC_INPUT_SYNC", decode_unimp),
- Decoder(3, "REPLAY_ASYNC_CHAR_READ", decode_unimp),
- Decoder(4, "REPLAY_ASYNC_EVENT_BLOCK", decode_unimp),
- Decoder(5, "REPLAY_ASYNC_EVENT_NET", decode_unimp),
+ Decoder(1, "REPLAY_ASYNC_BH_ONESHOT", decode_unimp),
+ Decoder(2, "REPLAY_ASYNC_INPUT", decode_unimp),
+ Decoder(3, "REPLAY_ASYNC_INPUT_SYNC", decode_unimp),
+ Decoder(4, "REPLAY_ASYNC_CHAR_READ", decode_unimp),
+ Decoder(5, "REPLAY_ASYNC_EVENT_BLOCK", decode_unimp),
+ Decoder(6, "REPLAY_ASYNC_EVENT_NET", decode_unimp),
]
# See replay_read_events/replay_read_event
def decode_async(eid, name, dumpfile):
@@ -156,6 +163,13 @@ def decode_audio_out(eid, name, dumpfile):
print_event(eid, name, "%d" % (audio_data))
return True
+def decode_random(eid, name, dumpfile):
+ ret = read_dword(dumpfile)
+ size = read_dword(dumpfile)
+ swallow_bytes(eid, name, dumpfile, size)
+ print_event(eid, name, "%d %d" % (ret, size))
+ return True
+
def decode_checkpoint(eid, name, dumpfile):
"""Decode a checkpoint.
@@ -184,6 +198,24 @@ def decode_interrupt(eid, name, dumpfile):
print_event(eid, name)
return True
+def decode_exception(eid, name, dumpfile):
+ print_event(eid, name)
+ return True
+
+def decode_shutdown(eid, name, dumpfile):
+ print_event(eid, name)
+ return True
+
+def decode_end(eid, name, dumpfile):
+ print_event(eid, name)
+ return False
+
+def decode_char_write(eid, name, dumpfile):
+ res = read_dword(dumpfile)
+ offset = read_dword(dumpfile)
+ print_event(eid, name)
+ return True
+
def decode_clock(eid, name, dumpfile):
clock_data = read_qword(dumpfile)
print_event(eid, name, "0x%x" % (clock_data))
@@ -268,6 +300,48 @@ def decode_clock(eid, name, dumpfile):
Decoder(28, "EVENT_CP_RESET", decode_checkpoint),
]
+v12_event_table = [Decoder(0, "EVENT_INSTRUCTION", decode_instruction),
+ Decoder(1, "EVENT_INTERRUPT", decode_interrupt),
+ Decoder(2, "EVENT_EXCEPTION", decode_exception),
+ Decoder(3, "EVENT_ASYNC_BH", swallow_async_qword),
+ Decoder(4, "EVENT_ASYNC_BH_ONESHOT", decode_unimp),
+ Decoder(5, "EVENT_ASYNC_INPUT", decode_unimp),
+ Decoder(6, "EVENT_ASYNC_INPUT_SYNC", decode_unimp),
+ Decoder(7, "EVENT_ASYNC_CHAR_READ", decode_unimp),
+ Decoder(8, "EVENT_ASYNC_BLOCK", decode_unimp),
+ Decoder(9, "EVENT_ASYNC_NET", decode_unimp),
+ Decoder(10, "EVENT_SHUTDOWN", decode_unimp),
+ Decoder(11, "EVENT_SHUTDOWN_HOST_ERR", decode_shutdown),
+ Decoder(12, "EVENT_SHUTDOWN_HOST_QMP_QUIT", decode_shutdown),
+ Decoder(13, "EVENT_SHUTDOWN_HOST_QMP_RESET", decode_shutdown),
+ Decoder(14, "EVENT_SHUTDOWN_HOST_SIGNAL", decode_shutdown),
+ Decoder(15, "EVENT_SHUTDOWN_HOST_UI", decode_shutdown),
+ Decoder(16, "EVENT_SHUTDOWN_GUEST_SHUTDOWN", decode_shutdown),
+ Decoder(17, "EVENT_SHUTDOWN_GUEST_RESET", decode_shutdown),
+ Decoder(18, "EVENT_SHUTDOWN_GUEST_PANIC", decode_shutdown),
+ Decoder(19, "EVENT_SHUTDOWN_SUBSYS_RESET", decode_shutdown),
+ Decoder(20, "EVENT_SHUTDOWN_SNAPSHOT_LOAD", decode_shutdown),
+ Decoder(21, "EVENT_SHUTDOWN___MAX", decode_shutdown),
+ Decoder(22, "EVENT_CHAR_WRITE", decode_char_write),
+ Decoder(23, "EVENT_CHAR_READ_ALL", decode_unimp),
+ Decoder(24, "EVENT_CHAR_READ_ALL_ERROR", decode_unimp),
+ Decoder(25, "EVENT_AUDIO_OUT", decode_audio_out),
+ Decoder(26, "EVENT_AUDIO_IN", decode_unimp),
+ Decoder(27, "EVENT_RANDOM", decode_random),
+ Decoder(28, "EVENT_CLOCK_HOST", decode_clock),
+ Decoder(29, "EVENT_CLOCK_VIRTUAL_RT", decode_clock),
+ Decoder(30, "EVENT_CP_CLOCK_WARP_START", decode_checkpoint),
+ Decoder(31, "EVENT_CP_CLOCK_WARP_ACCOUNT", decode_checkpoint),
+ Decoder(32, "EVENT_CP_RESET_REQUESTED", decode_checkpoint),
+ Decoder(33, "EVENT_CP_SUSPEND_REQUESTED", decode_checkpoint),
+ Decoder(34, "EVENT_CP_CLOCK_VIRTUAL", decode_checkpoint),
+ Decoder(35, "EVENT_CP_CLOCK_HOST", decode_checkpoint),
+ Decoder(36, "EVENT_CP_CLOCK_VIRTUAL_RT", decode_checkpoint),
+ Decoder(37, "EVENT_CP_INIT", decode_checkpoint_init),
+ Decoder(38, "EVENT_CP_RESET", decode_checkpoint),
+ Decoder(39, "EVENT_END", decode_end),
+]
+
def parse_arguments():
"Grab arguments for script"
parser = argparse.ArgumentParser()
@@ -285,7 +359,10 @@ def decode_file(filename):
print("HEADER: version 0x%x" % (version))
- if version == 0xe02007:
+ if version == 0xe0200c:
+ event_decode_table = v12_event_table
+ replay_state.checkpoint_start = 12
+ elif version == 0xe02007:
event_decode_table = v7_event_table
replay_state.checkpoint_start = 12
elif version == 0xe02006:
--
2.40.1
next prev parent reply other threads:[~2023-06-23 12:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-23 12:57 [PATCH 0/7] ppc: fix larx migration, fix record-replay Nicholas Piggin
2023-06-23 12:57 ` [PATCH 1/7] target/ppc: Fix CPU reservation migration for record-replay Nicholas Piggin
2023-06-26 7:49 ` Pavel Dovgalyuk
2023-07-07 9:23 ` Daniel Henrique Barboza
2023-06-23 12:57 ` Nicholas Piggin [this message]
2023-06-23 12:57 ` [PATCH 3/7] spapr: Fix machine reset deadlock from replay-record Nicholas Piggin
2023-06-23 12:57 ` [PATCH 4/7] spapr: Fix record-replay machine reset consuming too many events Nicholas Piggin
2023-06-26 8:07 ` Pavel Dovgalyuk
2023-06-26 10:04 ` Nicholas Piggin
2023-06-23 12:57 ` [PATCH 5/7] target/ppc: Fix timebase reset with record-replay Nicholas Piggin
2023-06-26 7:52 ` Pavel Dovgalyuk
2023-06-23 12:57 ` [PATCH 6/7] tests/avocado: boot ppc64 pseries replay-record test to Linux VFS mount Nicholas Piggin
2023-06-23 12:57 ` [PATCH 7/7] tests/avocado: ppc64 pseries reverse debugging test Nicholas Piggin
2023-06-26 7:49 ` Pavel Dovgalyuk
2023-06-26 9:34 ` Nicholas Piggin
2023-07-21 13:55 ` Nicholas Piggin
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=20230623125707.323517-3-npiggin@gmail.com \
--to=npiggin@gmail.com \
--cc=bleal@redhat.com \
--cc=clg@kaod.org \
--cc=crosa@redhat.com \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=harshpb@linux.ibm.com \
--cc=jsnow@redhat.com \
--cc=pavel.dovgaluk@ispras.ru \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=wainersm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).