[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/21] scripts/replay-dump.py: rejig decoders in event number orde
From: |
Alex Bennée |
Subject: |
[PULL 10/21] scripts/replay-dump.py: rejig decoders in event number order |
Date: |
Thu, 15 Aug 2024 15:49:00 +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>
Message-Id: <20240813202329.1237572-11-alex.bennee@linaro.org>
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
- [PULL 07/21] target/i386: allow access_ptr to force slow path on failed probe, (continued)
- [PULL 07/21] target/i386: allow access_ptr to force slow path on failed probe, Alex Bennée, 2024/08/15
- [PULL 14/21] tests/avocado: replay_kernel.py add x86-64 q35 machine test, Alex Bennée, 2024/08/15
- [PULL 05/21] configure: Fix GDB version detection for GDB_HAS_MTE, Alex Bennée, 2024/08/15
- [PULL 06/21] scripts/checkpatch: more checks on files imported from Linux, Alex Bennée, 2024/08/15
- [PULL 03/21] configure: Fix arch detection for GDB_HAS_MTE, Alex Bennée, 2024/08/15
- [PULL 21/21] plugins: fix race condition with scoreboards, Alex Bennée, 2024/08/15
- [PULL 15/21] chardev: set record/replay on the base device of a muxed device, Alex Bennée, 2024/08/15
- [PULL 09/21] scripts/replay-dump.py: Update to current rr record format, Alex Bennée, 2024/08/15
- [PULL 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Alex Bennée, 2024/08/15
- [PULL 19/21] docs: Fix some typos (found by typos) and grammar issues, Alex Bennée, 2024/08/15
- [PULL 10/21] scripts/replay-dump.py: rejig decoders in event number order,
Alex Bennée <=
- [PULL 12/21] replay: allow runstate shutdown->running when replaying trace, Alex Bennée, 2024/08/15
- [PULL 13/21] Revert "replay: stop us hanging in rr_wait_io_event", Alex Bennée, 2024/08/15
- [PULL 11/21] tests/avocado: excercise scripts/replay-dump.py in replay tests, Alex Bennée, 2024/08/15
- [PULL 08/21] buildsys: Fix building without plugins on Darwin, Alex Bennée, 2024/08/15
- [PULL 18/21] savevm: Fix load_snapshot error path crash, Alex Bennée, 2024/08/15
- [PULL 17/21] virtio-net: Use virtual time for RSC timers, Alex Bennée, 2024/08/15
- [PULL 20/21] docs/devel: update tcg-plugins page, Alex Bennée, 2024/08/15
- Re: [PULL for 9.1 00/21] Some fixes for 9.1-rc3 (build, replay, docs, plugins), Richard Henderson, 2024/08/15