summaryrefslogtreecommitdiff
path: root/xen/scripts/xen_analysis/cppcheck_report_utils.py
Commit message (Collapse)AuthorAgeFilesLines
* xen/cppcheck: sort alphabetically cppcheck report entriesLuca Fancellu2023-02-021-0/+8
| | | | | | | | | | | | | | | Sort alphabetically cppcheck report entries when producing the text report, this will help comparing different reports and will group together findings from the same file. The sort operation is performed with two criteria, the first one is sorting by misra rule, the second one is sorting by file. Signed-off-by: Luca Fancellu <luca.fancellu@arm.com> [stefano: add black line for code style] Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com> Reviewed-by: Michal Orzel <michal.orzel@amd.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
* xen/scripts: add cppcheck tool to the xen-analysis.py scriptLuca Fancellu2022-12-121-0/+130
Add Cppcheck analysis to the xen-analysis.py script using the arguments --run-cppcheck. Now cppcheck analysis will build Xen while the analysis is performed on the source files, it will produce a text report and an additional html output when the script is called with --cppcheck-html. With this patch cppcheck will benefit of platform configuration files that will help it to understand the target of the compilation and improve the analysis. These are XML files placed in xen/tools/cppcheck-plat/, describing to cppcheck the length of basic types to help it in the analysis. To do so: - Update xen-analysis.py with the code to integrate cppcheck. - add platform configuration files for cppcheck.. - add cppcheck-cc.sh script that is a wrapper for cppcheck and it's used as Xen compiler, it will intercept all flags given from the make build system and it will execute cppcheck on the compiled file together with the file compilation. - guarded hypercall-defs.c with CPPCHECK define because cppcheck gets confused as the file does not contain c code. - add false-positive-cppcheck.json file - update documentation. - update .gitignore Signed-off-by: Luca Fancellu <luca.fancellu@arm.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Tested-by: Stefano Stabellini <sstabellini@kernel.org>