From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.171.2.68; helo=ma1-aaemail-dr-lapp02.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from ma1-aaemail-dr-lapp02.apple.com (ma1-aaemail-dr-lapp02.apple.com [17.171.2.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E89B92098C8AC for ; Fri, 3 Aug 2018 11:38:37 -0700 (PDT) Received: from pps.filterd (ma1-aaemail-dr-lapp02.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp02.apple.com (8.16.0.22/8.16.0.22) with SMTP id w73IasLu018573; Fri, 3 Aug 2018 11:38:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=mime-version : content-type : sender : from : message-id : subject : date : in-reply-to : cc : to : references; s=20180706; bh=etFJrmOsYDtO+WyKrMvWqnUd9mq3m0IUFzQIcjL/J78=; b=AhEMTCIwjgXvGiLyTlJEsAm8pWdE9+bRmNdV5pc4xRR+9wdAEJVFfqHoxNvoiuqzHspF 5P8HwcVIK6Ne7+XBaf0O6xuIBOL+Vck5Yu3CPQopvDfKUWmtxUeKxZ4z3kfHHJNy+oAc lm6zVbqOY2vPMB7K4bhDfOrlR3GShDuPlSqAZ1w8fXR4FNkfNNOvgjCPCuJJxyCFIR5R AKrU6u+HA8GUsoZIZgugNHLjqDTFwNGx800gJwViaIvMtfxD2gt7mENjKBF6gPVV73/h gGd4Rl9sUTmyvjdK9MtSmTm+U9pRiDrldvlUeamEXXpdYqnvs/cUPovnXSzChZ6kln3o Dw== Received: from mr2-mtap-s03.rno.apple.com (mr2-mtap-s03.rno.apple.com [17.179.226.135]) by ma1-aaemail-dr-lapp02.apple.com with ESMTP id 2km9yp8ggm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 03 Aug 2018 11:38:36 -0700 MIME-version: 1.0 Received: from nwk-mmpp-sz11.apple.com (nwk-mmpp-sz11.apple.com [17.128.115.155]) by mr2-mtap-s03.rno.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) with ESMTPS id <0PCW001YEEGBHHE0@mr2-mtap-s03.rno.apple.com>; Fri, 03 Aug 2018 11:38:35 -0700 (PDT) Received: from process_viserion-daemon.nwk-mmpp-sz11.apple.com by nwk-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) id <0PCW00000E79YO00@nwk-mmpp-sz11.apple.com>; Fri, 03 Aug 2018 11:38:35 -0700 (PDT) X-Va-A: X-Va-T-CD: 49f1857882a0b7f3e611e01672125c1a X-Va-E-CD: 8062713ad0e3097c25a90c227f283f53 X-Va-R-CD: d5b9ce4224933e202f76c106c3451ac6 X-Va-CD: 0 X-Va-ID: 277a7a30-05ac-4e09-9eac-ea8fa1405a42 X-V-A: X-V-T-CD: 49f1857882a0b7f3e611e01672125c1a X-V-E-CD: 8062713ad0e3097c25a90c227f283f53 X-V-R-CD: d5b9ce4224933e202f76c106c3451ac6 X-V-CD: 0 X-V-ID: 234d8d90-f492-4408-8904-f35143044a1c Received: from process_milters-daemon.nwk-mmpp-sz11.apple.com by nwk-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) id <0PCW00L00E24TJ00@nwk-mmpp-sz11.apple.com>; Fri, 03 Aug 2018 11:38:35 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-03_07:,, signatures=0 X-Proofpoint-Scanner-Instance: nwk-grpmailp-qapp17.corp.apple.com-10000_instance1 Received: from [17.235.37.141] (unknown [17.235.37.141]) by nwk-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) with ESMTPSA id <0PCW00MXXEG62G70@nwk-mmpp-sz11.apple.com>; Fri, 03 Aug 2018 11:38:33 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish Message-id: <0A491E19-F3A7-46BF-A4BA-9D54B2D1432E@apple.com> Date: Fri, 03 Aug 2018 11:38:29 -0700 In-reply-to: <1deaed58-5098-aa30-b401-f415a034957d@redhat.com> Cc: edk2-devel , Laszlo Ersek To: prabin ca References: <8E875131-258C-4F21-B104-EB36CE970701@gmail.com> <1deaed58-5098-aa30-b401-f415a034957d@redhat.com> X-Mailer: Apple Mail (2.3445.6.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-08-03_07:, , signatures=0 X-Content-Filtered-By: Mailman/MimeDel 2.1.27 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: Fri, 03 Aug 2018 18:38:38 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Prabin, There is a PCD setting to configure performance collection.=20 PCDs are defined in the .DEC file and it looks like the default is zero = and that means disabled.=20 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.PcdPerformanceLibraryPropertyMask|0|UINT8|0x00000= 009 If you search the code you will see some platforms enabling 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 So I'd check that 1st. If that does not work I recommend adding = -report-file=3Dbuild.log to your build command. You can look at the = given driver/app you care about and see what the PCD settings are and = which instance of the PerformanceLib got linked.=20 Thanks, Andrew Fish > On Aug 3, 2018, at 11:17 AM, Laszlo Ersek wrote: >=20 > Hi Prabin, >=20 > On 08/03/18 09:29, prabin ca wrote: >> Hi Team, >>=20 >> I=E2=80=99m new to uefi and edk. Currently I=E2=80=99m trying to get = performance of my 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 build and tested well in 2/3 platform. It=E2=80=99s = giving proper response. >>=20 >> But when I=E2=80=99m Checking with multiple platform, in some of = platforms 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 > I can only give you some hints, because thus far I have also failed to > figure out how performance measurements should be enabled for a = platform > from scratch. >=20 > Earlier I thought that an interested platform should include modules > from PerformancePkg. I got some good results that way; however: >=20 > - it wouldn't work for AARCH64, and so I filed > >=20 > - ultimately PerformancePkg was removed in commit 922c1e94e4bb > completely. (And for that reason I now closed TianoCore#679 as > WONTFIX.) >=20 > Commit 922c1e94e4bb doesn't really give pointers for enabling > performance measurements in a platform -- it refers the user to the DP > shell command instead of the standalone DP application, but that's = 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 = Firmware > Performance Data Table) support in edk2, for exposing firmware > performance data to the OS. Again, that's not about *recording* the = stats. >=20 > The second section of the same chapter seems to describe how stats can > be recorded however. AIUI, the DXE Core can provide the = PERFORMANCE[_EX] > protocols, if the DxeCorePerformanceLib instance is linked into it by > the platform DSC file. In turn DXE modules can send measurements to = the > protocol via the PerformanceLib APIs / DxePerformanceLib instance. >=20 > In fact, the relevant library INF files have good documentation, we = 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 > platforms and why it doesn't on others. You haven't shared much > information about the platforms in question. I can make one guess: if > the performance protocol provided by the platform's DXE Core > (DxeCorePerformanceLib) is incompatible with the DxePerformanceLib > instance that is linked into your DXE driver, then communication = between > them will likely fail. >=20 > To my understanding, the performance protocol is not standard (PI or > UEFI), so it's likely best if you build your DXE driver together with > the DXE Core, on all platforms that you want to check. It's probably > 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