]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Merge performance protocol, pei performance hob into a single performance.h in MdeMod...
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Feb 2009 02:57:46 +0000 (02:57 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Feb 2009 02:57:46 +0000 (02:57 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7563 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Guid/Performance.h [new file with mode: 0644]
MdeModulePkg/Include/Protocol/Performance.h [deleted file]

diff --git a/MdeModulePkg/Include/Guid/Performance.h b/MdeModulePkg/Include/Guid/Performance.h
new file mode 100644 (file)
index 0000000..14c7c83
--- /dev/null
@@ -0,0 +1,199 @@
+/** @file\r
+  This file defines performance related definitions: the format of performance\r
+  GUID HOB, performance protocol interfaces and performance variable format.  \r
+\r
+Copyright (c) 2009, Intel Corporation. <BR>\r
+All rights reserved. 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
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __PERFORMANCE_DATA_H__\r
+#define __PERFORMANCE_DATA_H__\r
+\r
+//\r
+// PEI_PERFORMANCE_STRING_SIZE must be a multiple of 8.\r
+//\r
+#define PEI_PERFORMANCE_STRING_SIZE     8\r
+#define PEI_PERFORMANCE_STRING_LENGTH   (PEI_PERFORMANCE_STRING_SIZE - 1)\r
+\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS  Handle;\r
+  CHAR8                 Token[PEI_PERFORMANCE_STRING_SIZE];   ///> Measured token string name \r
+  CHAR8                 Module[PEI_PERFORMANCE_STRING_SIZE];  ///> Module string name\r
+  UINT64                StartTimeStamp;                       ///> Start time point\r
+  UINT64                EndTimeStamp;                         ///> End time point\r
+} PEI_PERFORMANCE_LOG_ENTRY;\r
+\r
+//\r
+// The header must be aligned at 8 bytes.\r
+// \r
+typedef struct {\r
+  UINT32                NumberOfEntries;  ///> The number of all performance log entries\r
+  UINT32                Reserved;\r
+} PEI_PERFORMANCE_LOG_HEADER;\r
+\r
+\r
+//\r
+// The data structure for performance data in ACPI memory.\r
+//\r
+#define PERFORMANCE_SIGNATURE   SIGNATURE_32 ('P', 'e', 'r', 'f')\r
+#define PERF_TOKEN_SIZE         28\r
+#define PERF_TOKEN_LENGTH       (PERF_TOKEN_SIZE - 1)\r
+#define PERF_PEI_ENTRY_MAX_NUM  50\r
+\r
+typedef struct {\r
+  CHAR8   Token[PERF_TOKEN_SIZE];\r
+  UINT32  Duration;\r
+} PERF_DATA;\r
+\r
+typedef struct {\r
+  UINT64        BootToOs;\r
+  UINT64        S3Resume;\r
+  UINT32        S3EntryNum;\r
+  PERF_DATA     S3Entry[PERF_PEI_ENTRY_MAX_NUM];\r
+  UINT64        CpuFreq;\r
+  UINT64        BDSRaw;\r
+  UINT32        Count;\r
+  UINT32        Signiture;\r
+} PERF_HEADER;\r
+\r
+#define PERFORMANCE_PROTOCOL_GUID \\r
+  { 0x76b6bdfa, 0x2acd, 0x4462, {0x9E, 0x3F, 0xcb, 0x58, 0xC9, 0x69, 0xd9, 0x37 } }\r
+\r
+//\r
+// Forward reference for pure ANSI compatibility\r
+//\r
+typedef struct _PERFORMANCE_PROTOCOL PERFORMANCE_PROTOCOL;\r
+\r
+//\r
+// DXE_PERFORMANCE_STRING_SIZE must be a multiple of 8.\r
+//\r
+#define DXE_PERFORMANCE_STRING_SIZE     32\r
+#define DXE_PERFORMANCE_STRING_LENGTH   (DXE_PERFORMANCE_STRING_SIZE - 1)\r
+\r
+//\r
+// The default guage entries number for DXE phase.\r
+//\r
+#define INIT_DXE_GAUGE_DATA_ENTRIES     800\r
+\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS  Handle;\r
+  CHAR8                 Token[DXE_PERFORMANCE_STRING_SIZE];  ///> Measured token string name \r
+  CHAR8                 Module[DXE_PERFORMANCE_STRING_SIZE]; ///> Module string name\r
+  UINT64                StartTimeStamp;                      ///> Start time point\r
+  UINT64                EndTimeStamp;                        ///> End time point\r
+} GAUGE_DATA_ENTRY;\r
+\r
+//\r
+// The header must be aligned at 8 bytes\r
+//\r
+typedef struct {\r
+  UINT32                NumberOfEntries; ///> The number of all performance guage entries\r
+  UINT32                Reserved;\r
+} GAUGE_DATA_HEADER;\r
+\r
+/**\r
+  Adds a record at the end of the performance measurement log\r
+  that records the start time of a performance measurement.\r
+\r
+  Adds a record to the end of the performance measurement log\r
+  that contains the Handle, Token, and Module.\r
+  The end time of the new record must be set to zero.\r
+  If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.\r
+  If TimeStamp is zero, the start time in the record is filled in with the value\r
+  read from the current time stamp.\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 EFI_SUCCESS             The data was read correctly from the device.\r
+  @retval EFI_OUT_OF_RESOURCES    There are not enough resources to record the measurement.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI * PERFORMANCE_START_GAUGE)(\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
+/**\r
+  Searches the performance measurement log from the beginning of the log\r
+  for the first matching record that contains a zero end time and fills in a valid end time.\r
+\r
+  Searches the performance measurement log from the beginning of the log\r
+  for the first record that matches Handle, Token, and Module and has an end time value of zero.\r
+  If the record can not be found then return EFI_NOT_FOUND.\r
+  If the record is found and TimeStamp is not zero,\r
+  then the end time in the record is filled in with the value specified by TimeStamp.\r
+  If the record is found and TimeStamp is zero, then the end time in the matching record\r
+  is filled in with the current time stamp value.\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 EFI_SUCCESS             The end of  the measurement was recorded.\r
+  @retval EFI_NOT_FOUND           The specified measurement record could not be found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI * PERFORMANCE_END_GAUGE)(\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
+/**\r
+  Retrieves a previously logged performance measurement.\r
+\r
+  Retrieves the performance log entry from the performance log specified by LogEntryKey.\r
+  If it stands for a valid entry, then EFI_SUCCESS is returned and\r
+  GaugeDataEntry stores the pointer to that entry.\r
+\r
+  @param  LogEntryKey             The key for the previous performance measurement log entry.\r
+                                  If 0, then the first performance measurement log entry is retrieved.\r
+  @param  GaugeDataEntry          The indirect pointer to the gauge data entry specified by LogEntryKey\r
+                                  if the retrieval is successful.\r
+\r
+  @retval EFI_SUCCESS             The GuageDataEntry is successfully found based on LogEntryKey.\r
+  @retval EFI_NOT_FOUND           The LogEntryKey is the last entry (equals to the total entry number).\r
+  @retval EFI_INVALIDE_PARAMETER  The LogEntryKey is not a valid entry (greater than the total entry number).\r
+  @retval EFI_INVALIDE_PARAMETER  GaugeDataEntry is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI * PERFORMANCE_GET_GAUGE)(\r
+  IN  UINTN               LogEntryKey,\r
+  OUT GAUGE_DATA_ENTRY    **GaugeDataEntry\r
+  );\r
+\r
+struct _PERFORMANCE_PROTOCOL {\r
+  PERFORMANCE_START_GAUGE             StartGauge;\r
+  PERFORMANCE_END_GAUGE               EndGauge;\r
+  PERFORMANCE_GET_GAUGE               GetGauge;\r
+};\r
+\r
+extern EFI_GUID gPerformanceProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdeModulePkg/Include/Protocol/Performance.h b/MdeModulePkg/Include/Protocol/Performance.h
deleted file mode 100644 (file)
index cddd0a1..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file\r
-  Performance protocol interfaces to support cross module performance logging. \r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. 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
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef __PERFORMANCE_H__\r
-#define __PERFORMANCE_H__\r
-\r
-#define PERFORMANCE_PROTOCOL_GUID \\r
-  { 0x76b6bdfa, 0x2acd, 0x4462, {0x9E, 0x3F, 0xcb, 0x58, 0xC9, 0x69, 0xd9, 0x37 } }\r
-\r
-//\r
-// Forward reference for pure ANSI compatability\r
-//\r
-typedef struct _PERFORMANCE_PROTOCOL PERFORMANCE_PROTOCOL;\r
-\r
-#define SEC_TOK                         "SEC"\r
-#define DXE_TOK                         "DXE"\r
-#define SHELL_TOK                       "SHELL"\r
-#define PEI_TOK                         "PEI"\r
-#define BDS_TOK                         "BDS"\r
-#define DRIVERBINDING_START_TOK         "DB:Start:"\r
-#define DRIVERBINDING_SUPPORT_TOK       "DB:Support:"\r
-#define START_IMAGE_TOK                 "StartImage:"\r
-#define LOAD_IMAGE_TOK                  "LoadImage:"\r
-\r
-//\r
-// DXE_PERFORMANCE_STRING_SIZE must be a multiple of 8.\r
-//\r
-#define DXE_PERFORMANCE_STRING_SIZE     32\r
-#define DXE_PERFORMANCE_STRING_LENGTH   (DXE_PERFORMANCE_STRING_SIZE - 1)\r
-\r
-//\r
-// The default guage entries number for DXE phase.\r
-//\r
-#define INIT_DXE_GAUGE_DATA_ENTRIES     800\r
-\r
-typedef struct {\r
-  EFI_PHYSICAL_ADDRESS  Handle;\r
-  CHAR8                 Token[DXE_PERFORMANCE_STRING_SIZE];  ///> Measured token string name \r
-  CHAR8                 Module[DXE_PERFORMANCE_STRING_SIZE]; ///> Module string name\r
-  UINT64                StartTimeStamp;                      ///> Start time point\r
-  UINT64                EndTimeStamp;                        ///> End time point\r
-} GAUGE_DATA_ENTRY;\r
-\r
-//\r
-// The header must be aligned at 8 bytes\r
-//\r
-typedef struct {\r
-  UINT32                NumberOfEntries; ///> The number of all performance guage entries\r
-  UINT32                Reserved;\r
-} GAUGE_DATA_HEADER;\r
-\r
-/**\r
-  Adds a record at the end of the performance measurement log\r
-  that records the start time of a performance measurement.\r
-\r
-  Adds a record to the end of the performance measurement log\r
-  that contains the Handle, Token, and Module.\r
-  The end time of the new record must be set to zero.\r
-  If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.\r
-  If TimeStamp is zero, the start time in the record is filled in with the value\r
-  read from the current time stamp.\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 EFI_SUCCESS             The data was read correctly from the device.\r
-  @retval EFI_OUT_OF_RESOURCES    There are not enough resources to record the measurement.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI * PERFORMANCE_START_GAUGE)(\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
-/**\r
-  Searches the performance measurement log from the beginning of the log\r
-  for the first matching record that contains a zero end time and fills in a valid end time.\r
-\r
-  Searches the performance measurement log from the beginning of the log\r
-  for the first record that matches Handle, Token, and Module and has an end time value of zero.\r
-  If the record can not be found then return EFI_NOT_FOUND.\r
-  If the record is found and TimeStamp is not zero,\r
-  then the end time in the record is filled in with the value specified by TimeStamp.\r
-  If the record is found and TimeStamp is zero, then the end time in the matching record\r
-  is filled in with the current time stamp value.\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 EFI_SUCCESS             The end of  the measurement was recorded.\r
-  @retval EFI_NOT_FOUND           The specified measurement record could not be found.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI * PERFORMANCE_END_GAUGE)(\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
-/**\r
-  Retrieves a previously logged performance measurement.\r
-\r
-  Retrieves the performance log entry from the performance log specified by LogEntryKey.\r
-  If it stands for a valid entry, then EFI_SUCCESS is returned and\r
-  GaugeDataEntry stores the pointer to that entry.\r
-\r
-  @param  LogEntryKey             The key for the previous performance measurement log entry.\r
-                                  If 0, then the first performance measurement log entry is retrieved.\r
-  @param  GaugeDataEntry          The indirect pointer to the gauge data entry specified by LogEntryKey\r
-                                  if the retrieval is successful.\r
-\r
-  @retval EFI_SUCCESS             The GuageDataEntry is successfully found based on LogEntryKey.\r
-  @retval EFI_NOT_FOUND           The LogEntryKey is the last entry (equals to the total entry number).\r
-  @retval EFI_INVALIDE_PARAMETER  The LogEntryKey is not a valid entry (greater than the total entry number).\r
-  @retval EFI_INVALIDE_PARAMETER  GaugeDataEntry is NULL.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI * PERFORMANCE_GET_GAUGE)(\r
-  IN  UINTN               LogEntryKey,\r
-  OUT GAUGE_DATA_ENTRY    **GaugeDataEntry\r
-  );\r
-\r
-struct _PERFORMANCE_PROTOCOL {\r
-  PERFORMANCE_START_GAUGE             StartGauge;\r
-  PERFORMANCE_END_GAUGE               EndGauge;\r
-  PERFORMANCE_GET_GAUGE               GetGauge;\r
-};\r
-\r
-extern EFI_GUID gPerformanceProtocolGuid;\r
-\r
-#endif\r