[PATCH 04/11] scripts/replay_dump: track total number of instructions

Alex Bennée posted 11 patches 11 months, 3 weeks ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Eduardo Habkost <eduardo@habkost.net>
[PATCH 04/11] scripts/replay_dump: track total number of instructions
Posted by Alex Bennée 11 months, 3 weeks ago
This will help in tracking where we are in the stream when debugging.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 scripts/replay-dump.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/replay-dump.py b/scripts/replay-dump.py
index 8b9f914534..2212b09322 100755
--- a/scripts/replay-dump.py
+++ b/scripts/replay-dump.py
@@ -150,10 +150,13 @@ def decode_async(eid, name, dumpfile):
 
     return call_decode(async_decode_table, async_event_kind, dumpfile)
 
+total_insns = 0
 
 def decode_instruction(eid, name, dumpfile):
+    global total_insns
     ins_diff = read_dword(dumpfile)
-    print_event(eid, name, "0x%x" % (ins_diff))
+    total_insns += ins_diff
+    print_event(eid, name, "+ %d -> %d" % (ins_diff, total_insns))
     return True
 
 def decode_char_write(eid, name, dumpfile):
-- 
2.39.2


Re: [PATCH 04/11] scripts/replay_dump: track total number of instructions
Posted by Pavel Dovgalyuk 11 months, 3 weeks ago
On 05.12.2023 23:40, Alex Bennée wrote:
> This will help in tracking where we are in the stream when debugging.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   scripts/replay-dump.py | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/replay-dump.py b/scripts/replay-dump.py
> index 8b9f914534..2212b09322 100755
> --- a/scripts/replay-dump.py
> +++ b/scripts/replay-dump.py
> @@ -150,10 +150,13 @@ def decode_async(eid, name, dumpfile):
>   
>       return call_decode(async_decode_table, async_event_kind, dumpfile)
>   
> +total_insns = 0
>   
>   def decode_instruction(eid, name, dumpfile):
> +    global total_insns
>       ins_diff = read_dword(dumpfile)
> -    print_event(eid, name, "0x%x" % (ins_diff))
> +    total_insns += ins_diff
> +    print_event(eid, name, "+ %d -> %d" % (ins_diff, total_insns))
>       return True
>   
>   def decode_char_write(eid, name, dumpfile):

Reviewed-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>


Re: [PATCH 04/11] scripts/replay_dump: track total number of instructions
Posted by Richard Henderson 11 months, 3 weeks ago
On 12/5/23 12:40, Alex Bennée wrote:
> This will help in tracking where we are in the stream when debugging.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   scripts/replay-dump.py | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

Re: [PATCH 04/11] scripts/replay_dump: track total number of instructions
Posted by Philippe Mathieu-Daudé 11 months, 3 weeks ago
On 5/12/23 21:40, Alex Bennée wrote:
> This will help in tracking where we are in the stream when debugging.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   scripts/replay-dump.py | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>