On 7/2/22 13:33, Alberto Faria wrote:
The current primary motivation for this work is enforcing rules around
block layer coroutines, which is why most of the series focuses on that.
However, the static analyzer is intended to be sufficiently generic to
satisfy other present and future QEMU static analysis needs.
This is very early work-in-progress, and a lot is missing. One notable
omission is build system integration, including keeping track of which
translation units have been modified and need re-analyzing.
Performance is bad, but there is a lot of potential for optimization,
such as avoiding redundant AST traversals. Switching to C libclang is
also a possibility, although Python makes it easy to quickly prototype
new checks, which should encourage adoption and contributions.
The script takes a path to the build directory, and any number of paths
to directories or files to analyze. Example run on a 12-thread laptop:
Thanks, this is very useful! Unfortunately there's quite a lot of fixes
to go in (including your generated_co_wrapper cleanup series and
mine[1]) before this can be enabled, but I think this is the way to go
to 1) ease maintainability of coroutine code 2) move towards a model
where there are no mixed coroutine/non-coroutine functions.
I'll review it when I'm back, since a phone screen is not the best
environment to do that. :)
Paolo
[1] https://patchew.org/QEMU/20220509103019.215041-1-pbonz...@redhat.com/