diff options
author | Liming Gao <liming.gao@intel.com> | 2015-05-08 07:44:59 +0000 |
---|---|---|
committer | lgao4 <lgao4@Edk2> | 2015-05-08 07:44:59 +0000 |
commit | 522dfbf380563e326b1878e013afd3fddecfbd9c (patch) | |
tree | 4ad9a39ff4259443133f46082dfb37536a842485 /MdeModulePkg | |
parent | 3f05834bae1dd30ffda5812564566c385fff86e7 (diff) | |
download | edk2-platforms-522dfbf380563e326b1878e013afd3fddecfbd9c.tar.xz |
MdeModulePkg: Update FirmwarePerformanceDataTableDxe for LegacyBoot
Change the code to listen EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT instead of the Legacy Boot event to provide more precise performance data.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17377 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c | 76 |
1 files changed, 22 insertions, 54 deletions
diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c index dbe7ef75c3..423e8f2270 100644 --- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c +++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c @@ -5,7 +5,7 @@ for Firmware Basic Boot Performance Record and other boot performance records,
and install FPDT to ACPI table.
- Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
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
@@ -556,46 +556,6 @@ FpdtReadyToBootEventNotify ( }
/**
- Notify function for event group EFI_EVENT_LEGACY_BOOT_GUID. This is used to
- record performance data for OsLoaderLoadImageStart in FPDT for legacy boot.
-
- @param[in] Event The Event that is being processed.
- @param[in] Context The Event Context.
-
-**/
-VOID
-EFIAPI
-FpdtLegacyBootEventNotify (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- if (mAcpiBootPerformanceTable == NULL) {
- //
- // Firmware Performance Data Table not installed, do nothing.
- //
- return ;
- }
-
- //
- // Update Firmware Basic Boot Performance Record for legacy boot.
- //
- mAcpiBootPerformanceTable->BasicBoot.OsLoaderLoadImageStart = 0;
- mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart = GetTimeInNanoSecond (GetPerformanceCounter ());
- mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesEntry = 0;
- mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesExit = 0;
-
- //
- // Dump FPDT Boot Performance record.
- //
- DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ResetEnd = %ld\n", mAcpiBootPerformanceTable->BasicBoot.ResetEnd));
- DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderLoadImageStart = 0\n"));
- DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderStartImageStart = %ld\n", mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart));
- DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesEntry = 0\n"));
- DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesExit = 0\n"));
-}
-
-/**
Report status code listener of FPDT. This is used to collect performance data
for OsLoaderLoadImageStart and OsLoaderStartImageStart in FPDT.
@@ -682,6 +642,27 @@ FpdtStatusCodeListenerDxe ( // Update ExitBootServicesExit for UEFI boot.
//
mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesExit = GetTimeInNanoSecond (GetPerformanceCounter ());
+ } else if (Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT)) {
+ if (mAcpiBootPerformanceTable == NULL) {
+ //
+ // Firmware Performance Data Table not installed, do nothing.
+ //
+ return Status;
+ }
+
+ //
+ // Update Firmware Basic Boot Performance Record for legacy boot.
+ //
+ mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart = GetTimeInNanoSecond (GetPerformanceCounter ());
+
+ //
+ // Dump FPDT Boot Performance record.
+ //
+ DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ResetEnd = %ld\n", mAcpiBootPerformanceTable->BasicBoot.ResetEnd));
+ DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderLoadImageStart = 0\n"));
+ DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderStartImageStart = %ld\n", mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart));
+ DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesEntry = 0\n"));
+ DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesExit = 0\n"));
} else if (Data != NULL && CompareGuid (&Data->Type, &gEfiFirmwarePerformanceGuid)) {
//
// Append one or more Boot records
@@ -849,19 +830,6 @@ FirmwarePerformanceDxeEntryPoint ( ASSERT_EFI_ERROR (Status);
//
- // Create legacy boot event to log OsLoaderStartImageStart for legacy boot.
- //
- Status = gBS->CreateEventEx (
- EVT_NOTIFY_SIGNAL,
- TPL_NOTIFY,
- FpdtLegacyBootEventNotify,
- NULL,
- &gEfiEventLegacyBootGuid,
- &mLegacyBootEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- //
// Retrieve GUID HOB data that contains the ResetEnd.
//
GuidHob = GetFirstGuidHob (&gEfiFirmwarePerformanceGuid);
|