]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c
MdeModulePkg: Refine code to use Strn**S safe functions instead of Str**S ones in...
[mirror_edk2.git] / MdeModulePkg / Library / PeiPerformanceLib / PeiPerformanceLib.c
index 64b488369a43100e31f7f3a44fd0d6bc7856afa2..0b5a717caa01890f8e64aea12675f24894fefa21 100644 (file)
@@ -1,8 +1,13 @@
 /** @file\r
-  Performance Library\r
+  Performance library instance used in PEI phase.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+  This file implements all APIs in Performance Library class in MdePkg. It creates\r
+  performance logging GUIDed HOB on the first performance logging and then logs the\r
+  performance data to the GUIDed HOB. Due to the limitation of temporary RAM, the maximum\r
+  number of performance logging entry is specified by PcdMaxPeiPerformanceLogEntries.  \r
+\r
+Copyright (c) 2006 - 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
 http://opensource.org/licenses/bsd-license.php\r
@@ -15,7 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <PiPei.h>\r
 \r
-#include <Guid/PeiPerformanceHob.h>\r
+#include <Guid/Performance.h>\r
 \r
 #include <Library/PerformanceLib.h>\r
 #include <Library/DebugLib.h>\r
@@ -27,65 +32,72 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 \r
 /**\r
-  Gets PEI the GUID HOB for PEI performance.\r
+  Gets the GUID HOB for PEI performance.\r
 \r
   This internal function searches for the GUID HOB for PEI performance.\r
   If that GUID HOB is not found, it will build a new one.\r
-  It returns the data area of that GUID HOB to record performance log.\r
+  It outputs the data area of that GUID HOB to record performance log.\r
 \r
-  @param  Handle                  Pointer to environment specific context used\r
-                                  to identify the component being measured.\r
-  @param  Token                   Pointer to a Null-terminated ASCII string\r
-                                  that identifies the component being measured.\r
-  @param  Module                  Pointer to a Null-terminated ASCII string\r
-                                  that identifies the module being measured.\r
-\r
-  @retval The index of log entry in the array.\r
+  @param    PeiPerformanceLog           Pointer to Pointer to PEI performance log header.\r
+  @param    PeiPerformanceIdArray       Pointer to Pointer to PEI performance identifier array.\r
 \r
 **/\r
-PEI_PERFORMANCE_LOG_HEADER *\r
+VOID\r
 InternalGetPerformanceHobLog (\r
-  VOID\r
+  OUT PEI_PERFORMANCE_LOG_HEADER    **PeiPerformanceLog,\r
+  OUT UINT32                        **PeiPerformanceIdArray\r
   )\r
 {\r
   EFI_HOB_GUID_TYPE           *GuidHob;\r
-  PEI_PERFORMANCE_LOG_HEADER  *PeiPerformanceLog;\r
-  UINTN                       PeiPerformanceLogSize;\r
+  UINTN                       PeiPerformanceSize;\r
+\r
+  ASSERT (PeiPerformanceLog != NULL);\r
+  ASSERT (PeiPerformanceIdArray != NULL);\r
 \r
-  GuidHob = GetFirstGuidHob (&gPeiPerformanceHobGuid);\r
+  GuidHob = GetFirstGuidHob (&gPerformanceProtocolGuid);\r
 \r
   if (GuidHob != NULL) {\r
     //\r
     // PEI Performance HOB was found, then return the existing one.\r
     //\r
-    PeiPerformanceLog = GET_GUID_HOB_DATA (GuidHob);\r
+    *PeiPerformanceLog = GET_GUID_HOB_DATA (GuidHob);\r
+\r
+    GuidHob = GetFirstGuidHob (&gPerformanceExProtocolGuid);\r
+    ASSERT (GuidHob != NULL);\r
+    *PeiPerformanceIdArray = GET_GUID_HOB_DATA (GuidHob);\r
   } else {\r
     //\r
     // PEI Performance HOB was not found, then build one.\r
     //\r
-    PeiPerformanceLogSize = sizeof (PEI_PERFORMANCE_LOG_HEADER) +\r
-                            sizeof (PEI_PERFORMANCE_LOG_ENTRY) * PcdGet8 (PcdMaxPeiPerformanceLogEntries);\r
-    PeiPerformanceLog     = BuildGuidHob (&gPeiPerformanceHobGuid, PeiPerformanceLogSize);\r
-    PeiPerformanceLog     = ZeroMem (PeiPerformanceLog, PeiPerformanceLogSize);\r
+    PeiPerformanceSize     = sizeof (PEI_PERFORMANCE_LOG_HEADER) +\r
+                             sizeof (PEI_PERFORMANCE_LOG_ENTRY) * PcdGet8 (PcdMaxPeiPerformanceLogEntries);\r
+    *PeiPerformanceLog     = BuildGuidHob (&gPerformanceProtocolGuid, PeiPerformanceSize);\r
+    *PeiPerformanceLog     = ZeroMem (*PeiPerformanceLog, PeiPerformanceSize);\r
+\r
+    PeiPerformanceSize     = sizeof (UINT32) * PcdGet8 (PcdMaxPeiPerformanceLogEntries);\r
+    *PeiPerformanceIdArray = BuildGuidHob (&gPerformanceExProtocolGuid, PeiPerformanceSize);\r
+    *PeiPerformanceIdArray = ZeroMem (*PeiPerformanceIdArray, PeiPerformanceSize);\r
   }\r
-\r
-  return PeiPerformanceLog;\r
 }\r
 \r
 /**\r
-  Searches in the log array with keyword Handle, Token and Module.\r
+  Searches in the log array with keyword Handle, Token, Module and Identifier.\r
 \r
   This internal function searches for the log entry in the log array.\r
-  If there is an entry that exactly matches the given key word triple\r
+  If there is an entry that exactly matches the given keywords\r
   and its end time stamp is zero, then the index of that log entry is returned;\r
   otherwise, the the number of log entries in the array is returned.\r
 \r
+  @param  PeiPerformanceLog       Pointer to the data structure containing PEI \r
+                                  performance data.\r
+  @param  PeiPerformanceIdArray   Pointer to PEI performance identifier array.\r
   @param  Handle                  Pointer to environment specific context used\r
                                   to identify the component being measured.\r
   @param  Token                   Pointer to a Null-terminated ASCII string\r
                                   that identifies the component being measured.\r
   @param  Module                  Pointer to a Null-terminated ASCII string\r
                                   that identifies the module being measured.\r
+  @param  Identifier              32-bit identifier.\r
 \r
   @retval The index of log entry in the array.\r
 \r
@@ -93,12 +105,15 @@ InternalGetPerformanceHobLog (
 UINT32\r
 InternalSearchForLogEntry (\r
   IN PEI_PERFORMANCE_LOG_HEADER *PeiPerformanceLog,\r
+  IN UINT32                     *PeiPerformanceIdArray,\r
   IN CONST VOID                 *Handle,  OPTIONAL\r
   IN CONST CHAR8                *Token,   OPTIONAL\r
-  IN CONST CHAR8                *Module   OPTIONAL\r
+  IN CONST CHAR8                *Module,   OPTIONAL\r
+  IN UINT32                     Identifier\r
   )\r
 {\r
   UINT32                    Index;\r
+  UINT32                    Index2;\r
   UINT32                    NumberOfEntries;\r
   PEI_PERFORMANCE_LOG_ENTRY *LogEntryArray;\r
 \r
@@ -112,12 +127,16 @@ InternalSearchForLogEntry (
   NumberOfEntries = PeiPerformanceLog->NumberOfEntries;\r
   LogEntryArray   = (PEI_PERFORMANCE_LOG_ENTRY *) (PeiPerformanceLog + 1);\r
 \r
+  Index2 = 0;\r
+\r
   for (Index = 0; Index < NumberOfEntries; Index++) {\r
-    if ((LogEntryArray[Index].Handle == (EFI_PHYSICAL_ADDRESS) (UINTN) Handle) &&\r
-         AsciiStrnCmp (LogEntryArray[Index].Token, Token, PEI_PERFORMANCE_STRING_LENGTH) == 0 &&\r
-         AsciiStrnCmp (LogEntryArray[Index].Module, Module, PEI_PERFORMANCE_STRING_LENGTH) == 0 &&\r
-         LogEntryArray[Index].EndTimeStamp == 0\r
-       ) {\r
+    Index2 = NumberOfEntries - 1 - Index;\r
+    if (LogEntryArray[Index2].EndTimeStamp == 0 &&\r
+        (LogEntryArray[Index2].Handle == (EFI_PHYSICAL_ADDRESS) (UINTN) Handle) &&\r
+        AsciiStrnCmp (LogEntryArray[Index2].Token, Token, PEI_PERFORMANCE_STRING_LENGTH) == 0 &&\r
+        AsciiStrnCmp (LogEntryArray[Index2].Module, Module, PEI_PERFORMANCE_STRING_LENGTH) == 0 &&\r
+        (PeiPerformanceIdArray[Index2] == Identifier)) {\r
+      Index = Index2;\r
       break;\r
     }\r
   }\r
@@ -127,7 +146,7 @@ InternalSearchForLogEntry (
 /**\r
   Creates a record for the beginning of a performance measurement.\r
 \r
-  Creates a record that contains the Handle, Token, and Module.\r
+  Creates a record that contains the Handle, Token, Module and Identifier.\r
   If TimeStamp is not zero, then TimeStamp is added to the record as the start time.\r
   If TimeStamp is zero, then this function reads the current time stamp\r
   and adds that time stamp value to the record as the start time.\r
@@ -139,6 +158,8 @@ InternalSearchForLogEntry (
   @param  Module                  Pointer to a Null-terminated ASCII string\r
                                   that identifies the module being measured.\r
   @param  TimeStamp               64-bit time stamp.\r
+  @param  Identifier              32-bit identifier. If the value is 0, the created record\r
+                                  is same as the one created by StartPerformanceMeasurement.\r
 \r
   @retval RETURN_SUCCESS          The start of the measurement was recorded.\r
   @retval RETURN_OUT_OF_RESOURCES There are not enough resources to record the measurement.\r
@@ -146,18 +167,20 @@ InternalSearchForLogEntry (
 **/\r
 RETURN_STATUS\r
 EFIAPI\r
-StartPerformanceMeasurement (\r
+StartPerformanceMeasurementEx (\r
   IN CONST VOID   *Handle,  OPTIONAL\r
   IN CONST CHAR8  *Token,   OPTIONAL\r
   IN CONST CHAR8  *Module,  OPTIONAL\r
-  IN UINT64       TimeStamp\r
+  IN UINT64       TimeStamp,\r
+  IN UINT32       Identifier\r
   )\r
 {\r
   PEI_PERFORMANCE_LOG_HEADER  *PeiPerformanceLog;\r
+  UINT32                      *PeiPerformanceIdArray;\r
   PEI_PERFORMANCE_LOG_ENTRY   *LogEntryArray;\r
   UINT32                      Index;\r
 \r
-  PeiPerformanceLog = InternalGetPerformanceHobLog ();\r
+  InternalGetPerformanceHobLog (&PeiPerformanceLog, &PeiPerformanceIdArray);\r
 \r
   if (PeiPerformanceLog->NumberOfEntries >= PcdGet8 (PcdMaxPeiPerformanceLogEntries)) {\r
     return RETURN_OUT_OF_RESOURCES;\r
@@ -167,12 +190,15 @@ StartPerformanceMeasurement (
   LogEntryArray[Index].Handle = (EFI_PHYSICAL_ADDRESS) (UINTN) Handle;\r
 \r
   if (Token != NULL) {\r
-    AsciiStrnCpy (LogEntryArray[Index].Token, Token, PEI_PERFORMANCE_STRING_LENGTH);\r
+    AsciiStrnCpyS (LogEntryArray[Index].Token, PEI_PERFORMANCE_STRING_SIZE, Token, PEI_PERFORMANCE_STRING_LENGTH);\r
   }\r
   if (Module != NULL) {\r
-    AsciiStrnCpy (LogEntryArray[Index].Module, Module, PEI_PERFORMANCE_STRING_LENGTH);\r
+    AsciiStrnCpyS (LogEntryArray[Index].Module, PEI_PERFORMANCE_STRING_SIZE, Module, PEI_PERFORMANCE_STRING_LENGTH);\r
   }\r
 \r
+  LogEntryArray[Index].EndTimeStamp = 0;\r
+  PeiPerformanceIdArray[Index] = Identifier;\r
+\r
   if (TimeStamp == 0) {\r
     TimeStamp = GetPerformanceCounter ();\r
   }\r
@@ -184,13 +210,12 @@ StartPerformanceMeasurement (
 /**\r
   Fills in the end time of a performance measurement.\r
 \r
-  Looks up the record that matches Handle, Token, and Module.\r
+  Looks up the record that matches Handle, Token, Module and Identifier.\r
   If the record can not be found then return RETURN_NOT_FOUND.\r
   If the record is found and TimeStamp is not zero,\r
   then TimeStamp is added to the record as the end time.\r
   If the record is found and TimeStamp is zero, then this function reads\r
   the current time stamp and adds that time stamp value to the record as the end time.\r
-  If this function is called multiple times for the same record, then the end time is overwritten.\r
 \r
   @param  Handle                  Pointer to environment specific context used\r
                                   to identify the component being measured.\r
@@ -199,6 +224,8 @@ StartPerformanceMeasurement (
   @param  Module                  Pointer to a Null-terminated ASCII string\r
                                   that identifies the module being measured.\r
   @param  TimeStamp               64-bit time stamp.\r
+  @param  Identifier              32-bit identifier. If the value is 0, the found record\r
+                                  is same as the one found by EndPerformanceMeasurement.\r
 \r
   @retval RETURN_SUCCESS          The end of  the measurement was recorded.\r
   @retval RETURN_NOT_FOUND        The specified measurement record could not be found.\r
@@ -206,14 +233,16 @@ StartPerformanceMeasurement (
 **/\r
 RETURN_STATUS\r
 EFIAPI\r
-EndPerformanceMeasurement (\r
+EndPerformanceMeasurementEx (\r
   IN CONST VOID   *Handle,  OPTIONAL\r
   IN CONST CHAR8  *Token,   OPTIONAL\r
   IN CONST CHAR8  *Module,  OPTIONAL\r
-  IN UINT64       TimeStamp\r
+  IN UINT64       TimeStamp,\r
+  IN UINT32       Identifier\r
   )\r
 {\r
   PEI_PERFORMANCE_LOG_HEADER  *PeiPerformanceLog;\r
+  UINT32                      *PeiPerformanceIdArray;\r
   PEI_PERFORMANCE_LOG_ENTRY   *LogEntryArray;\r
   UINT32                      Index;\r
 \r
@@ -221,8 +250,8 @@ EndPerformanceMeasurement (
     TimeStamp = GetPerformanceCounter ();\r
   }\r
 \r
-  PeiPerformanceLog = InternalGetPerformanceHobLog ();\r
-  Index             = InternalSearchForLogEntry (PeiPerformanceLog, Handle, Token, Module);\r
+  InternalGetPerformanceHobLog (&PeiPerformanceLog, &PeiPerformanceIdArray);\r
+  Index             = InternalSearchForLogEntry (PeiPerformanceLog, PeiPerformanceIdArray, Handle, Token, Module, Identifier);\r
   if (Index >= PeiPerformanceLog->NumberOfEntries) {\r
     return RETURN_NOT_FOUND;\r
   }\r
@@ -234,6 +263,8 @@ EndPerformanceMeasurement (
 \r
 /**\r
   Attempts to retrieve a performance measurement log entry from the performance measurement log.\r
+  It can also retrieve the log created by StartPerformanceMeasurement and EndPerformanceMeasurement,\r
+  and then assign the Identifier with 0.\r
 \r
   Attempts to retrieve the performance log entry specified by LogEntryKey.  If LogEntryKey is\r
   zero on entry, then an attempt is made to retrieve the first entry from the performance log,\r
@@ -244,17 +275,18 @@ EndPerformanceMeasurement (
   retrieved and an implementation specific non-zero key value that specifies the end of the performance\r
   log is returned.  If LogEntryKey is equal this implementation specific non-zero key value, then no entry\r
   is retrieved and zero is returned.  In the cases where a performance log entry can be returned,\r
-  the log entry is returned in Handle, Token, Module, StartTimeStamp, and EndTimeStamp.\r
+  the log entry is returned in Handle, Token, Module, StartTimeStamp, EndTimeStamp and Identifier.\r
   If LogEntryKey is not a valid log entry key for the performance measurement log, then ASSERT().\r
   If Handle is NULL, then ASSERT().\r
   If Token is NULL, then ASSERT().\r
   If Module is NULL, then ASSERT().\r
   If StartTimeStamp is NULL, then ASSERT().\r
   If EndTimeStamp is NULL, then ASSERT().\r
+  If Identifier is NULL, then ASSERT().\r
 \r
   @param  LogEntryKey             On entry, the key of the performance measurement log entry to retrieve.\r
                                   0, then the first performance measurement log entry is retrieved.\r
-                                  On exit, the key of the next performance lof entry entry.\r
+                                  On exit, the key of the next performance of entry entry.\r
   @param  Handle                  Pointer to environment specific context used to identify the component\r
                                   being measured.\r
   @param  Token                   Pointer to a Null-terminated ASCII string that identifies the component\r
@@ -265,22 +297,25 @@ EndPerformanceMeasurement (
                                   was started.\r
   @param  EndTimeStamp            Pointer to the 64-bit time stamp that was recorded when the measurement\r
                                   was ended.\r
+  @param  Identifier              Pointer to the 32-bit identifier that was recorded.\r
 \r
   @return The key for the next performance log entry (in general case).\r
 \r
 **/\r
 UINTN\r
 EFIAPI\r
-GetPerformanceMeasurement (\r
+GetPerformanceMeasurementEx (\r
   IN  UINTN       LogEntryKey,\r
   OUT CONST VOID  **Handle,\r
   OUT CONST CHAR8 **Token,\r
   OUT CONST CHAR8 **Module,\r
   OUT UINT64      *StartTimeStamp,\r
-  OUT UINT64      *EndTimeStamp\r
+  OUT UINT64      *EndTimeStamp,\r
+  OUT UINT32      *Identifier\r
   )\r
 {\r
   PEI_PERFORMANCE_LOG_HEADER  *PeiPerformanceLog;\r
+  UINT32                      *PeiPerformanceIdArray;\r
   PEI_PERFORMANCE_LOG_ENTRY   *CurrentLogEntry;\r
   PEI_PERFORMANCE_LOG_ENTRY   *LogEntryArray;\r
   UINTN                       NumberOfEntries;\r
@@ -290,8 +325,9 @@ GetPerformanceMeasurement (
   ASSERT (Module != NULL);\r
   ASSERT (StartTimeStamp != NULL);\r
   ASSERT (EndTimeStamp != NULL);\r
+  ASSERT (Identifier != NULL);\r
 \r
-  PeiPerformanceLog = InternalGetPerformanceHobLog ();\r
+  InternalGetPerformanceHobLog (&PeiPerformanceLog, &PeiPerformanceIdArray);\r
 \r
   NumberOfEntries   = (UINTN) (PeiPerformanceLog->NumberOfEntries);\r
   LogEntryArray     = (PEI_PERFORMANCE_LOG_ENTRY *) (PeiPerformanceLog + 1);\r
@@ -304,17 +340,138 @@ GetPerformanceMeasurement (
     return 0;\r
   }\r
 \r
-  CurrentLogEntry = &(LogEntryArray[LogEntryKey++]);\r
+  CurrentLogEntry = &(LogEntryArray[LogEntryKey]);\r
 \r
   *Handle         = (VOID *) (UINTN) (CurrentLogEntry->Handle);\r
   *Token          = CurrentLogEntry->Token;\r
   *Module         = CurrentLogEntry->Module;\r
   *StartTimeStamp = CurrentLogEntry->StartTimeStamp;\r
   *EndTimeStamp   = CurrentLogEntry->EndTimeStamp;\r
+  *Identifier     = PeiPerformanceIdArray[LogEntryKey++];\r
 \r
   return LogEntryKey;\r
 }\r
 \r
+/**\r
+  Creates a record for the beginning of a performance measurement.\r
+\r
+  Creates a record that contains the Handle, Token, and Module.\r
+  If TimeStamp is not zero, then TimeStamp is added to the record as the start time.\r
+  If TimeStamp is zero, then this function reads the current time stamp\r
+  and adds that time stamp value to the record as the start time.\r
+\r
+  @param  Handle                  Pointer to environment specific context used\r
+                                  to identify the component being measured.\r
+  @param  Token                   Pointer to a Null-terminated ASCII string\r
+                                  that identifies the component being measured.\r
+  @param  Module                  Pointer to a Null-terminated ASCII string\r
+                                  that identifies the module being measured.\r
+  @param  TimeStamp               64-bit time stamp.\r
+\r
+  @retval RETURN_SUCCESS          The start of the measurement was recorded.\r
+  @retval RETURN_OUT_OF_RESOURCES There are not enough resources to record the measurement.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+StartPerformanceMeasurement (\r
+  IN CONST VOID   *Handle,  OPTIONAL\r
+  IN CONST CHAR8  *Token,   OPTIONAL\r
+  IN CONST CHAR8  *Module,  OPTIONAL\r
+  IN UINT64       TimeStamp\r
+  )\r
+{\r
+  return StartPerformanceMeasurementEx (Handle, Token, Module, TimeStamp, 0);\r
+}\r
+\r
+/**\r
+  Fills in the end time of a performance measurement.\r
+\r
+  Looks up the record that matches Handle, Token, and Module.\r
+  If the record can not be found then return RETURN_NOT_FOUND.\r
+  If the record is found and TimeStamp is not zero,\r
+  then TimeStamp is added to the record as the end time.\r
+  If the record is found and TimeStamp is zero, then this function reads\r
+  the current time stamp and adds that time stamp value to the record as the end time.\r
+\r
+  @param  Handle                  Pointer to environment specific context used\r
+                                  to identify the component being measured.\r
+  @param  Token                   Pointer to a Null-terminated ASCII string\r
+                                  that identifies the component being measured.\r
+  @param  Module                  Pointer to a Null-terminated ASCII string\r
+                                  that identifies the module being measured.\r
+  @param  TimeStamp               64-bit time stamp.\r
+\r
+  @retval RETURN_SUCCESS          The end of  the measurement was recorded.\r
+  @retval RETURN_NOT_FOUND        The specified measurement record could not be found.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+EndPerformanceMeasurement (\r
+  IN CONST VOID   *Handle,  OPTIONAL\r
+  IN CONST CHAR8  *Token,   OPTIONAL\r
+  IN CONST CHAR8  *Module,  OPTIONAL\r
+  IN UINT64       TimeStamp\r
+  )\r
+{\r
+  return EndPerformanceMeasurementEx (Handle, Token, Module, TimeStamp, 0);\r
+}\r
+\r
+/**\r
+  Attempts to retrieve a performance measurement log entry from the performance measurement log.\r
+  It can also retrieve the log created by StartPerformanceMeasurementEx and EndPerformanceMeasurementEx,\r
+  and then eliminate the Identifier.\r
+\r
+  Attempts to retrieve the performance log entry specified by LogEntryKey.  If LogEntryKey is\r
+  zero on entry, then an attempt is made to retrieve the first entry from the performance log,\r
+  and the key for the second entry in the log is returned.  If the performance log is empty,\r
+  then no entry is retrieved and zero is returned.  If LogEntryKey is not zero, then the performance\r
+  log entry associated with LogEntryKey is retrieved, and the key for the next entry in the log is\r
+  returned.  If LogEntryKey is the key for the last entry in the log, then the last log entry is\r
+  retrieved and an implementation specific non-zero key value that specifies the end of the performance\r
+  log is returned.  If LogEntryKey is equal this implementation specific non-zero key value, then no entry\r
+  is retrieved and zero is returned.  In the cases where a performance log entry can be returned,\r
+  the log entry is returned in Handle, Token, Module, StartTimeStamp, and EndTimeStamp.\r
+  If LogEntryKey is not a valid log entry key for the performance measurement log, then ASSERT().\r
+  If Handle is NULL, then ASSERT().\r
+  If Token is NULL, then ASSERT().\r
+  If Module is NULL, then ASSERT().\r
+  If StartTimeStamp is NULL, then ASSERT().\r
+  If EndTimeStamp is NULL, then ASSERT().\r
+\r
+  @param  LogEntryKey             On entry, the key of the performance measurement log entry to retrieve.\r
+                                  0, then the first performance measurement log entry is retrieved.\r
+                                  On exit, the key of the next performance of entry entry.\r
+  @param  Handle                  Pointer to environment specific context used to identify the component\r
+                                  being measured.\r
+  @param  Token                   Pointer to a Null-terminated ASCII string that identifies the component\r
+                                  being measured.\r
+  @param  Module                  Pointer to a Null-terminated ASCII string that identifies the module\r
+                                  being measured.\r
+  @param  StartTimeStamp          Pointer to the 64-bit time stamp that was recorded when the measurement\r
+                                  was started.\r
+  @param  EndTimeStamp            Pointer to the 64-bit time stamp that was recorded when the measurement\r
+                                  was ended.\r
+\r
+  @return The key for the next performance log entry (in general case).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+GetPerformanceMeasurement (\r
+  IN  UINTN       LogEntryKey,\r
+  OUT CONST VOID  **Handle,\r
+  OUT CONST CHAR8 **Token,\r
+  OUT CONST CHAR8 **Module,\r
+  OUT UINT64      *StartTimeStamp,\r
+  OUT UINT64      *EndTimeStamp\r
+  )\r
+{\r
+  UINT32 Identifier;\r
+  return GetPerformanceMeasurementEx (LogEntryKey, Handle, Token, Module, StartTimeStamp, EndTimeStamp, &Identifier);\r
+}\r
+\r
 /**\r
   Returns TRUE if the performance measurement macros are enabled.\r
 \r