diff options
author | 2023-09-26 12:34:31 +0200 | |
---|---|---|
committer | 2023-09-26 12:28:51 -0400 | |
commit | 6f53641a980df2d1b38503b10bfda9236fa075b4 (patch) | |
tree | 3639665f7dddf656f8c853d6f33f0da48f47f22a /scripts/qapi/source.py | |
parent | simpletrace: made Analyzer into context-manager (diff) | |
download | qemu-6f53641a980df2d1b38503b10bfda9236fa075b4.tar.xz 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/qapi/source.py')
0 files changed, 0 insertions, 0 deletions