[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 3/3] xen: debug: gcov: add condition coverage support
- To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
- From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Date: Mon, 7 Apr 2025 10:37:02 +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=rDdK1kuDQI+B9NOWUNt1I7PjSO8fjzmwaWzqKsDY3go=; b=c7weTQm+K8pd17+XPC8xrieyRRbIyR+mo8HWwsyR1cTetz18iPxEgJnV1wfD8aE2uwLhDe+dUfh5mnNB6Yp62KGyaSKehs8sjlg9Y54XwwdyMXchIjcbEpYhczxH9jg/uXRhQJEWFamYoMuuZNF1fQWURkMhorCleI8OK/pQpJ3f8jaoXYjAIxe7Rv2Qe5Uq/2ti2uzmBchLDZ2fRfDd26rqYDckao2pBWy/yYJw/vrasZe++nKgGrxXsxEbQ5qvV+yVJuff7h6K/YNB04W+pMj5f20XvkAEMpksuBFEzQpCaZES22OgP2cSlKykOB89eAu6b7eMw9WfJeE2xmW3+g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fwGgvcJbnGttTmrIzAcZIXholeFU0qylx89At3gA8HLmFlGBy6gkDSJwPTs9H9QHo93E9fNkNi+FOuNCKsdWD5OFgwaCtrZxWt9peyM1yZw+MhvgTxsvShHqrwdiXcV/l8i98mpFAV7twWdcKbno0Mwa6ijIIBabj4McDJ/u/3zo+Yiarp+BMPJa2ZllEtqvsaOMPV/bOwNDQ0wpHZl6/LRGmLvWuxA/gbc1HAkfe03HgIH7gCBUj4cNT8H81XSGHwnMV+7X4P5qI9s8tbC1kPMj5NzS64abdq7OBzohzYl2scIEopI9xU3MRi15drUMQroNYFPaMecquQM/nK5xOw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 07 Apr 2025 10:37:18 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHboqPjQYlXeZrAE0u+zEMqLR0ZhQ==
- Thread-topic: [PATCH v3 3/3] xen: debug: gcov: add condition coverage support
Hi Anthony,
"Anthony PERARD" <anthony.perard@xxxxxxxxxx> writes:
> On Sat, Apr 05, 2025 at 03:30:49AM +0000, Volodymyr Babchuk wrote:
>> --- a/xen/Rules.mk
>> +++ b/xen/Rules.mk
>> @@ -133,18 +133,19 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)):
>> CFLAGS-y += -DINIT_SECTIONS
>>
>> non-init-objects = $(filter-out %.init.o, $(obj-y) $(obj-bin-y) $(extra-y))
>>
>> -ifeq ($(CONFIG_COVERAGE),y)
>
> This removes an "ifeq ()", so you probably need to remove and "endif"
> somewhere else, which doesn't appear in this snippet.
Yes, I'm sorry, it just didn't got into the snippet. I wanted to discuss
approach only, so this is not the final version.
>> ifeq ($(CONFIG_CC_IS_CLANG),y)
>> - COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping
>> + cov-flags-$(CONFIG_COVERAGE) := -fprofile-instr-generate
>> -fcoverage-mapping
>
> If you do this assignment like that, it would be better to make sure
> $(cov-flags-y) is initialised properly, that is have a:
>
> cov-flags-y :=
>
> before the first conditional assignment, then have all conditional
> assignment be +=.
Sure.
>
>> else
>> - COV_FLAGS := -fprofile-arcs -ftest-coverage
>> + cov-flags-$(CONFIG_COVERAGE) := -fprofile-arcs -ftest-coverage
>> + cov-flags-$(CONFIG_CONDITION_COVERAGE) += -fcondition-coverage
>
> What happen if CONFIG_CONDITION_COVERAGE=y but CONFIG_COVERAGE=n ?
Kconfig ensures that this is impossible:
config CONDITION_COVERAGE
bool "Condition coverage support"
depends on COVERAGE && CC_HAS_MCDC
I believe, this is enough, and we don't need a separate check on
Makefile level.
--
WBR, Volodymyr
|