[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/21] scripts/replay-dump.py: rejig decoders in event number
From: |
Alex Bennée |
Subject: |
[PATCH v2 10/21] scripts/replay-dump.py: rejig decoders in event number order |
Date: |
Tue, 13 Aug 2024 21:23:18 +0100 |
From: Nicholas Piggin <npiggin@gmail.com>
Sort decoder functions to be ascending in order of event number,
same as the decoder tables.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20240813050638.446172-3-npiggin@gmail.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
scripts/replay-dump.py | 56 +++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/scripts/replay-dump.py b/scripts/replay-dump.py
index 419ee3257b..b82659cfb6 100755
--- a/scripts/replay-dump.py
+++ b/scripts/replay-dump.py
@@ -139,6 +139,19 @@ def swallow_bytes(eid, name, dumpfile, nr):
"""Swallow nr bytes of data without looking at it"""
dumpfile.seek(nr, os.SEEK_CUR)
+total_insns = 0
+
+def decode_instruction(eid, name, dumpfile):
+ global total_insns
+ ins_diff = read_dword(dumpfile)
+ total_insns += ins_diff
+ print_event(eid, name, "+ %d -> %d" % (ins_diff, total_insns))
+ return True
+
+def decode_interrupt(eid, name, dumpfile):
+ print_event(eid, name)
+ return True
+
def decode_exception(eid, name, dumpfile):
print_event(eid, name)
return True
@@ -198,15 +211,6 @@ def decode_async_net(eid, name, dumpfile):
print_event(eid, name, "net:%x flags:%x bytes:%d" % (net_id, flags, size))
return True
-total_insns = 0
-
-def decode_instruction(eid, name, dumpfile):
- global total_insns
- ins_diff = read_dword(dumpfile)
- total_insns += ins_diff
- print_event(eid, name, "+ %d -> %d" % (ins_diff, total_insns))
- return True
-
def decode_shutdown(eid, name, dumpfile):
print_event(eid, name)
return True
@@ -222,6 +226,21 @@ 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)
+ if (ret):
+ print_event(eid, name, "%d bytes (getrandom failed)" % (size))
+ else:
+ print_event(eid, name, "%d bytes" % (size))
+ return True
+
+def decode_clock(eid, name, dumpfile):
+ clock_data = read_qword(dumpfile)
+ print_event(eid, name, "0x%x" % (clock_data))
+ return True
+
def __decode_checkpoint(eid, name, dumpfile, old):
"""Decode a checkpoint.
@@ -252,25 +271,6 @@ def decode_checkpoint_init(eid, name, dumpfile):
print_event(eid, name)
return True
-def decode_interrupt(eid, name, 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))
- return True
-
-def decode_random(eid, name, dumpfile):
- ret = read_dword(dumpfile)
- size = read_dword(dumpfile)
- swallow_bytes(eid, name, dumpfile, size)
- if (ret):
- print_event(eid, name, "%d bytes (getrandom failed)" % (size))
- else:
- print_event(eid, name, "%d bytes" % (size))
- return True
-
def decode_end(eid, name, dumpfile):
print_event(eid, name)
return False
--
2.39.2
- Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, (continued)
- Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Nicholas Piggin, 2024/08/14
- Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Michael S. Tsirkin, 2024/08/14
- Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Alex Bennée, 2024/08/14
- Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Nicholas Piggin, 2024/08/15
- Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Michael S. Tsirkin, 2024/08/15
- Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Nicholas Piggin, 2024/08/15
- Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Jason Wang, 2024/08/15
- Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Alex Bennée, 2024/08/16
[PATCH v2 15/21] chardev: set record/replay on the base device of a muxed device, Alex Bennée, 2024/08/13
[PATCH v2 21/21] plugins: fix race condition with scoreboards, Alex Bennée, 2024/08/13
[PATCH v2 10/21] scripts/replay-dump.py: rejig decoders in event number order,
Alex Bennée <=
[PATCH v2 17/21] virtio-net: Use virtual time for RSC timers, Alex Bennée, 2024/08/13
[PATCH v2 19/21] docs: Fix some typos (found by typos) and grammar issues, Alex Bennée, 2024/08/13
[PATCH v2 18/21] savevm: Fix load_snapshot error path crash, Alex Bennée, 2024/08/13
[PATCH v2 20/21] docs/devel: update tcg-plugins page, Alex Bennée, 2024/08/13