MdeModulePkg/DxeCorePerformanceLib:Track FPDT record in DXE phase

V4:
a.Update the GUID for status code in DxeCorePerformanceLib and
FirmwarePerformanceDxe.
b. Add check for Insert FPDT record in DxeCorePerformanceLib
to avoid re-entry case.

V3:
a. Handle the case when string is empty in String Record.
b. refine the code logic.

V2:
Update DxecorePerformanceLib to report the boot performance table
address instead of records contents.

Updated to convert Pref entry to FPDT record in DXE phase and then
allocate boot performance table to save the record and report
the address of boot performance table to FirmwarePerformanceDxe.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Dandan Bi 2018-01-19 13:01:38 +08:00 committed by Liming Gao
parent 9169f67690
commit 9609d24b19
3 changed files with 1099 additions and 331 deletions

View File

@ -9,7 +9,7 @@
# This library is mainly used by DxeCore to start performance logging to ensure that # This library is mainly used by DxeCore to start performance logging to ensure that
# Performance and PerformanceEx Protocol are installed at the very beginning of DXE phase. # Performance and PerformanceEx Protocol are installed at the very beginning of DXE phase.
# #
# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> # (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -50,6 +50,7 @@
[LibraryClasses] [LibraryClasses]
MemoryAllocationLib MemoryAllocationLib
UefiBootServicesTableLib UefiBootServicesTableLib
UefiRuntimeServicesTableLib
PcdLib PcdLib
TimerLib TimerLib
BaseMemoryLib BaseMemoryLib
@ -57,6 +58,12 @@
HobLib HobLib
DebugLib DebugLib
UefiLib UefiLib
ReportStatusCodeLib
DxeServicesLib
PeCoffGetEntryPointLib
[Protocols]
gEfiSmmCommunicationProtocolGuid ## SOMETIMES_CONSUMES
[Guids] [Guids]
@ -67,8 +74,13 @@
## SOMETIMES_CONSUMES ## HOB ## SOMETIMES_CONSUMES ## HOB
## PRODUCES ## UNDEFINED # Install protocol ## PRODUCES ## UNDEFINED # Install protocol
gPerformanceExProtocolGuid gPerformanceExProtocolGuid
gZeroGuid ## SOMETIMES_CONSUMES ## GUID
gEfiFirmwarePerformanceGuid ## SOMETIMES_PRODUCES ## UNDEFINED # StatusCode Data
gEdkiiFpdtExtendedFirmwarePerformanceGuid ## SOMETIMES_CONSUMES ## HOB # StatusCode Data
gEfiEventReadyToBootGuid ## CONSUMES ## Event
gEdkiiPiSmmCommunicationRegionTableGuid ## SOMETIMES_CONSUMES ## SystemTable
[Pcd] [Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries ## CONSUMES gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries16 ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdEdkiiFpdtStringRecordEnableOnly ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize ## CONSUMES

View File

@ -4,7 +4,7 @@
This header file holds the prototypes of the Performance and PerformanceEx Protocol published by this This header file holds the prototypes of the Performance and PerformanceEx Protocol published by this
library instance at its constructor. library instance at its constructor.
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -22,6 +22,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <PiDxe.h> #include <PiDxe.h>
#include <Guid/Performance.h> #include <Guid/Performance.h>
#include <Guid/ExtendedFirmwarePerformance.h>
#include <Guid/ZeroGuid.h>
#include <Guid/EventGroup.h>
#include <Guid/FirmwarePerformance.h>
#include <Guid/PiSmmCommunicationRegionTable.h>
#include <Protocol/DriverBinding.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/ComponentName2.h>
#include <Protocol/DevicePathToText.h>
#include <Protocol/SmmCommunication.h>
#include <Library/PerformanceLib.h> #include <Library/PerformanceLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
@ -31,8 +42,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/TimerLib.h> #include <Library/TimerLib.h>
#include <Library/PcdLib.h> #include <Library/PcdLib.h>
#include <Library/UefiBootServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/MemoryAllocationLib.h> #include <Library/MemoryAllocationLib.h>
#include <Library/UefiLib.h> #include <Library/UefiLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <Library/DxeServicesLib.h>
#include <Library/PeCoffGetEntryPointLib.h>
// //
// Interface declarations for PerformanceEx Protocol. // Interface declarations for PerformanceEx Protocol.