From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.4574.1663075709365686820 for ; Tue, 13 Sep 2022 06:28:29 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=dtM2/7mA; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: gua.guo@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663075709; x=1694611709; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=BU0wEpf7T804GuqRffmivt0s2KzyxyECX/Bbh+a4Inw=; b=dtM2/7mAylIqlTDf968F1OmRT43qeEUuZA3jB3wtYeEjhFL/hE2lg0lt F4SN1sRDyRSRLYURZX3D+XXRr5xzasMmCLOo/PenlrIJ8hAz8cld6xXMB XGCHf/xLQfaQJMgMzhWjJlZJFIreIWObBdtBbSlUcaFNBcBxdgsXvG5IT rIdGY45cTo4Yve339jKK1D6OT/YD9KzATuhGskL/D2XxLcFEv/O+K3HBD mluvmPsDqFcN68c3ojjupPD7T41pLU7878CTrtJliQ4orevUQh+aaA9xG YFVFbH97D08ibXa2p5DDZhDdWxACTWCqwJ7Cqg5A4XgY+w14ud9+Or9n1 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10468"; a="277867881" X-IronPort-AV: E=Sophos;i="5.93,312,1654585200"; d="scan'208";a="277867881" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2022 06:28:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,312,1654585200"; d="scan'208";a="945061973" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP; 13 Sep 2022 06:28:28 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 13 Sep 2022 06:28:28 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 13 Sep 2022 06:28:28 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 13 Sep 2022 06:28:28 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.175) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 13 Sep 2022 06:28:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nMuH5Dnxyox+qj9FlvWfKN6k156kcgPsb4QvMREl7t0fyAP4bWCWv+ePoP8uPUqe+T7ofa1Tm+I+QQSjyl4Uyi8Bj/hWcNWtd/5UOojHtozsmKMtUDExVXYqPhKKHjtRosDOx9BTzldHuu6Dq/jiS+pRtBwGk9aSh21PGB9g4nCP/5Rz80kyCOFxpaPtFxAbS1d2j5iESFVoLEUb7+qh1trRW2sHL1I7h10JvIBpJlExGXjzCa3lmLctuptSEKRg6vdSyoupQC0eJRIp+CGw+ck04It6j0YtVAyZFysBmOFq1nVcz0tWGMGLMn3/mrQBtz+q5uZItqK7la8IjDOn1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Pe1uehO2RquaM6sgCzuPThCE9P1b9CfOr98O74/0hdU=; b=ArtfveiWE6rwWyFumzJTWfErVvzBLJMHnpclu8I5mswmsXZVrGxusIDTtqHfKr+DWczXVreryBG3St/H0BKzU0bTjYRbAlRSkWgmBVZytWmRkHRaQ9SSEiJvk6X0J5e9qwN99j93AH8cgXwHbcEMd6S03Ja2RPRpfr5d7gettAdbwXyRo6mV/a06VUbDV5N2zRSjFJYL7O2Bixpnl5Mi1zdFot6qFiy21bTKStF+qDyIZYDZnbLVE496wZPHy55Jy69FqFERzg3mNKBe0t0+J3yDQc26r2KN24G4vEw2zzXegPjHAN2aPFCGrC8x//aCiS1AhlmrIm7tTQvUs424lw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BL1PR11MB5478.namprd11.prod.outlook.com (2603:10b6:208:31d::12) by CH0PR11MB5346.namprd11.prod.outlook.com (2603:10b6:610:b9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.19; Tue, 13 Sep 2022 13:28:26 +0000 Received: from BL1PR11MB5478.namprd11.prod.outlook.com ([fe80::9930:7abb:756f:7bf5]) by BL1PR11MB5478.namprd11.prod.outlook.com ([fe80::9930:7abb:756f:7bf5%8]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 13:28:25 +0000 From: "Guo, Gua" To: "devel@edk2.groups.io" CC: "Kinney, Michael D" , Sean Brogan , "Barkelew, Bret" , Michael Kubacki Subject: Re: [PATCH] UnitTestFrameworkPkg: Add code coverage support for GCC Thread-Topic: [PATCH] UnitTestFrameworkPkg: Add code coverage support for GCC Thread-Index: AQHYx3Qt70b1/qw1m0KWMSP1PsljKq3dWZAw Date: Tue, 13 Sep 2022 13:28:25 +0000 Message-ID: References: <15e8fe2d2709a822fdbc4956ceb2c4b92412e523.1663075356.git.gua.guo@intel.com> In-Reply-To: <15e8fe2d2709a822fdbc4956ceb2c4b92412e523.1663075356.git.gua.guo@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.500.17 dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BL1PR11MB5478:EE_|CH0PR11MB5346:EE_ x-ms-office365-filtering-correlation-id: bfb9b20c-146d-4987-067d-08da958bd67e x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9+WpeR2abNzAJHUhGU+7RWMXcKc8NUqOgO3afSWTWbAPeox001RgfapHsheqkBETPC2DPKJIqHzBq9rtHtr+40UI8MdqRk0gr7h35CRoiJyK6m+/bml/92qvSAHyrTR+qhoryJl8n7holDtm4pdqY+CCpIOhSBxurH9rZm90zLu+XwmZptRZ7w6loH9qApVqy5kh5eVnD/kT3y0mpTlPOLKCrYiwjZqZunsvEMrX2A3Q28FzT3wnvptw6hS4yaD2Q86+jt5uiXpjrb/hGy3DyHivmNg8xbHqDmxMR1ObGWTmOCU6Z5Tv6YJK4rQxxe6ujfZ4GMkgbuzkCLYSvqIwAF1coCPdlDT0yNVoghmMTX6nIQtYMZ48cxI/8Syuiaf1IUpX6MBBS5/rBnTZhZIg9pv1Mxwvt7oZmUMv5NxHXOizXeDpaz44TpQGaGmzuPR2jY1kSlkoGumY3jbmO6CBk8HO1IYQ1TyqdKo+z/jNRz4/Lk7rJGQYhPnvLBNb1WXl81CPpzqJgHZa3zuCiuc16dvjEASI8ubqLJFv4l0ON3IiCLz5p0yk7x9rPqHHmX+2EYqcxT/fr5Nr+4b6jqIrz2UmOGdF6MNpaNEFQA9zuC9BgKEU2u4/3I4VBFCCjEJa4mqYj4z+e5C7RwZusuYDV60wUTybqQswpOC+PBTPYsye2x8a3HbxSql4cHK0QHkHOLpkQpR99louZ0icl7vsKJ2/1wjYtLIZkhkfUkFhUyGyMISgJw9fhBJJTf4fNNnk5fivXee2D99+idJDkthyCA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR11MB5478.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(376002)(346002)(136003)(396003)(366004)(451199015)(8676002)(66476007)(38070700005)(2906002)(55016003)(86362001)(9686003)(41300700001)(316002)(53546011)(19627235002)(186003)(6506007)(82960400001)(26005)(64756008)(5660300002)(66946007)(122000001)(54906003)(83380400001)(8936002)(478600001)(71200400001)(33656002)(7696005)(4326008)(66556008)(76116006)(66446008)(6916009)(38100700002)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?B6fIoII1V2r70QOB+wM2u4vSQMDDRDtzW3HyjF5JomeYazUFgd8ko+4sC5NF?= =?us-ascii?Q?2aJt1VDwe/7X0I67cbpZ0TNK0wlPWDoB2WIigorwVu0AEeFfaG6m632S5Wui?= =?us-ascii?Q?6RRtj1cMdbm15n35hvIjHTVqge/N+wHEA2B+xb2MCKoHdVrbK79zJC2vQkcS?= =?us-ascii?Q?4b4C0rma4XwRVppAm7OcdVtOu8tb1AG8fQkj2WBccxFBODUtOebzMly2wZ1U?= =?us-ascii?Q?dLKL7N8zetQAla3jH0PhK01VGPJr7RnM5MurzJbYEoUuh9xiuB/001tjPOge?= =?us-ascii?Q?MqhgigYjUlKHw5XKXB5bZJq2VzK2ggy6nXVgVvDScI3E592Sxnw8Fmbj4WP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bxkvN22DXXk8OkiO7pcgROaPqMUwHan?= =?us-ascii?Q?s22LAOWtyf7ge0HluKEoHcwOUjF+GLKDDznNIWHVRpRk+6uKhR8u15sQG2xD?= =?us-ascii?Q?IbVZfd8GrTb2UA10DV274SiC+QNIsPUXEWO/4yG5v+Du8N/9yo+kMTqlGu9J?= =?us-ascii?Q?AHdNsGeLjN88Y2e/MbT/LG+JsIeRzvTjjGvPD5384otug+u652TwwDnO0AiA?= =?us-ascii?Q?8UvF+HshMDzdw0Q1K6/vLZHAnkGChCuh3m86tNx2P1uPMWf2/VPy6ASMNW0L?= =?us-ascii?Q?lBKaKiyIjLGWSSVekJ4RvZ+kD+XnhLzfxW6XkIr/iOqg2EOzbnNINenYQZdO?= =?us-ascii?Q?6zSYl7GhgkkF+uwu7nM=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5478.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfb9b20c-146d-4987-067d-08da958bd67e X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2022 13:28:25.7610 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5FSVxiKasFho0LIQbrp3UuFhvOWyY7G8cABpKXCYcQXY9pZ0b4lrw6Uf79iD5AbzAJIh2vyOCSZMFEK95YErWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5346 Return-Path: gua.guo@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi All I want to follow below steps to generate code coverage data based the defau= lt build. But I notice currently GCC compiler flags won't generate *gcda an= d *.gcno. So add the CC flags to generate necessary data that require by "lcov" tool. I'm not sure whether have any concern to add the flags by default. Step1. sudo apt-get install lcov Step2. stuart_ci_build -c .pytool/CISettings.py -p MdePkg -t NOOPT -a IA32,= X64 TOOL_CHAIN_TAG=3DGCC5 --verbose Step3. lcov -c --rc lcov_branch_coverage=3D1 -o UnitTest.info -d Build/MdeP= kg/HostTest/NOOPT_GCC5/X64/MdePkg/ Step4. genhtml UnitTest.info --branch-coverage -o .Build/UnitTestReport Step5. Open "Build/UnitTestReport/index.html" Thanks, Gua -----Original Message----- From: Guo, Gua =20 Sent: Tuesday, September 13, 2022 9:24 PM To: devel@edk2.groups.io Cc: Guo, Gua ; Kinney, Michael D ; Sean Brogan ; Barkelew, Bret ; Michael Kubacki Subject: [PATCH] UnitTestFrameworkPkg: Add code coverage support for GCC From: Gua Guo In order to collect code coverage after running executable file, generate *= .gcda and *.gcno file that require by lcov tool to generate code coverage r= eport. Cc: Michael D Kinney Cc: Sean Brogan Cc: Bret Barkelew Cc: Michael Kubacki Signed-off-by: Gua Guo --- UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTe= stFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc index 4dd8d4ac67..8623aecb33 100644 --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc @@ -19,7 +19,7 @@ MemoryAllocationLib|UnitTestFrameworkPkg/Library/Posix/MemoryAllocationL= ibPosix/MemoryAllocationLibPosix.inf [BuildOptions]- GCC:*_*_*_CC_FLAGS = =3D -fno-pie+ GCC:*_*_*_CC_FLAGS =3D -fno-pie -ftest-coverage -fprofile-ar= cs !ifdef $(UNIT_TESTING_DEBUG) MSFT:*_*_*_CC_FLAGS =3D -D UNIT_TESTING_= DEBUG=3D1 GCC:*_*_*_CC_FLAGS =3D -D UNIT_TESTING_DEBUG=3D1--=20 2.31.1.windows.1