summary refs log tree commit diff stats
path: root/scripts/analyse-locks-simpletrace.py
diff options
context:
space:
mode:
authorMads Ynddal <m.ynddal@samsung.com>2023-09-26 12:34:31 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2023-09-26 12:28:51 -0400
commit6f53641a980df2d1b38503b10bfda9236fa075b4 (patch)
tree3639665f7dddf656f8c853d6f33f0da48f47f22a /scripts/analyse-locks-simpletrace.py
parent87617b9ae63c4675460244d067e246b362dc3867 (diff)
downloadfocaccia-qemu-6f53641a980df2d1b38503b10bfda9236fa075b4.tar.gz
focaccia-qemu-6f53641a980df2d1b38503b10bfda9236fa075b4.zip
simpletrace: refactor to separate responsibilities
Moved event_mapping and event_id_to_name down one level in the function
call-stack to keep variable instantiation and usage closer (`process`
and `run` has no use of the variables; `read_trace_records` does).

Instead of passing event_mapping and event_id_to_name to the bottom of
the call-stack, we move their use to `read_trace_records`. This
separates responsibility and ownership of the information.

`read_record` now just reads the arguments from the file-object by
knowning the total number of bytes. Parsing it to specific arguments is
moved up to `read_trace_records`.

Special handling of dropped events removed, as they can be handled
by the general code.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Mads Ynddal <m.ynddal@samsung.com>
Message-id: 20230926103436.25700-10-mads@ynddal.dk
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts/analyse-locks-simpletrace.py')
0 files changed, 0 insertions, 0 deletions