]> git.proxmox.com Git - mirror_qemu.git/commit
simpletrace: refactor to separate responsibilities
authorMads Ynddal <m.ynddal@samsung.com>
Tue, 26 Sep 2023 10:34:31 +0000 (12:34 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 26 Sep 2023 16:28:51 +0000 (12:28 -0400)
commit6f53641a980df2d1b38503b10bfda9236fa075b4
tree3639665f7dddf656f8c853d6f33f0da48f47f22a
parent87617b9ae63c4675460244d067e246b362dc3867
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>
scripts/simpletrace.py