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

Re: [XEN][PATCH v2] coverage: extend coverage on .init and lib code


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Sat, 6 Dec 2025 11:10:48 +0200
  • 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=DqgLXmt3DXUKtquYLWrQjRySLllKUGthEDIRqk2xpnM=; b=NFIccQZ+1qC+zZk3mMykHEA/B75EOYedlsD5r55QsH0NyMaqdi9Ytby8tSScAKalyPHwnV7Vf3iRCyQ8O11jxIPTvJiRTzeqvvMC3qWQOc8cGiTzkcUz8EUrjFw9OV6CVeLAzw3TYKDJ5BTNOqtY8+yFDLPmnkUlPcu/LeVjZ0WTExQHCRLpHv9REasD6rOtFP+Lj9eZzflbjtUGrzfZRgbjR3b0zrh7V1FtS9XTOsTqDNreR2mIMp3IfqoQosjgMeguRDBpdJPL+UxOqre3dQFRly7w36M4ThmMXNjCne8hl9jKXEhbR6kN3aV118dWLQjeG9MviICvs3ld5IlFOA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TAIni1LTumLD49AhvXH+8ERxngRs9KbljAzRNz2pkdQoDTN3XtQL3u8Z9u+tcHI0ztmRyceNT+Urp2oEvZHOVZmn/eRK7Y2B9l8u15UVKKAVNFKS+n74eaahNhlEJG6AsWqDQzUnzkf7R1IeNLawO1Is36tYSiwVWSLc6Bp/H5LepsdFy21M7YeJ4eLFucxEEV9ZrM3GDACPBf2vM0ntw6zgWZol8S93Y+4URTUSHhc2gnfYAlQ1NT//FT44dbudLxkghNw6EXREv+a+yZJSiTfAbbB3n2Dcvq3qG1PxU2YPZ4T5Em/YSDj9okbWA+8q76X+SOCnp3gVnt8lneDfjA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, Victor Lira <victorm.lira@xxxxxxx>
  • Delivery-date: Sat, 06 Dec 2025 09:11:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 05.12.25 22:00, Andrew Cooper wrote:
On 05/12/2025 7:34 pm, Grygorii Strashko wrote:
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

Extend coverage support on .init and lib code.
Add two hidden Kconfig options:
- RELAX_INIT_CHECK "Relax strict check for .init sections only in %.init.o
files"
- DO_NOT_FREE_INIT_MEMORY "Prevent freeing of .init sections at the end of
Xen boot."

Both selected selected when COVERAGE=y, as getting coverage report for
".init" code is required:
- to bypass strict check for .init sections only in %.init.o files;
- the .init code stay in memory after Xen boot.

RELAX_INIT_CHECK/DO_NOT_FREE_INIT_MEMORY could be used by other debug
features in the future.

Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
---
changes in v2:
  - add RELAX_INIT_CHECK and DO_NOT_FREE_INIT_MEMORY, those are two different 
things,
    both potentially reusable
  - enable coverage for libfdt/libelf always
  - enable colverage for .init always

This is a lot nicer (i.e. more simple).

But, I still don't know why we need to avoid freeing init memory to make
this work.  What explodes if we dont?


It will just crash when coverage data is collected.

First I made changes in make file to get .init covered
then I hit a crash
then I checked %.init.o
conclusion was obvious.

For example:
objdump -x bzimage.init.o | grep gcov

0000000000000010 l     O .bss   0000000000000028 __gcov0.bzimage_check
0000000000000040 l     O .bss   0000000000000040 __gcov0.bzimage_headroom
0000000000000000 l     O .bss   0000000000000008 __gcov0.output_length
0000000000000080 l     O .bss   0000000000000060 __gcov0.bzimage_parse
0000000000000098 l     O .init.data.rel.local   0000000000000028 
__gcov_.bzimage_parse
0000000000000070 l     O .init.data.rel.local   0000000000000028 
__gcov_.bzimage_headroom
0000000000000048 l     O .init.data.rel.local   0000000000000028 
__gcov_.bzimage_check
0000000000000020 l     O .init.data.rel.local   0000000000000028 
__gcov_.output_length
0000000000000000         *UND*  0000000000000000 __gcov_init
0000000000000000         *UND*  0000000000000000 __gcov_exit
0000000000000000         *UND*  0000000000000000 __gcov_merge_add
0000000000000008 R_X86_64_PLT32    __gcov_init-0x0000000000000004
0000000000000012 R_X86_64_PLT32    __gcov_exit-0x0000000000000004
0000000000000020 R_X86_64_64       __gcov_merge_add


--
Best regards,
-grygorii




 


Rackspace

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