* PerformancePkg on multiple platform @ 2018-08-03 7:29 prabin ca 2018-08-03 18:17 ` Laszlo Ersek 0 siblings, 1 reply; 8+ messages in thread From: prabin ca @ 2018-08-03 7:29 UTC (permalink / raw) To: edk2-devel Hi Team, I’m new to uefi and edk. Currently I’m trying to get performance of my dxe driver using PerformancePkg of EDK source code. I’m using perf_start and perf_end T respected check points, it’s hot build and tested well in 2/3 platform. It’s giving proper response. But when I’m Checking with multiple platform, in some of platforms it’s not working and got hang in uefi she’ll itself. Please help me to resolve asap, it will be really helpful. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PerformancePkg on multiple platform 2018-08-03 7:29 PerformancePkg on multiple platform prabin ca @ 2018-08-03 18:17 ` Laszlo Ersek 2018-08-03 18:38 ` PerformancePkg on multiple platform - Andrew Fish 2018-08-04 5:17 ` PerformancePkg on multiple platform prabin ca 0 siblings, 2 replies; 8+ messages in thread From: Laszlo Ersek @ 2018-08-03 18:17 UTC (permalink / raw) To: prabin ca; +Cc: edk2-devel Hi Prabin, On 08/03/18 09:29, prabin ca wrote: > Hi Team, > > I’m new to uefi and edk. Currently I’m trying to get performance of my dxe driver using PerformancePkg of EDK source code. > > I’m using perf_start and perf_end T respected check points, it’s hot build and tested well in 2/3 platform. It’s giving proper response. > > But when I’m Checking with multiple platform, in some of platforms it’s not working and got hang in uefi she’ll itself. > > Please help me to resolve asap, it will be really helpful. 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. Earlier I thought that an interested platform should include modules from PerformancePkg. I got some good results that way; however: - it wouldn't work for AARCH64, and so I filed <https://bugzilla.tianocore.org/show_bug.cgi?id=679> - ultimately PerformancePkg was removed in commit 922c1e94e4bb completely. (And for that reason I now closed TianoCore#679 as WONTFIX.) 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. One document where I found information is the Intel whitepaper A Tour Beyond BIOS Implementing Profiling in with EDK II (just google it). "Part III – Performance Profile" is relevant. 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. 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. In fact, the relevant library INF files have good documentation, we just have to know what to look at. Recording stats in the PEI phase, via HOBs: - MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf Recording stats in the DXE phase (protocol provider and consumer): - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf - MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf Recording stats in SMM (protocol provider and consumer): - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf - MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf Fetching the collected stats (for display or otherwise): - MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf "Do nothing" library instance for all module types: - MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf 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. 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. Hopefully this helps a little. Laszlo ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PerformancePkg on multiple platform - 2018-08-03 18:17 ` Laszlo Ersek @ 2018-08-03 18:38 ` Andrew Fish 2018-08-04 5:19 ` prabin ca 2018-08-04 5:17 ` PerformancePkg on multiple platform prabin ca 1 sibling, 1 reply; 8+ messages in thread From: Andrew Fish @ 2018-08-03 18:38 UTC (permalink / raw) To: prabin ca; +Cc: edk2-devel, Laszlo Ersek Prabin, There is a PCD setting to configure performance collection. PCDs are defined in the .DEC file and it looks like the default is zero and that means disabled. MdePkg/MdePkg.dec ... ## The mask is used to control PerformanceLib behavior.<BR><BR> # BIT0 - Enable Performance Measurement.<BR> # @Prompt Performance Measurement Property. # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask & 0xFE) == 0 gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask|0|UINT8|0x00000009 If you search the code you will see some platforms enabling performance measurement in their DSC files. /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=build.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. Thanks, Andrew Fish > On Aug 3, 2018, at 11:17 AM, Laszlo Ersek <lersek@redhat.com> wrote: > > Hi Prabin, > > On 08/03/18 09:29, prabin ca wrote: >> Hi Team, >> >> I’m new to uefi and edk. Currently I’m trying to get performance of my dxe driver using PerformancePkg of EDK source code. >> >> I’m using perf_start and perf_end T respected check points, it’s hot build and tested well in 2/3 platform. It’s giving proper response. >> >> But when I’m Checking with multiple platform, in some of platforms it’s not working and got hang in uefi she’ll itself. >> >> Please help me to resolve asap, it will be really helpful. > > 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. > > Earlier I thought that an interested platform should include modules > from PerformancePkg. I got some good results that way; however: > > - it wouldn't work for AARCH64, and so I filed > <https://bugzilla.tianocore.org/show_bug.cgi?id=679> > > - ultimately PerformancePkg was removed in commit 922c1e94e4bb > completely. (And for that reason I now closed TianoCore#679 as > WONTFIX.) > > 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. > > One document where I found information is the Intel whitepaper > > A Tour Beyond BIOS > Implementing Profiling in with EDK II > > (just google it). "Part III – Performance Profile" is relevant. > > 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. > > 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. > > In fact, the relevant library INF files have good documentation, we just > have to know what to look at. > > Recording stats in the PEI phase, via HOBs: > - MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf > > Recording stats in the DXE phase (protocol provider and consumer): > - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf > - MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf > > Recording stats in SMM (protocol provider and consumer): > - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf > - MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf > > Fetching the collected stats (for display or otherwise): > - MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf > > "Do nothing" library instance for all module types: > - MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf > > > 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. > > 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. > > Hopefully this helps a little. > Laszlo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PerformancePkg on multiple platform - 2018-08-03 18:38 ` PerformancePkg on multiple platform - Andrew Fish @ 2018-08-04 5:19 ` prabin ca 2018-08-04 10:11 ` Bi, Dandan 0 siblings, 1 reply; 8+ messages in thread From: prabin ca @ 2018-08-04 5:19 UTC (permalink / raw) To: Andrew Fish; +Cc: edk2-devel, Laszlo Ersek Hi Andrew, I have already enabled that PCD in my DSC file, because of that its working in some platform. What I'm doing is building my DP.efi and DXE driver from that dsc file and testing it from UEFI shell. thanks for your help as well. On Sat, Aug 4, 2018 at 12:08 AM, Andrew Fish <afish@apple.com> wrote: > Prabin, > > There is a PCD setting to configure performance collection. > > PCDs are defined in the .DEC file and it looks like the default is zero > and that means disabled. > MdePkg/MdePkg.dec > ... > ## The mask is used to control PerformanceLib behavior.<BR><BR> > # BIT0 - Enable Performance Measurement.<BR> > # @Prompt Performance Measurement Property. > # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid. > PcdPerformanceLibraryPropertyMask & 0xFE) == 0 > gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyM > ask|0|UINT8|0x00000009 > > If you search the code you will see some platforms enabling performance > measurement in their DSC files. > > /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=build.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. > > Thanks, > > Andrew Fish > > On Aug 3, 2018, at 11:17 AM, Laszlo Ersek <lersek@redhat.com> wrote: > > Hi Prabin, > > On 08/03/18 09:29, prabin ca wrote: > > Hi Team, > > I’m new to uefi and edk. Currently I’m trying to get performance of my dxe > driver using PerformancePkg of EDK source code. > > I’m using perf_start and perf_end T respected check points, it’s hot build > and tested well in 2/3 platform. It’s giving proper response. > > But when I’m Checking with multiple platform, in some of platforms it’s > not working and got hang in uefi she’ll itself. > > Please help me to resolve asap, it will be really helpful. > > > 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. > > Earlier I thought that an interested platform should include modules > from PerformancePkg. I got some good results that way; however: > > - it wouldn't work for AARCH64, and so I filed > <https://bugzilla.tianocore.org/show_bug.cgi?id=679> > > - ultimately PerformancePkg was removed in commit 922c1e94e4bb > completely. (And for that reason I now closed TianoCore#679 as > WONTFIX.) > > 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. > > One document where I found information is the Intel whitepaper > > A Tour Beyond BIOS > Implementing Profiling in with EDK II > > (just google it). "Part III – Performance Profile" is relevant. > > 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. > > 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. > > In fact, the relevant library INF files have good documentation, we just > have to know what to look at. > > Recording stats in the PEI phase, via HOBs: > - MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf > > Recording stats in the DXE phase (protocol provider and consumer): > - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf > - MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf > > Recording stats in SMM (protocol provider and consumer): > - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf > - MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf > > Fetching the collected stats (for display or otherwise): > - MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf > > "Do nothing" library instance for all module types: > - MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf > > > 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. > > 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. > > Hopefully this helps a little. > Laszlo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel > > > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PerformancePkg on multiple platform - 2018-08-04 5:19 ` prabin ca @ 2018-08-04 10:11 ` Bi, Dandan 2018-08-04 10:29 ` prabin ca 2018-08-06 14:51 ` prabin ca 0 siblings, 2 replies; 8+ messages in thread From: Bi, Dandan @ 2018-08-04 10:11 UTC (permalink / raw) To: prabin ca, Andrew Fish; +Cc: edk2-devel, Laszlo Ersek Hi Prabin, Here is a simple introduction of current performance infrastructure in latest Edk2 code base. Hope it can have some help when you enable it. https://github.com/dandanbi/edk2/wiki/Performance-Infrastructure Thanks, Dandan -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of prabin ca Sent: Saturday, August 04, 2018 1:20 PM To: Andrew Fish <afish@apple.com> Cc: edk2-devel <edk2-devel@lists.01.org>; Laszlo Ersek <lersek@redhat.com> Subject: Re: [edk2] PerformancePkg on multiple platform - Hi Andrew, I have already enabled that PCD in my DSC file, because of that its working in some platform. What I'm doing is building my DP.efi and DXE driver from that dsc file and testing it from UEFI shell. thanks for your help as well. On Sat, Aug 4, 2018 at 12:08 AM, Andrew Fish <afish@apple.com> wrote: > Prabin, > > There is a PCD setting to configure performance collection. > > PCDs are defined in the .DEC file and it looks like the default is > zero and that means disabled. > MdePkg/MdePkg.dec > ... > ## The mask is used to control PerformanceLib behavior.<BR><BR> > # BIT0 - Enable Performance Measurement.<BR> > # @Prompt Performance Measurement Property. > # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid. > PcdPerformanceLibraryPropertyMask & 0xFE) == 0 > gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyM > ask|0|UINT8|0x00000009 > > If you search the code you will see some platforms enabling > performance measurement in their DSC files. > > /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=build.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. > > Thanks, > > Andrew Fish > > On Aug 3, 2018, at 11:17 AM, Laszlo Ersek <lersek@redhat.com> wrote: > > Hi Prabin, > > On 08/03/18 09:29, prabin ca wrote: > > Hi Team, > > I’m new to uefi and edk. Currently I’m trying to get performance of my > dxe driver using PerformancePkg of EDK source code. > > I’m using perf_start and perf_end T respected check points, it’s hot > build and tested well in 2/3 platform. It’s giving proper response. > > But when I’m Checking with multiple platform, in some of platforms > it’s not working and got hang in uefi she’ll itself. > > Please help me to resolve asap, it will be really helpful. > > > 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. > > Earlier I thought that an interested platform should include modules > from PerformancePkg. I got some good results that way; however: > > - it wouldn't work for AARCH64, and so I filed > <https://bugzilla.tianocore.org/show_bug.cgi?id=679> > > - ultimately PerformancePkg was removed in commit 922c1e94e4bb > completely. (And for that reason I now closed TianoCore#679 as > WONTFIX.) > > 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. > > One document where I found information is the Intel whitepaper > > A Tour Beyond BIOS > Implementing Profiling in with EDK II > > (just google it). "Part III – Performance Profile" is relevant. > > 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. > > 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. > > In fact, the relevant library INF files have good documentation, we > just have to know what to look at. > > Recording stats in the PEI phase, via HOBs: > - MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf > > Recording stats in the DXE phase (protocol provider and consumer): > - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf > - MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf > > Recording stats in SMM (protocol provider and consumer): > - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf > - MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf > > Fetching the collected stats (for display or otherwise): > - MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf > > "Do nothing" library instance for all module types: > - MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf > > > 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. > > 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. > > Hopefully this helps a little. > Laszlo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel > > > _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PerformancePkg on multiple platform - 2018-08-04 10:11 ` Bi, Dandan @ 2018-08-04 10:29 ` prabin ca 2018-08-06 14:51 ` prabin ca 1 sibling, 0 replies; 8+ messages in thread From: prabin ca @ 2018-08-04 10:29 UTC (permalink / raw) To: Bi, Dandan; +Cc: Andrew Fish, edk2-devel, Laszlo Ersek 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 <dandan.bi@intel.com> wrote: > > Hi Prabin, > > Here is a simple introduction of current performance infrastructure in latest Edk2 code base. > Hope it can have some help when you enable it. > https://github.com/dandanbi/edk2/wiki/Performance-Infrastructure > > > Thanks, > Dandan > > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of prabin ca > Sent: Saturday, August 04, 2018 1:20 PM > To: Andrew Fish <afish@apple.com> > Cc: edk2-devel <edk2-devel@lists.01.org>; Laszlo Ersek <lersek@redhat.com> > Subject: Re: [edk2] PerformancePkg on multiple platform - > > Hi Andrew, > > I have already enabled that PCD in my DSC file, because of that its working in some platform. > > What I'm doing is building my DP.efi and DXE driver from that dsc file and testing it from UEFI shell. > > thanks for your help as well. > >> On Sat, Aug 4, 2018 at 12:08 AM, Andrew Fish <afish@apple.com> wrote: >> >> Prabin, >> >> There is a PCD setting to configure performance collection. >> >> PCDs are defined in the .DEC file and it looks like the default is >> zero and that means disabled. >> MdePkg/MdePkg.dec >> ... >> ## The mask is used to control PerformanceLib behavior.<BR><BR> >> # BIT0 - Enable Performance Measurement.<BR> >> # @Prompt Performance Measurement Property. >> # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid. >> PcdPerformanceLibraryPropertyMask & 0xFE) == 0 >> gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyM >> ask|0|UINT8|0x00000009 >> >> If you search the code you will see some platforms enabling >> performance measurement in their DSC files. >> >> /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=build.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. >> >> Thanks, >> >> Andrew Fish >> >> On Aug 3, 2018, at 11:17 AM, Laszlo Ersek <lersek@redhat.com> wrote: >> >> Hi Prabin, >> >> On 08/03/18 09:29, prabin ca wrote: >> >> Hi Team, >> >> I’m new to uefi and edk. Currently I’m trying to get performance of my >> dxe driver using PerformancePkg of EDK source code. >> >> I’m using perf_start and perf_end T respected check points, it’s hot >> build and tested well in 2/3 platform. It’s giving proper response. >> >> But when I’m Checking with multiple platform, in some of platforms >> it’s not working and got hang in uefi she’ll itself. >> >> Please help me to resolve asap, it will be really helpful. >> >> >> 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. >> >> Earlier I thought that an interested platform should include modules >> from PerformancePkg. I got some good results that way; however: >> >> - it wouldn't work for AARCH64, and so I filed >> <https://bugzilla.tianocore.org/show_bug.cgi?id=679> >> >> - ultimately PerformancePkg was removed in commit 922c1e94e4bb >> completely. (And for that reason I now closed TianoCore#679 as >> WONTFIX.) >> >> 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. >> >> One document where I found information is the Intel whitepaper >> >> A Tour Beyond BIOS >> Implementing Profiling in with EDK II >> >> (just google it). "Part III – Performance Profile" is relevant. >> >> 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. >> >> 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. >> >> In fact, the relevant library INF files have good documentation, we >> just have to know what to look at. >> >> Recording stats in the PEI phase, via HOBs: >> - MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf >> >> Recording stats in the DXE phase (protocol provider and consumer): >> - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf >> - MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf >> >> Recording stats in SMM (protocol provider and consumer): >> - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf >> - MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf >> >> Fetching the collected stats (for display or otherwise): >> - MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf >> >> "Do nothing" library instance for all module types: >> - MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf >> >> >> 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. >> >> 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. >> >> Hopefully this helps a little. >> Laszlo >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel >> >> >> > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PerformancePkg on multiple platform - 2018-08-04 10:11 ` Bi, Dandan 2018-08-04 10:29 ` prabin ca @ 2018-08-06 14:51 ` prabin ca 1 sibling, 0 replies; 8+ messages in thread From: prabin ca @ 2018-08-06 14:51 UTC (permalink / raw) To: Bi, Dandan; +Cc: Andrew Fish, edk2-devel, Laszlo Ersek Hi Team It’s got resolved now, thanks for kind support. The link and documents mentioned help to resolve and understand the architecture as well Thanks for such kind support by Laszlo, Andrew and Dandan > On 04-Aug-2018, at 3:41 PM, Bi, Dandan <dandan.bi@intel.com> wrote: > > Hi Prabin, > > Here is a simple introduction of current performance infrastructure in latest Edk2 code base. > Hope it can have some help when you enable it. > https://github.com/dandanbi/edk2/wiki/Performance-Infrastructure > > > Thanks, > Dandan > > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of prabin ca > Sent: Saturday, August 04, 2018 1:20 PM > To: Andrew Fish <afish@apple.com> > Cc: edk2-devel <edk2-devel@lists.01.org>; Laszlo Ersek <lersek@redhat.com> > Subject: Re: [edk2] PerformancePkg on multiple platform - > > Hi Andrew, > > I have already enabled that PCD in my DSC file, because of that its working in some platform. > > What I'm doing is building my DP.efi and DXE driver from that dsc file and testing it from UEFI shell. > > thanks for your help as well. > >> On Sat, Aug 4, 2018 at 12:08 AM, Andrew Fish <afish@apple.com> wrote: >> >> Prabin, >> >> There is a PCD setting to configure performance collection. >> >> PCDs are defined in the .DEC file and it looks like the default is >> zero and that means disabled. >> MdePkg/MdePkg.dec >> ... >> ## The mask is used to control PerformanceLib behavior.<BR><BR> >> # BIT0 - Enable Performance Measurement.<BR> >> # @Prompt Performance Measurement Property. >> # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid. >> PcdPerformanceLibraryPropertyMask & 0xFE) == 0 >> gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyM >> ask|0|UINT8|0x00000009 >> >> If you search the code you will see some platforms enabling >> performance measurement in their DSC files. >> >> /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=build.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. >> >> Thanks, >> >> Andrew Fish >> >> On Aug 3, 2018, at 11:17 AM, Laszlo Ersek <lersek@redhat.com> wrote: >> >> Hi Prabin, >> >> On 08/03/18 09:29, prabin ca wrote: >> >> Hi Team, >> >> I’m new to uefi and edk. Currently I’m trying to get performance of my >> dxe driver using PerformancePkg of EDK source code. >> >> I’m using perf_start and perf_end T respected check points, it’s hot >> build and tested well in 2/3 platform. It’s giving proper response. >> >> But when I’m Checking with multiple platform, in some of platforms >> it’s not working and got hang in uefi she’ll itself. >> >> Please help me to resolve asap, it will be really helpful. >> >> >> 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. >> >> Earlier I thought that an interested platform should include modules >> from PerformancePkg. I got some good results that way; however: >> >> - it wouldn't work for AARCH64, and so I filed >> <https://bugzilla.tianocore.org/show_bug.cgi?id=679> >> >> - ultimately PerformancePkg was removed in commit 922c1e94e4bb >> completely. (And for that reason I now closed TianoCore#679 as >> WONTFIX.) >> >> 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. >> >> One document where I found information is the Intel whitepaper >> >> A Tour Beyond BIOS >> Implementing Profiling in with EDK II >> >> (just google it). "Part III – Performance Profile" is relevant. >> >> 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. >> >> 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. >> >> In fact, the relevant library INF files have good documentation, we >> just have to know what to look at. >> >> Recording stats in the PEI phase, via HOBs: >> - MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf >> >> Recording stats in the DXE phase (protocol provider and consumer): >> - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf >> - MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf >> >> Recording stats in SMM (protocol provider and consumer): >> - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf >> - MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf >> >> Fetching the collected stats (for display or otherwise): >> - MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf >> >> "Do nothing" library instance for all module types: >> - MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf >> >> >> 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. >> >> 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. >> >> Hopefully this helps a little. >> Laszlo >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel >> >> >> > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PerformancePkg on multiple platform 2018-08-03 18:17 ` Laszlo Ersek 2018-08-03 18:38 ` PerformancePkg on multiple platform - Andrew Fish @ 2018-08-04 5:17 ` prabin ca 1 sibling, 0 replies; 8+ messages in thread From: prabin ca @ 2018-08-04 5:17 UTC (permalink / raw) To: Laszlo Ersek; +Cc: edk2-devel Hi Laszlo, Thank you for your valid input, Its really help full for me. I will look in the " A Tour Beyond BIOS Implementing Profiling in with EDK II" with your points. have a nice day. On Fri, Aug 3, 2018 at 11:47 PM, Laszlo Ersek <lersek@redhat.com> wrote: > Hi Prabin, > > On 08/03/18 09:29, prabin ca wrote: > > Hi Team, > > > > I’m new to uefi and edk. Currently I’m trying to get performance of my > dxe driver using PerformancePkg of EDK source code. > > > > I’m using perf_start and perf_end T respected check points, it’s hot > build and tested well in 2/3 platform. It’s giving proper response. > > > > But when I’m Checking with multiple platform, in some of platforms it’s > not working and got hang in uefi she’ll itself. > > > > Please help me to resolve asap, it will be really helpful. > > 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. > > Earlier I thought that an interested platform should include modules > from PerformancePkg. I got some good results that way; however: > > - it wouldn't work for AARCH64, and so I filed > <https://bugzilla.tianocore.org/show_bug.cgi?id=679> > > - ultimately PerformancePkg was removed in commit 922c1e94e4bb > completely. (And for that reason I now closed TianoCore#679 as > WONTFIX.) > > 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. > > One document where I found information is the Intel whitepaper > > A Tour Beyond BIOS > Implementing Profiling in with EDK II > > (just google it). "Part III – Performance Profile" is relevant. > > 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. > > 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. > > In fact, the relevant library INF files have good documentation, we just > have to know what to look at. > > Recording stats in the PEI phase, via HOBs: > - MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf > > Recording stats in the DXE phase (protocol provider and consumer): > - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf > - MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf > > Recording stats in SMM (protocol provider and consumer): > - MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf > - MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf > > Fetching the collected stats (for display or otherwise): > - MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf > > "Do nothing" library instance for all module types: > - MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf > > > 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. > > 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. > > Hopefully this helps a little. > Laszlo > ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-08-06 14:51 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-08-03 7:29 PerformancePkg on multiple platform prabin ca 2018-08-03 18:17 ` Laszlo Ersek 2018-08-03 18:38 ` PerformancePkg on multiple platform - Andrew Fish 2018-08-04 5:19 ` prabin ca 2018-08-04 10:11 ` Bi, Dandan 2018-08-04 10:29 ` prabin ca 2018-08-06 14:51 ` prabin ca 2018-08-04 5:17 ` PerformancePkg on multiple platform prabin ca
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox