From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c01::231; helo=mail-pl0-x231.google.com; envelope-from=prabinca4u@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-pl0-x231.google.com (mail-pl0-x231.google.com [IPv6:2607:f8b0:400e:c01::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B127F210D5124 for ; Sat, 4 Aug 2018 03:29:56 -0700 (PDT) Received: by mail-pl0-x231.google.com with SMTP id s17-v6so3641450plp.7 for ; Sat, 04 Aug 2018 03:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LWHCBeiEZNZKKPXz7WDqBUo4f0WJ8AUiEVMo85JAHKI=; b=W8j5lm930AoOqqVEwolYSBAmSYB8qwgfNLsL6FzYIZD94ZfcBauqxIrJQIyANWAla7 D1J4d0tjKURbXm7Jbbx1QpMCZaAouK4jH3ME67j+bh+wHSp3WMvsDtmQagmaoYOT4pTW ZGC1lbAz9vE2Y0fh+PUimkwPDD04BQQzDHajinXqM/q4ynAmAzfxdAvK6GrhpoeBlzyu QoWoWkdxFBRQah7t7idSSsAPtolJk4JZstmlAZulY7A0l7rhfl2xraB9dH+03dTJ+Agx oSN3jXw0HHo+vojjbEp6ifEYHFVII1HTghhQERtq78pTQ9izuxr1DgwgxFCFCNTnbOLy n0tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=LWHCBeiEZNZKKPXz7WDqBUo4f0WJ8AUiEVMo85JAHKI=; b=M5lPWChqnWJwqAYOOE542Seq4/aupWdF2E/MvbvGWBR5YzaBTu7VI7RSstxCPugbcf cGnmHJqzl5mNmMUBh2wUs/DB47WnCtBK9r8L+85vtqhrEQnr34W9A8+EBFP/i/Te8iA2 9NWoE8xeRbu6d1r83+zo0iUDfNahGx7pEQXF3+Hid51kuf5bHiSK1EY+bPnmZniF+Osv LoGF0UiFPZBEpMYP3WDk/jCTtyzViZpyPz/jAmHbz3v9NZfHOxDisBVEfY0HVnfFoY4l wcwP48g3rXGaPMdHYTb6JmW/oIq+UaKbAcDjtTGqRHr10G0YrEcQsdDFQkpscYpXxaGk 0WZw== X-Gm-Message-State: AOUpUlHNRjlbpGT5RsjmIZVjiYIx+CSI+fijxlB3J4iZGteJb2FpFSNM bbNSBE17LcVQnN3mu6RxIm4= X-Google-Smtp-Source: AAOMgpeMJ3sjCFZqOvQSQ82WxSSwNqNqaX5Weesqm13ZhK26bFegbmLzv2Wei5qCErS3WdBIFIyzeA== X-Received: by 2002:a17:902:585:: with SMTP id f5-v6mr6904789plf.7.1533378596108; Sat, 04 Aug 2018 03:29:56 -0700 (PDT) Received: from [192.168.1.8] ([171.61.64.187]) by smtp.gmail.com with ESMTPSA id x66-v6sm15303238pff.123.2018.08.04.03.29.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Aug 2018 03:29:55 -0700 (PDT) Mime-Version: 1.0 (1.0) From: prabin ca X-Mailer: iPhone Mail (15E302) In-Reply-To: <3C0D5C461C9E904E8F62152F6274C0BB3BB50CF7@shsmsx102.ccr.corp.intel.com> Date: Sat, 4 Aug 2018 15:59:50 +0530 Cc: Andrew Fish , edk2-devel , Laszlo Ersek Message-Id: <027F20CF-BD18-4613-A3A6-6C0BADB06361@gmail.com> References: <8E875131-258C-4F21-B104-EB36CE970701@gmail.com> <1deaed58-5098-aa30-b401-f415a034957d@redhat.com> <0A491E19-F3A7-46BF-A4BA-9D54B2D1432E@apple.com> <3C0D5C461C9E904E8F62152F6274C0BB3BB50CF7@shsmsx102.ccr.corp.intel.com> To: "Bi, Dandan" Subject: Re: PerformancePkg on multiple platform - X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2018 10:29:56 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Dandan, This is also valuable input from your side, let me check this also. Thanks for kind support > On 04-Aug-2018, at 3:41 PM, Bi, Dandan wrote: >=20 > Hi Prabin, >=20 > Here is a simple introduction of current performance infrastructure in lat= est Edk2 code base. > Hope it can have some help when you enable it. > https://github.com/dandanbi/edk2/wiki/Performance-Infrastructure >=20 >=20 > Thanks, > Dandan >=20 > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of pra= bin ca > Sent: Saturday, August 04, 2018 1:20 PM > To: Andrew Fish > Cc: edk2-devel ; Laszlo Ersek = > Subject: Re: [edk2] PerformancePkg on multiple platform - >=20 > Hi Andrew, >=20 > I have already enabled that PCD in my DSC file, because of that its workin= g in some platform. >=20 > What I'm doing is building my DP.efi and DXE driver from that dsc file and= testing it from UEFI shell. >=20 > thanks for your help as well. >=20 >> On Sat, Aug 4, 2018 at 12:08 AM, Andrew Fish wrote: >>=20 >> Prabin, >>=20 >> There is a PCD setting to configure performance collection. >>=20 >> PCDs are defined in the .DEC file and it looks like the default is=20 >> zero and that means disabled. >> MdePkg/MdePkg.dec >> ... >> ## The mask is used to control PerformanceLib behavior.

>> # BIT0 - Enable Performance Measurement.
>> # @Prompt Performance Measurement Property. >> # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid. >> PcdPerformanceLibraryPropertyMask & 0xFE) =3D=3D 0 >> gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyM >> ask|0|UINT8|0x00000009 >>=20 >> If you search the code you will see some platforms enabling=20 >> performance measurement in their DSC files. >>=20 >> /Volumes/Case/UDK2018(vUDK2018)>git grep gEfiMdePkgTokenSpaceGuid. >> PcdPerformanceLibraryPropertyMask -- *.dsc >> BeagleBoardPkg/BeagleBoardPkg.dsc:272: >> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|1 >> EmbeddedPkg/EmbeddedPkg.dsc:175: >> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0 >> QuarkPlatformPkg/Quark.dsc:373: >> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x1 >> QuarkPlatformPkg/Quark.dsc:376: >> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x00 >> QuarkPlatformPkg/QuarkMin.dsc:334: >> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x1 >> QuarkPlatformPkg/QuarkMin.dsc:337: >> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x00 >> Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:682: >> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x1 >> Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:682: >> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x1 >> Vlv2TbltDevicePkg/PlatformPkgX64.dsc:682: >> *gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask*|0x1 >>=20 >> So I'd check that 1st. If that does not work I recommend adding=20 >> -report-file=3Dbuild.log to your build command. You can look at the=20 >> given driver/app you care about and see what the PCD settings are and=20 >> which instance of the PerformanceLib got linked. >>=20 >> Thanks, >>=20 >> Andrew Fish >>=20 >> On Aug 3, 2018, at 11:17 AM, Laszlo Ersek wrote: >>=20 >> Hi Prabin, >>=20 >> On 08/03/18 09:29, prabin ca wrote: >>=20 >> Hi Team, >>=20 >> I=E2=80=99m new to uefi and edk. Currently I=E2=80=99m trying to get perf= ormance of my=20 >> dxe driver using PerformancePkg of EDK source code. >>=20 >> I=E2=80=99m using perf_start and perf_end T respected check points, it=E2= =80=99s hot=20 >> build and tested well in 2/3 platform. It=E2=80=99s giving proper respons= e. >>=20 >> But when I=E2=80=99m Checking with multiple platform, in some of platform= s=20 >> it=E2=80=99s not working and got hang in uefi she=E2=80=99ll itself. >>=20 >> Please help me to resolve asap, it will be really helpful. >>=20 >>=20 >> I can only give you some hints, because thus far I have also failed to=20= >> figure out how performance measurements should be enabled for a=20 >> platform from scratch. >>=20 >> Earlier I thought that an interested platform should include modules=20 >> from PerformancePkg. I got some good results that way; however: >>=20 >> - it wouldn't work for AARCH64, and so I filed =20 >> >>=20 >> - ultimately PerformancePkg was removed in commit 922c1e94e4bb =20 >> completely. (And for that reason I now closed TianoCore#679 as >> WONTFIX.) >>=20 >> Commit 922c1e94e4bb doesn't really give pointers for enabling=20 >> performance measurements in a platform -- it refers the user to the DP=20= >> shell command instead of the standalone DP application, but that's=20 >> only for displaying the stats, not for recording them. >>=20 >> One document where I found information is the Intel whitepaper >>=20 >> A Tour Beyond BIOS >> Implementing Profiling in with EDK II >>=20 >> (just google it). "Part III =E2=80=93 Performance Profile" is relevant. >>=20 >> The first section of that talks about enabling ACPI FPDT (ACPI=20 >> Firmware Performance Data Table) support in edk2, for exposing=20 >> firmware performance data to the OS. Again, that's not about *recording* t= he stats. >>=20 >> The second section of the same chapter seems to describe how stats can=20= >> be recorded however. AIUI, the DXE Core can provide the=20 >> PERFORMANCE[_EX] protocols, if the DxeCorePerformanceLib instance is=20 >> linked into it by the platform DSC file. In turn DXE modules can send=20 >> measurements to the protocol via the PerformanceLib APIs / DxePerformance= Lib instance. >>=20 >> In fact, the relevant library INF files have good documentation, we=20 >> just have to know what to look at. >>=20 >> Recording stats in the PEI phase, via HOBs: >> - MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf >>=20 >> Recording stats in the DXE phase (protocol provider and consumer): >> - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf >> - MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf >>=20 >> Recording stats in SMM (protocol provider and consumer): >> - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf >> - MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf >>=20 >> Fetching the collected stats (for display or otherwise): >> - MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf >>=20 >> "Do nothing" library instance for all module types: >> - MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf >>=20 >>=20 >> Now obviously this doesn't explain why it works for you on some=20 >> platforms and why it doesn't on others. You haven't shared much=20 >> information about the platforms in question. I can make one guess: if=20 >> the performance protocol provided by the platform's DXE Core >> (DxeCorePerformanceLib) is incompatible with the DxePerformanceLib=20 >> instance that is linked into your DXE driver, then communication=20 >> between them will likely fail. >>=20 >> To my understanding, the performance protocol is not standard (PI or=20 >> UEFI), so it's likely best if you build your DXE driver together with=20 >> the DXE Core, on all platforms that you want to check. It's probably=20 >> unsafe to link a DXE driver against DxePerformanceLib (rather than >> BasePerformanceLibNull) and run it on a random platform. >>=20 >> Hopefully this helps a little. >> Laszlo >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel >>=20 >>=20 >>=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel