From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::52a; helo=mail-pg1-x52a.google.com; envelope-from=prabinca4u@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (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 371D2210DA17A for ; Mon, 6 Aug 2018 07:51:07 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id r1-v6so6331007pgp.11 for ; Mon, 06 Aug 2018 07:51:07 -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=uLhFGF4fFZmOJrCqCvQ3LAYSg2p8Ynfi6zL6ms6Wdak=; b=DAYNkEPFcQb03CqjP0EAsgiZJUsg4srfd+25rargwroCWCoz+hV5ppqE0I0fMel5n6 BMfEx8dwVAVtXLAr4elB3M3zV8cGh+gx/IgRMHtbAoSjl5EqBWGIQz72X+5NDRgGZgh3 VptgJlTz0eOz+azzluqNho7tKscdUyhW8JWIAlrlcsrYHWqYy1t6C2w9XcZ/6e0eNyvO bpGRXOeDgmF2eNaEVwJdfgo/kF4ShyRiPDdRhIChxRdpFfS65T0rkDAawvi6GVTOy9V3 bke6sVc0KPwSODJ2Aasyb9RQn6Ja0dbvjmlUhjGdruHiR63r2VX4K1gWwqCFZsbkP5L9 VbmQ== 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=uLhFGF4fFZmOJrCqCvQ3LAYSg2p8Ynfi6zL6ms6Wdak=; b=R0Zfvr9xe9PUNDU41Nr49WXUPhiWoO+GUkkubpop7pGBmJR3r4urfxiiWgIg8lbwv7 +8w7dAOD3uu4uQlyXI8H3lbIb9/1fKuOw9HVi1206IBrcrn/zKnUkJdWs5KPD4f4w31F LMPW3B1mQZyhbTxMQ3dMLxdt3CGyf9KmhV6UKgihCVFP//a/XrdgzCaKl7e2PQ9RfssC 9vceAzqFFNCDvan47g3N6p3vJWkInf1XFNAxIlCk81EZHPUThcHtgv6GmbuFQfkbvE4O l124Rm2mYghyOmO8QxSwTl7OAtw/JrxXwmmzwFVxWM/dWmyWYJdoPyytgA8AxWRtiKEO 8pUQ== X-Gm-Message-State: AOUpUlHRhHBcwBNOLuroXYEG3maxCzl+LsPNywJXkMgw1i8giVcwm/We q+fU/BTy4jx5MVpUxIKlJ6w= X-Google-Smtp-Source: AAOMgpeBMgPS8H/SO6K3UfVuvuddeciPX1Im3dBOBbVmxiLGUCNog/xNoUyBqrykTy3HlJ6ShaIwiA== X-Received: by 2002:aa7:88d3:: with SMTP id p19-v6mr12022102pfo.160.1533567066779; Mon, 06 Aug 2018 07:51:06 -0700 (PDT) Received: from [100.79.120.176] ([49.15.223.56]) by smtp.gmail.com with ESMTPSA id c66-v6sm10417297pfc.138.2018.08.06.07.51.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 07:51:05 -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: Mon, 6 Aug 2018 20:21:03 +0530 Cc: Andrew Fish , edk2-devel , Laszlo Ersek Message-Id: 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: Mon, 06 Aug 2018 14:51:07 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Team It=E2=80=99s got resolved now, thanks for kind support. The link and documents mentioned help to resolve and understand the architec= ture as well=20 Thanks for such kind support by Laszlo, Andrew and Dandan > 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