]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/S3Resume: Remove useless perf code
authorDandan Bi <dandan.bi@intel.com>
Wed, 24 Jan 2018 05:19:59 +0000 (13:19 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 12 Feb 2018 03:36:13 +0000 (11:36 +0800)
V2: Just update the commit message to reference the hash value of
new performance infrastructure.

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4)can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf

index d7d2a4d1e6726c59b60c196ddc7e26a7107fd085..4d776891a72da22a4293eda5c40ac1486f254fa8 100644 (file)
@@ -22,7 +22,6 @@
 \r
 #include <Guid/AcpiS3Context.h>\r
 #include <Guid/BootScriptExecutorVariable.h>\r
-#include <Guid/Performance.h>\r
 #include <Guid/ExtendedFirmwarePerformance.h>\r
 #include <Guid/EndOfS3Resume.h>\r
 #include <Ppi/ReadOnlyVariable2.h>\r
@@ -286,132 +285,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST IA32_DESCRIPTOR mGdt = {
   (UINTN) mGdtEntries\r
   };\r
 \r
-/**\r
-  Performance measure function to get S3 detailed performance data.\r
-\r
-  This function will getS3 detailed performance data and saved in pre-reserved ACPI memory.\r
-**/\r
-VOID\r
-WriteToOsS3PerformanceData (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS                                    Status;\r
-  EFI_PHYSICAL_ADDRESS                          mAcpiLowMemoryBase;\r
-  PERF_HEADER                                   *PerfHeader;\r
-  PERF_DATA                                     *PerfData;\r
-  UINT64                                        Ticker;\r
-  UINTN                                         Index;\r
-  EFI_PEI_READ_ONLY_VARIABLE2_PPI               *VariableServices;\r
-  UINTN                                         VarSize;\r
-  UINTN                                         LogEntryKey;\r
-  CONST VOID                                    *Handle;\r
-  CONST CHAR8                                   *Token;\r
-  CONST CHAR8                                   *Module;\r
-  UINT64                                        StartTicker;\r
-  UINT64                                        EndTicker;\r
-  UINT64                                        StartValue;\r
-  UINT64                                        EndValue;\r
-  BOOLEAN                                       CountUp;\r
-  UINT64                                        Freq;\r
-\r
-  //\r
-  // Retrieve time stamp count as early as possible\r
-  //\r
-  Ticker = GetPerformanceCounter ();\r
-\r
-  Freq   = GetPerformanceCounterProperties (&StartValue, &EndValue);\r
-\r
-  Freq   = DivU64x32 (Freq, 1000);\r
-\r
-  Status = PeiServicesLocatePpi (\r
-             &gEfiPeiReadOnlyVariable2PpiGuid,\r
-             0,\r
-             NULL,\r
-             (VOID **) &VariableServices\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return;\r
-  }\r
-\r
-  VarSize   = sizeof (EFI_PHYSICAL_ADDRESS);\r
-  Status = VariableServices->GetVariable (\r
-                               VariableServices,\r
-                               L"PerfDataMemAddr",\r
-                               &gPerformanceProtocolGuid,\r
-                               NULL,\r
-                               &VarSize,\r
-                               &mAcpiLowMemoryBase\r
-                               );\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((EFI_D_ERROR, "Fail to retrieve variable to log S3 performance data \n"));\r
-    return;\r
-  }\r
-\r
-  PerfHeader = (PERF_HEADER *) (UINTN) mAcpiLowMemoryBase;\r
-\r
-  if (PerfHeader->Signiture != PERFORMANCE_SIGNATURE) {\r
-    DEBUG ((EFI_D_ERROR, "Performance data in ACPI memory get corrupted! \n"));\r
-    return;\r
-  }\r
-\r
-  //\r
-  // Record total S3 resume time.\r
-  //\r
-  if (EndValue >= StartValue) {\r
-    PerfHeader->S3Resume = Ticker - StartValue;\r
-    CountUp              = TRUE;\r
-  } else {\r
-    PerfHeader->S3Resume = StartValue - Ticker;\r
-    CountUp              = FALSE;\r
-  }\r
-\r
-  //\r
-  // Get S3 detailed performance data\r
-  //\r
-  Index = 0;\r
-  LogEntryKey = 0;\r
-  while ((LogEntryKey = GetPerformanceMeasurement (\r
-                          LogEntryKey,\r
-                          &Handle,\r
-                          &Token,\r
-                          &Module,\r
-                          &StartTicker,\r
-                          &EndTicker)) != 0) {\r
-    if (EndTicker != 0) {\r
-      PerfData = &PerfHeader->S3Entry[Index];\r
-\r
-      //\r
-      // Use File Handle to specify the different performance log for PEIM.\r
-      // File Handle is the base address of PEIM FFS file.\r
-      //\r
-      if ((AsciiStrnCmp (Token, "PEIM", PEI_PERFORMANCE_STRING_SIZE) == 0) && (Handle != NULL)) {\r
-        AsciiSPrint (PerfData->Token, PERF_TOKEN_LENGTH, "0x%11p", Handle);\r
-      } else {\r
-        AsciiStrnCpyS (PerfData->Token, PERF_TOKEN_SIZE, Token, PERF_TOKEN_LENGTH);\r
-      }\r
-      if (StartTicker == 1) {\r
-        StartTicker = StartValue;\r
-      }\r
-      if (EndTicker == 1) {\r
-        EndTicker = StartValue;\r
-      }\r
-      Ticker = CountUp? (EndTicker - StartTicker) : (StartTicker - EndTicker);\r
-      PerfData->Duration = (UINT32) DivU64x32 (Ticker, (UINT32) Freq);\r
-\r
-      //\r
-      // Only Record > 1ms performance data so that more big performance can be recorded.\r
-      //\r
-      if ((Ticker > Freq) && (++Index >= PERF_PEI_ENTRY_MAX_NUM)) {\r
-        //\r
-        // Reach the maximum number of PEI performance log entries.\r
-        //\r
-        break;\r
-      }\r
-    }\r
-  }\r
-  PerfHeader->S3EntryNum = (UINT32) Index;\r
-}\r
 \r
 /**\r
   The function will check if current waking vector is long mode.\r
@@ -604,10 +477,6 @@ S3ResumeBootOs (
   //\r
   REPORT_STATUS_CODE (EFI_PROGRESS_CODE, EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_OS_WAKE);\r
 \r
-  PERF_CODE (\r
-    WriteToOsS3PerformanceData ();\r
-    );\r
-\r
   AsmTransferControl = (ASM_TRANSFER_CONTROL)(UINTN)PeiS3ResumeState->AsmTransferControl;\r
   if (Facs->XFirmwareWakingVector != 0) {\r
     //\r
index 15fa2d15431cff21e1b7acb6d9e2f754df596e09..9522ede726f4e387386c3e9b8a72dbfa313f768b 100644 (file)
@@ -5,7 +5,7 @@
 # This module will excute the boot script saved during last boot and after that,\r
 # control is passed to OS waking up handler.\r
 #\r
-# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are\r
@@ -73,7 +73,6 @@
 [Guids]\r
   gEfiBootScriptExecutorVariableGuid            ## SOMETIMES_CONSUMES ## UNDEFINED # LockBox\r
   gEfiBootScriptExecutorContextGuid             ## SOMETIMES_CONSUMES ## UNDEFINED # LockBox\r
-  gPerformanceProtocolGuid                      ## SOMETIMES_CONSUMES ## Variable:L"PerfDataMemAddr"\r
   ## SOMETIMES_CONSUMES ## HOB\r
   ## SOMETIMES_CONSUMES ## UNDEFINED # LockBox\r
   gEfiAcpiVariableGuid\r