This series enables MC/DC for Xen when building with GCC. Condition coverage, also known as MC/DC (modified condition/decision coverage) is a coverage metric that tracks separate outcomes in boolean expressions. This metric is used in critical software components, so it natural to collect it for Xen.
Second patch in the series ("xen: x86: irq: use do-while loop in create_irq()") deals with unexpected GCC issue. As was discussed in the previous version, I changed "for" loop to "do {} while". This series support only GCC, although Clang, starting with clang 18. supports similar feature. But Clang 18 uses raw profiling format version 10, while Xen supports only version 4, and there are quite substantial changes in headers and structures, so adding new version format is non-trivial. Also, Xen built for aarch64 with clang 19.1.17 and code coverage enabled, completely hangs up during boot, so there is clearly more work required. Another problem with clang-based MC/DC support is that it has multiple issues which will prevent use it in a meaningfull way: https://github.com/llvm/llvm-project/issues?q=is%3Aissue%20state%3Aopen%20MC%2FDC But at least we can have MC/DC with GCOV. Changes in v3: - Check if gcc accepts -fcondition-coverage - Clarify why we use do { } loop - Add Jan's R-b tag for PATCH 1/3 Changes in v2: - Check for gcc 14, not gcc 14.1 - Reworked irq.c patch Volodymyr Babchuk (3): xen: gcov: add support for gcc 14 xen: x86: irq: use do-while loop in create_irq() xen: debug: gcov: add condition coverage support xen/Kconfig | 5 +++++ xen/Kconfig.debug | 9 +++++++++ xen/Rules.mk | 3 +++ xen/arch/x86/irq.c | 17 +++++++++++++---- xen/common/coverage/gcc_4_7.c | 4 +++- xen/common/coverage/gcov_base.c | 5 +++++ 6 files changed, 38 insertions(+), 5 deletions(-) -- 2.48.1