[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v4 0/2] Enable MC/DC support for GCC/GCOV


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Mon, 7 Apr 2025 16:46:19 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=A+EJilJ78PZwuNmgGiAes0CZGmVXgRwE+jV/ppxayRQ=; b=lsR9KtPev2Dt69eT8AypGbJCJbgGdF+6u7jAHePZOmRgGV+inw3pQIkKXKc/I886mNo6JHVFIClxC0cELMJUqBZOejhRGnCl9XP7HvDhwRuwl5Tr13KeMWJagzU6K0Ay4oh5HYB5cMnqa4XTl/eTOnEGoCbNAh8KfwciDisHfKHdQ92JkaWZ4CLuJXsqTPEGgpSjUcTNsUUavfME8jRzGFwa6OpR7ATqjSxs9JRd+bArcApBNx8qg7HgaQY+MmLG4/x7aMdvCxT7qCuLnC6f2PuoKNyViCR1sqt21Z1mE4UYbMuZCPaO/22UNQvkfpayqzRgpGACoqikT6WJcbewdA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ndx+LHm0/zghAaP3BcYVtZnY2U7c6U2rQyJWUQSFXUUpvNFaMYEGl+PPOF/3eYgetNf5POXw2IoHZvPCAtZoxmSRMU4LVaJ1ZdEQXRVoSH+oEgWhLm4/57hRQqrsAlvkS2mgskI4INq/jo94NT0qD3FPqGvV85cOvcuGMry+c5Nq3CnEphpZhOqDklhGbIXcH+JbbH6oR00VLqUw73C6Xtei9YFEcHF6AyE4DUcOOMtQ3R6ELUebAn9tIuPANiVFhaIrh1JUflVCGn0yda8GXNrDaYpq1tNsChFbmYSW/wlF63s4e+SiYxVjrpmKTkPKszG+dRU2aWF2ErrqayLrug==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 07 Apr 2025 16:46:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbp9yWGdOlaD6DSkiV7Tp26KtCBA==
  • Thread-topic: [PATCH v4 0/2] Enable MC/DC support for GCC/GCOV

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.

First patch in the series ("xen: x86: irq: initialize irq desc in
create_irq()") deals with unexpected GCC issue, which is not exactly
related to the code coverage, as it can be reproduced just with -Og
optimization level. I have opened the bug here:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119665

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 GCC/GCOV.

Changes in v4:
 - one patch less, as "xen: gcov: add support for gcc 14" is merged already
 - reworked irq.c fix back to original state (but with a comment this time)
 - opened a GCC bug
 - make COV_FLAGS -> cov-flags-y convertion as part of the second patch

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 (2):
  xen: x86: irq: initialize irq desc in create_irq()
  xen: debug: gcov: add condition coverage support

 xen/Kconfig        |  4 ++++
 xen/Kconfig.debug  |  9 +++++++++
 xen/Rules.mk       | 14 +++++++-------
 xen/arch/x86/irq.c |  2 +-
 4 files changed, 21 insertions(+), 8 deletions(-)

-- 
2.48.1

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.