From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on072d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::72d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 636D81A1DFF for ; Wed, 26 Oct 2016 22:49:37 -0700 (PDT) Received: from DF4PR84MB0025.NAMPRD84.PROD.OUTLOOK.COM (10.162.192.14) by DF4PR84MB0123.NAMPRD84.PROD.OUTLOOK.COM (10.162.192.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12; Thu, 27 Oct 2016 05:49:35 +0000 Received: from DF4PR84MB0025.NAMPRD84.PROD.OUTLOOK.COM ([10.162.192.14]) by DF4PR84MB0025.NAMPRD84.PROD.OUTLOOK.COM ([10.162.192.14]) with mapi id 15.01.0679.015; Thu, 27 Oct 2016 05:49:35 +0000 From: "Lin, Derek (HPS UEFI Dev)" To: "afish@apple.com" CC: "edk2-devel@lists.01.org" , "Shia, Cinnamon" Thread-Topic: [edk2] [BaseTools] Library GUIDs missing from Guid.xref file. Thread-Index: AQHSL+637m0gt1BefEud2qkE2Tmo86C7ii/QgAAZptCAACEjgIAAA2iA Date: Thu, 27 Oct 2016 05:49:35 +0000 Message-ID: References: <497D3E4E-A601-476E-897C-78F3ED389C46@apple.com> <88D9A338-D75C-4509-8079-2821EE9EF313@apple.com> In-Reply-To: <88D9A338-D75C-4509-8079-2821EE9EF313@apple.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=derek.lin2@hpe.com; x-originating-ip: [15.211.131.11] x-ms-office365-filtering-correlation-id: 3632a377-9be9-4e37-107c-08d3fe2d0848 x-microsoft-exchange-diagnostics: 1; DF4PR84MB0123; 7:Hu0xft3Xp180Atdg4tqB7MSdig7iWsXSMl/B8kkQNLpyU6vW6aoIDvCujT5iZQxk5Smn86ByFwvj+mycFleXWMODvDTW44HxzjzBv/b0GvzmVFMcqU2kwan5bNVMFzlxb2YTkGtWeTzbtKw/k93QLEdopwcZoiYGS8O/jUj/XyC9jPEHGEXBheXCo+cjp3GxE1SUgAiRYJ9jk+S2zezkKH54xmEHUVZ60VzYh59uMyelMMbRCH/qJ6+ojQozhgZ0EgcP8C12yZywncArSnv4UY4O+/9LzuZM+gBTHyzagbnEue6MY0uPIZtzilMrTWBCIaRoTkBL6c8BEJnf/ISgle4mwuV3/wl7oPcPpdaPLKI= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DF4PR84MB0123; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(166708455590820)(162533806227266)(31960201722614); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:DF4PR84MB0123; BCL:0; PCL:0; RULEID:; SRVR:DF4PR84MB0123; x-forefront-prvs: 0108A997B2 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(199003)(189002)(13464003)(24454002)(377454003)(5640700001)(68736007)(86362001)(93886004)(33656002)(122556002)(66066001)(3660700001)(101416001)(586003)(10400500002)(2351001)(2906002)(3846002)(6116002)(3280700002)(102836003)(99286002)(4326007)(105586002)(106116001)(106356001)(19580405001)(19580395003)(2900100001)(5002640100001)(92566002)(87936001)(8666005)(11100500001)(97736004)(2950100002)(2501003)(305945005)(189998001)(7846002)(74316002)(9686002)(81156014)(6916009)(7736002)(81166006)(1730700003)(5660300001)(110136003)(8676002)(15975445007)(50986999)(8936002)(54356999)(77096005)(7696004)(76176999)(7059030); DIR:OUT; SFP:1102; SCL:1; SRVR:DF4PR84MB0123; H:DF4PR84MB0025.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2016 05:49:35.4304 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR84MB0123 Subject: Re: [BaseTools] Library GUIDs missing from Guid.xref file. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 05:49:37 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Andrew, The ModuleGuidDict was not for performance, it's because Arch IA32 X64 have= same library name/FILE_GUID pair, for not duplicate it. You are right the patch add library FILE_GUID but they are not end up in th= e ROM, I'm ok remove it or not. Feel free to update the patch. Thanks, Derek -----Original Message----- From: afish@apple.com [mailto:afish@apple.com]=20 Sent: Thursday, October 27, 2016 1:25 PM To: Lin, Derek (HPS UEFI Dev) Cc: edk2-devel@lists.01.org; Shia, Cinnamon Subject: Re: [edk2] [BaseTools] Library GUIDs missing from Guid.xref file. > On Oct 26, 2016, at 9:09 PM, Lin, Derek (HPS UEFI Dev) wrote: >=20 > Hi Andrew, >=20 > We also see this issue recently. And we have a fix. I've send email patch= minutes ago. >=20 Derek, Thanks for sharing the fix.=20 I noticed it introduced a build failure for a badly formed library INF file= . I assume that means this fix is pulling in libraries that are in the DSC = file, but not currently being built? That is not really a problem as it mea= ns you have too many GUID vs. not enough.=20 I also noticed that your fix adds the FILE_GUID values for all the librarie= s. The FILE_GUID values for the any PEIM, DXE/UEFI driver that end up in an= FV will be present in the ROM, but the library values do not end up in the= ROM. Also by changing the code to use a Python dictionary the order of eve= rything changed. I had a debugger command that would just dump out the FILE= _GUDs, so it would be good to maintain the old behavior.=20 GuidDict =3D {} for Arch in ArchList: PlatformDataBase =3D BuildDb.BuildObject[GenFdsGlobalVariable.= ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable= .ToolChainTag] - for ModuleFile in PlatformDataBase.Modules: + for ModuleFile in [x for x in PlatformDataBase.Modules] + [x f= or x in PlatformDataBase.LibraryInstances]: Module =3D BuildDb.BuildObject[ModuleFile, Arch, GenFdsGlo= balVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] - GuidXRefFile.write("%s %s\n" % (Module.Guid, Module.BaseNa= me)) + if ModuleFile in PlatformDataBase.Modules: + GuidXRefFile.write("%s %s\n" % (Module.Guid, Module.Ba= seName)) for key, item in Module.Protocols.items(): GuidDict[key] =3D item for key, item in Module.Guids.items(): If your adding ModuleGuidDict was a performance fix, I guess I could just m= ake it a list to keep order.=20 Thanks, Andrew Fish > Thanks, > Derek >=20 > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of An= drew Fish > Sent: Thursday, October 27, 2016 9:08 AM > To: edk2-devel > Subject: [edk2] [BaseTools] Library GUIDs missing from Guid.xref file. >=20 > I noticed if a GUID (PPI & Protocol) was only used via a library it does = not end up in the Guid.xref file.=20 >=20 > It looks to me like this code is only extracting the GUIDs from the Drive= rs INF file and the GUIDs defined in dependent libraries are skipped? =20 >=20 >=20 > https://github.com/tianocore/edk2/blob/master/BaseTools/Source/Python/Gen= Fds/GenFds.py#L701 >=20 > for Arch in ArchList: > PlatformDataBase =3D BuildDb.BuildObject[GenFdsGlobalVariable.= ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable= .ToolChainTag] > for ModuleFile in PlatformDataBase.Modules: > Module =3D BuildDb.BuildObject[ModuleFile, Arch, GenFdsGlo= balVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] > GuidXRefFile.write("%s %s\n" % (Module.Guid, Module.BaseNa= me)) > for key, item in Module.Protocols.items(): > GuidDict[key] =3D item > for key, item in Module.Guids.items(): > GuidDict[key] =3D item > for key, item in Module.Ppis.items(): > GuidDict[key] =3D item >=20 >=20 > Does anyone know how to extract the info from the dependent libs?=20 >=20 > I have an lldb type formatter for EFI_GUID that will print out the GUID C= name so I noticed when some of them went missing.=20 >=20 > Thanks, >=20 > Andrew Fish > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel