#
3470fef1 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: added simplified Analyzer2 class
By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method
simpletrace: added simplified Analyzer2 class
By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method wants to access these, they can define the kwargs, or ignore it be placing `**kwargs` at the end of the function's arguments list.
Added deprecation warning to Analyzer class to make users aware of the Analyzer2 class. No removal date is planned.
Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-13-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
d1f89c23 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: move event processing to Analyzer class
Moved event processing to the Analyzer class to separate specific analyzer logic (like caching and function signatures) from the _process functio
simpletrace: move event processing to Analyzer class
Moved event processing to the Analyzer class to separate specific analyzer logic (like caching and function signatures) from the _process function. This allows for new types of Analyzer-based subclasses without changing the core code.
Note, that the fn_cache is important for performance in cases where the analyzer is branching away from the catch-all a lot. The cache has no measurable performance penalty.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-12-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
b78234e6 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: move logic of process into internal function
To avoid duplicate code depending on input types and to better handle open/close of log with a context-manager, we move the logic of process
simpletrace: move logic of process into internal function
To avoid duplicate code depending on input types and to better handle open/close of log with a context-manager, we move the logic of process into _process.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-11-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
6f53641a |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
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 `
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>
show more ...
|
#
87617b9a |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: made Analyzer into context-manager
Instead of explicitly calling `begin` and `end`, we can change the class to use the context-manager paradigm. This is mostly a styling choice, used in
simpletrace: made Analyzer into context-manager
Instead of explicitly calling `begin` and `end`, we can change the class to use the context-manager paradigm. This is mostly a styling choice, used in modern Python code. But it also allows for more advanced analyzers to handle exceptions gracefully in the `__exit__` method (not demonstrated here).
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-9-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
1990fb98 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: define exception and add handling
Define `SimpleException` to differentiate our exceptions from generic exceptions (IOError, etc.). Adapted simpletrace to support this and output to std
simpletrace: define exception and add handling
Define `SimpleException` to differentiate our exceptions from generic exceptions (IOError, etc.). Adapted simpletrace to support this and output to stderr.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-8-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
d1f92590 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: improved error handling on struct unpack
A failed call to `read_header` wouldn't be handled the same for the two different code paths (one path would try to use `None` as a list). Chang
simpletrace: improved error handling on struct unpack
A failed call to `read_header` wouldn't be handled the same for the two different code paths (one path would try to use `None` as a list). Changed to raise exception to be handled centrally. This also allows for easier unpacking, as errors has been filtered out.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-7-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
ce96eb33 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: update code for Python 3.11
The call to `getargspec` was deprecated and in Python 3.11 it has been removed in favor of `getfullargspec`. `getfullargspec` is compatible with QEMU's requi
simpletrace: update code for Python 3.11
The call to `getargspec` was deprecated and in Python 3.11 it has been removed in favor of `getfullargspec`. `getfullargspec` is compatible with QEMU's requirement of at least Python version 3.6.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-6-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
3b71b61e |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: changed naming of edict and idtoname to improve readability
Readability is subjective, but I've expanded the naming of the variables and arguments, to help with understanding for new ey
simpletrace: changed naming of edict and idtoname to improve readability
Readability is subjective, but I've expanded the naming of the variables and arguments, to help with understanding for new eyes on the code.
Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20230926103436.25700-5-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
f7bd4f02 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: improve parsing of sys.argv; fix files never closed.
The arguments extracted from `sys.argv` named and unpacked to make it clear what the arguments are and what they're used for.
The t
simpletrace: improve parsing of sys.argv; fix files never closed.
The arguments extracted from `sys.argv` named and unpacked to make it clear what the arguments are and what they're used for.
The two input files were opened, but never explicitly closed. File usage changed to use `with` statement to take care of this. At the same time, ownership of the file-object is moved up to `run` function. Added option to process to support file-like objects.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-4-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
8405ec6a |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: annotate magic constants from QEMU code
It wasn't clear where the constants and structs came from, so I added comments to help.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signe
simpletrace: annotate magic constants from QEMU code
It wasn't clear where the constants and structs came from, so I added comments to help.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-3-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
2c109f21 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: add __all__ to define public interface
It was unclear what was the supported public interface. I.e. when refactoring the code, what functions/classes are important to retain.
Reviewed-
simpletrace: add __all__ to define public interface
It was unclear what was the supported public interface. I.e. when refactoring the code, what functions/classes are important to retain.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-2-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
3470fef1 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: added simplified Analyzer2 class
By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method
simpletrace: added simplified Analyzer2 class
By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method wants to access these, they can define the kwargs, or ignore it be placing `**kwargs` at the end of the function's arguments list.
Added deprecation warning to Analyzer class to make users aware of the Analyzer2 class. No removal date is planned.
Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-13-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
d1f89c23 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: move event processing to Analyzer class
Moved event processing to the Analyzer class to separate specific analyzer logic (like caching and function signatures) from the _process functio
simpletrace: move event processing to Analyzer class
Moved event processing to the Analyzer class to separate specific analyzer logic (like caching and function signatures) from the _process function. This allows for new types of Analyzer-based subclasses without changing the core code.
Note, that the fn_cache is important for performance in cases where the analyzer is branching away from the catch-all a lot. The cache has no measurable performance penalty.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-12-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
b78234e6 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: move logic of process into internal function
To avoid duplicate code depending on input types and to better handle open/close of log with a context-manager, we move the logic of process
simpletrace: move logic of process into internal function
To avoid duplicate code depending on input types and to better handle open/close of log with a context-manager, we move the logic of process into _process.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-11-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
6f53641a |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
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 `
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>
show more ...
|
#
87617b9a |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: made Analyzer into context-manager
Instead of explicitly calling `begin` and `end`, we can change the class to use the context-manager paradigm. This is mostly a styling choice, used in
simpletrace: made Analyzer into context-manager
Instead of explicitly calling `begin` and `end`, we can change the class to use the context-manager paradigm. This is mostly a styling choice, used in modern Python code. But it also allows for more advanced analyzers to handle exceptions gracefully in the `__exit__` method (not demonstrated here).
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-9-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
1990fb98 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: define exception and add handling
Define `SimpleException` to differentiate our exceptions from generic exceptions (IOError, etc.). Adapted simpletrace to support this and output to std
simpletrace: define exception and add handling
Define `SimpleException` to differentiate our exceptions from generic exceptions (IOError, etc.). Adapted simpletrace to support this and output to stderr.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-8-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
d1f92590 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: improved error handling on struct unpack
A failed call to `read_header` wouldn't be handled the same for the two different code paths (one path would try to use `None` as a list). Chang
simpletrace: improved error handling on struct unpack
A failed call to `read_header` wouldn't be handled the same for the two different code paths (one path would try to use `None` as a list). Changed to raise exception to be handled centrally. This also allows for easier unpacking, as errors has been filtered out.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-7-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
ce96eb33 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: update code for Python 3.11
The call to `getargspec` was deprecated and in Python 3.11 it has been removed in favor of `getfullargspec`. `getfullargspec` is compatible with QEMU's requi
simpletrace: update code for Python 3.11
The call to `getargspec` was deprecated and in Python 3.11 it has been removed in favor of `getfullargspec`. `getfullargspec` is compatible with QEMU's requirement of at least Python version 3.6.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-6-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
3b71b61e |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: changed naming of edict and idtoname to improve readability
Readability is subjective, but I've expanded the naming of the variables and arguments, to help with understanding for new ey
simpletrace: changed naming of edict and idtoname to improve readability
Readability is subjective, but I've expanded the naming of the variables and arguments, to help with understanding for new eyes on the code.
Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20230926103436.25700-5-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
f7bd4f02 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: improve parsing of sys.argv; fix files never closed.
The arguments extracted from `sys.argv` named and unpacked to make it clear what the arguments are and what they're used for.
The t
simpletrace: improve parsing of sys.argv; fix files never closed.
The arguments extracted from `sys.argv` named and unpacked to make it clear what the arguments are and what they're used for.
The two input files were opened, but never explicitly closed. File usage changed to use `with` statement to take care of this. At the same time, ownership of the file-object is moved up to `run` function. Added option to process to support file-like objects.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-4-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
8405ec6a |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: annotate magic constants from QEMU code
It wasn't clear where the constants and structs came from, so I added comments to help.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signe
simpletrace: annotate magic constants from QEMU code
It wasn't clear where the constants and structs came from, so I added comments to help.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-3-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
2c109f21 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: add __all__ to define public interface
It was unclear what was the supported public interface. I.e. when refactoring the code, what functions/classes are important to retain.
Reviewed-
simpletrace: add __all__ to define public interface
It was unclear what was the supported public interface. I.e. when refactoring the code, what functions/classes are important to retain.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-2-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
3470fef1 |
| 26-Sep-2023 |
Mads Ynddal <m.ynddal@samsung.com> |
simpletrace: added simplified Analyzer2 class
By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method
simpletrace: added simplified Analyzer2 class
By moving the dynamic argument construction to keyword-arguments, we can remove all of the specialized handling, and streamline it. If a tracing method wants to access these, they can define the kwargs, or ignore it be placing `**kwargs` at the end of the function's arguments list.
Added deprecation warning to Analyzer class to make users aware of the Analyzer2 class. No removal date is planned.
Signed-off-by: Mads Ynddal <m.ynddal@samsung.com> Message-id: 20230926103436.25700-13-mads@ynddal.dk Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|