From 522dfbf380563e326b1878e013afd3fddecfbd9c Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Fri, 8 May 2015 07:44:59 +0000 Subject: [PATCH] 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 Reviewed-by: Ruyu Ni git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17377 6f19259b-4bc3-4df7-8a09-765794883524 --- .../FirmwarePerformanceDxe.c | 76 ++++++------------- 1 file 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.
+ Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
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 @@ -555,46 +555,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 @@ -848,19 +829,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. // -- 2.39.2