]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Update FirmwarePerformanceDataTableDxe for LegacyBoot
authorLiming Gao <liming.gao@intel.com>
Fri, 8 May 2015 07:44:59 +0000 (07:44 +0000)
committerlgao4 <lgao4@Edk2>
Fri, 8 May 2015 07:44:59 +0000 (07:44 +0000)
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

MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c

index dbe7ef75c325729193d614b720a5a6cb0771a184..423e8f227023006df487030aae9f51fbea8d055c 100644 (file)
@@ -5,7 +5,7 @@
   for Firmware Basic Boot Performance Record and other boot performance records, \r
   and install FPDT to ACPI table.\r
 \r
-  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -555,46 +555,6 @@ FpdtReadyToBootEventNotify (
   }\r
 }\r
 \r
-/**\r
-  Notify function for event group EFI_EVENT_LEGACY_BOOT_GUID. This is used to\r
-  record performance data for OsLoaderLoadImageStart in FPDT for legacy boot.\r
-\r
-  @param[in]  Event   The Event that is being processed.\r
-  @param[in]  Context The Event Context.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-FpdtLegacyBootEventNotify (\r
-  IN EFI_EVENT        Event,\r
-  IN VOID             *Context\r
-  )\r
-{\r
-  if (mAcpiBootPerformanceTable == NULL) {\r
-    //\r
-    // Firmware Performance Data Table not installed, do nothing.\r
-    //\r
-    return ;\r
-  }\r
-\r
-  //\r
-  // Update Firmware Basic Boot Performance Record for legacy boot.\r
-  //\r
-  mAcpiBootPerformanceTable->BasicBoot.OsLoaderLoadImageStart  = 0;\r
-  mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart = GetTimeInNanoSecond (GetPerformanceCounter ());\r
-  mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesEntry   = 0;\r
-  mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesExit    = 0;\r
-\r
-  //\r
-  // Dump FPDT Boot Performance record.\r
-  //\r
-  DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ResetEnd                = %ld\n", mAcpiBootPerformanceTable->BasicBoot.ResetEnd));\r
-  DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderLoadImageStart  = 0\n"));\r
-  DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderStartImageStart = %ld\n", mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart));\r
-  DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesEntry   = 0\n"));\r
-  DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesExit    = 0\n"));\r
-}\r
-\r
 /**\r
   Report status code listener of FPDT. This is used to collect performance data\r
   for OsLoaderLoadImageStart and OsLoaderStartImageStart in FPDT.\r
@@ -682,6 +642,27 @@ FpdtStatusCodeListenerDxe (
     // Update ExitBootServicesExit for UEFI boot.\r
     //\r
     mAcpiBootPerformanceTable->BasicBoot.ExitBootServicesExit = GetTimeInNanoSecond (GetPerformanceCounter ());\r
+  } else if (Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT)) {\r
+    if (mAcpiBootPerformanceTable == NULL) {\r
+      //\r
+      // Firmware Performance Data Table not installed, do nothing.\r
+      //\r
+      return Status;\r
+    }\r
+\r
+    //\r
+    // Update Firmware Basic Boot Performance Record for legacy boot.\r
+    //\r
+    mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart = GetTimeInNanoSecond (GetPerformanceCounter ());\r
+\r
+    //\r
+    // Dump FPDT Boot Performance record.\r
+    //\r
+    DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ResetEnd                = %ld\n", mAcpiBootPerformanceTable->BasicBoot.ResetEnd));\r
+    DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderLoadImageStart  = 0\n"));\r
+    DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - OsLoaderStartImageStart = %ld\n", mAcpiBootPerformanceTable->BasicBoot.OsLoaderStartImageStart));\r
+    DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesEntry   = 0\n"));\r
+    DEBUG ((EFI_D_INFO, "FPDT: Boot Performance - ExitBootServicesExit    = 0\n"));\r
   } else if (Data != NULL && CompareGuid (&Data->Type, &gEfiFirmwarePerformanceGuid)) {\r
     //\r
     // Append one or more Boot records\r
@@ -848,19 +829,6 @@ FirmwarePerformanceDxeEntryPoint (
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  //\r
-  // Create legacy boot event to log OsLoaderStartImageStart for legacy boot.\r
-  //\r
-  Status = gBS->CreateEventEx (\r
-                  EVT_NOTIFY_SIGNAL,\r
-                  TPL_NOTIFY,\r
-                  FpdtLegacyBootEventNotify,\r
-                  NULL,\r
-                  &gEfiEventLegacyBootGuid,\r
-                  &mLegacyBootEvent\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
   //\r
   // Retrieve GUID HOB data that contains the ResetEnd.\r
   //\r