diff options
author | Mads Ynddal <m.ynddal@samsung.com> | 2023-09-26 12:34:31 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2023-09-26 12:28:51 -0400 |
commit | 6f53641a980df2d1b38503b10bfda9236fa075b4 (patch) | |
tree | 3639665f7dddf656f8c853d6f33f0da48f47f22a /io/channel-buffer.c | |
parent | 87617b9ae63c4675460244d067e246b362dc3867 (diff) | |
download | qemu-6f53641a980df2d1b38503b10bfda9236fa075b4.zip qemu-6f53641a980df2d1b38503b10bfda9236fa075b4.tar.gz qemu-6f53641a980df2d1b38503b10bfda9236fa075b4.tar.bz2 |
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 'io/channel-buffer.c')
0 files changed, 0 insertions, 0 deletions