]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg:Add definitions for new Performance infrastructure
authorGao, Liming <liming.gao@intel.com>
Thu, 7 Dec 2017 15:29:53 +0000 (23:29 +0800)
committerLiming Gao <liming.gao@intel.com>
Thu, 8 Feb 2018 04:50:16 +0000 (12:50 +0800)
V3:
Add "FPDT_" prefix for related definitions.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h [new file with mode: 0644]
MdeModulePkg/Include/Guid/FirmwarePerformance.h
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.uni

diff --git a/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h b/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h
new file mode 100644 (file)
index 0000000..f2db02d
--- /dev/null
@@ -0,0 +1,291 @@
+/** @file\r
+  This file defines edk2 extended firmware performance records.\r
+  These records will be added into ACPI FPDT Firmware Basic Boot Performance Table.\r
+\r
+Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under\r
+the terms and conditions of the BSD License that accompanies this distribution.\r
+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 __EXTENDED_FIRMWARE_PERFORMANCE_H__\r
+#define __EXTENDED_FIRMWARE_PERFORMANCE_H__\r
+\r
+#include <IndustryStandard/Acpi.h>\r
+\r
+//\r
+// Known performance tokens\r
+//\r
+#define SEC_TOK                         "SEC"             ///< SEC Phase\r
+#define DXE_TOK                         "DXE"             ///< DXE Phase\r
+#define PEI_TOK                         "PEI"             ///< PEI Phase\r
+#define BDS_TOK                         "BDS"             ///< BDS Phase\r
+#define DRIVERBINDING_START_TOK         "DB:Start:"       ///< Driver Binding Start() function call\r
+#define DRIVERBINDING_SUPPORT_TOK       "DB:Support:"     ///< Driver Binding Support() function call\r
+#define DRIVERBINDING_STOP_TOK          "DB:Stop:"        ///< Driver Binding Stop() function call\r
+#define LOAD_IMAGE_TOK                  "LoadImage:"      ///< Load a dispatched module\r
+#define START_IMAGE_TOK                 "StartImage:"     ///< Dispatched Modules Entry Point execution\r
+#define PEIM_TOK                        "PEIM"            ///< PEIM Modules Entry Point execution\r
+\r
+//\r
+// Public Progress Identifiers for Event Records to map the above known token\r
+//\r
+#define MODULE_START_ID                 0x01\r
+#define MODULE_END_ID                   0x02\r
+#define MODULE_LOADIMAGE_START_ID       0x03\r
+#define MODULE_LOADIMAGE_END_ID         0x04\r
+#define MODULE_DB_START_ID              0x05\r
+#define MODULE_DB_END_ID                0x06\r
+#define MODULE_DB_SUPPORT_START_ID      0x07\r
+#define MODULE_DB_SUPPORT_END_ID        0x08\r
+#define MODULE_DB_STOP_START_ID         0x09\r
+#define MODULE_DB_STOP_END_ID           0x0A\r
+\r
+#define PERF_EVENTSIGNAL_START_ID       0x10\r
+#define PERF_EVENTSIGNAL_END_ID         0x11\r
+#define PERF_CALLBACK_START_ID          0x20\r
+#define PERF_CALLBACK_END_ID            0x21\r
+#define PERF_FUNCTION_START_ID          0x30\r
+#define PERF_FUNCTION_END_ID            0x31\r
+#define PERF_INMODULE_START_ID          0x40\r
+#define PERF_INMODULE_END_ID            0x41\r
+#define PERF_CROSSMODULE_START_ID       0x50\r
+#define PERF_CROSSMODULE_END_ID         0x51\r
+\r
+//\r
+// Misc defines\r
+//\r
+#define FPDT_RECORD_REVISION_1      (0x01)\r
+\r
+//\r
+// Length field in EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER is a UINT8, thus:\r
+//\r
+#define FPDT_MAX_PERF_RECORD_SIZE   (MAX_UINT8)\r
+\r
+//\r
+// FPDT Record Types\r
+//\r
+#define FPDT_GUID_EVENT_TYPE               0x1010\r
+#define FPDT_DYNAMIC_STRING_EVENT_TYPE     0x1011\r
+#define FPDT_DUAL_GUID_STRING_EVENT_TYPE   0x1012\r
+#define FPDT_GUID_QWORD_EVENT_TYPE         0x1013\r
+#define FPDT_GUID_QWORD_STRING_EVENT_TYPE  0x1014\r
+\r
+//\r
+// EDKII extended Fpdt record structures\r
+//\r
+#define FPDT_STRING_EVENT_RECORD_NAME_LENGTH 24\r
+\r
+#pragma pack(1)\r
+//\r
+// FPDT Boot Performance Guid Event Record Structure\r
+//\r
+typedef struct {\r
+  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
+  ///\r
+  /// ProgressID < 0x10 are reserved for core performance entries.\r
+  /// Start measurement point shall have lowered one nibble set to zero and\r
+  /// corresponding end points shall have lowered one nibble set to non-zero value;\r
+  /// keeping other nibbles same as start point.\r
+  ///\r
+  UINT16                                      ProgressID;\r
+  ///\r
+  /// APIC ID for the processor in the system used as a timestamp clock source.\r
+  /// If only one timestamp clock source is used, this field is Reserved and populated as 0.\r
+  ///\r
+  UINT32                                      ApicID;\r
+  ///\r
+  /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
+  ///\r
+  UINT64                                      Timestamp;\r
+  ///\r
+  /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.\r
+  ///\r
+  EFI_GUID                                    Guid;\r
+} FPDT_GUID_EVENT_RECORD;\r
+\r
+//\r
+// FPDT Boot Performance Dynamic String Event Record Structure\r
+//\r
+typedef struct {\r
+  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
+  ///\r
+  /// ProgressID < 0x10 are reserved for core performance entries.\r
+  /// Start measurement point shall have lowered one nibble set to zero and\r
+  /// corresponding end points shall have lowered one nibble set to non-zero value;\r
+  /// keeping other nibbles same as start point.\r
+  ///\r
+  UINT16                                      ProgressID;\r
+  ///\r
+  /// APIC ID for the processor in the system used as a timestamp clock source.\r
+  /// If only one timestamp clock source is used, this field is Reserved and populated as 0.\r
+  ///\r
+  UINT32                                      ApicID;\r
+  ///\r
+  /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
+  ///\r
+  UINT64                                      Timestamp;\r
+  ///\r
+  /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.\r
+  ///\r
+  EFI_GUID                                    Guid;\r
+  ///\r
+  /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).\r
+  /// It may be module name, function name, or token name.\r
+  ///\r
+  CHAR8                                       String[0];\r
+} FPDT_DYNAMIC_STRING_EVENT_RECORD;\r
+\r
+//\r
+// FPDT Boot Performance Dual GUID String Event Record Structure\r
+//\r
+typedef struct {\r
+  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
+  ///\r
+  /// ProgressID < 0x10 are reserved for core performance entries.\r
+  /// Start measurement point shall have lowered one nibble set to zero and\r
+  /// corresponding end points shall have lowered one nibble set to non-zero value;\r
+  /// keeping other nibbles same as start point.\r
+  ///\r
+  UINT16                                      ProgressID;\r
+  ///\r
+  /// APIC ID for the processor in the system used as a timestamp clock source.\r
+  /// If only one timestamp clock source is used, this field is Reserved and populated as 0.\r
+  ///\r
+  UINT32                                      ApicID;\r
+  ///\r
+  /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
+  ///\r
+  UINT64                                      Timestamp;\r
+  ///\r
+  /// GUID of the module logging the event.\r
+  ///\r
+  EFI_GUID                                    Guid1;\r
+  ///\r
+  /// Event or Ppi or Protocol GUID for Callback.\r
+  ///\r
+  EFI_GUID                                    Guid2;\r
+  ///\r
+  /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).\r
+  /// It is the function name.\r
+  ///\r
+  CHAR8                                       String[0];\r
+} FPDT_DUAL_GUID_STRING_EVENT_RECORD;\r
+\r
+//\r
+// FPDT Boot Performance GUID Qword Event Record Structure\r
+//\r
+typedef struct {\r
+  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
+  ///\r
+  /// ProgressID < 0x10 are reserved for core performance entries.\r
+  /// Start measurement point shall have lowered one nibble set to zero and\r
+  /// corresponding end points shall have lowered one nibble set to non-zero value;\r
+  /// keeping other nibbles same as start point.\r
+  ///\r
+  UINT16                                      ProgressID;\r
+  ///\r
+  /// APIC ID for the processor in the system used as a timestamp clock source.\r
+  /// If only one timestamp clock source is used, this field is Reserved and populated as 0.\r
+  ///\r
+  UINT32                                      ApicID;\r
+  ///\r
+  /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
+  ///\r
+  UINT64                                      Timestamp;\r
+  ///\r
+  /// GUID of the module logging the event\r
+  ///\r
+  EFI_GUID                                    Guid;\r
+  ///\r
+  /// Qword of misc data, meaning depends on the ProgressId\r
+  ///\r
+  UINT64                                      Qword;\r
+} FPDT_GUID_QWORD_EVENT_RECORD;\r
+\r
+//\r
+// FPDT Boot Performance GUID Qword String Event Record Structure\r
+//\r
+typedef struct {\r
+  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
+  ///\r
+  /// ProgressID < 0x10 are reserved for core performance entries.\r
+  /// Start measurement point shall have lowered one nibble set to zero and\r
+  /// corresponding end points shall have lowered one nibble set to non-zero value;\r
+  /// keeping other nibbles same as start point.\r
+  ///\r
+  UINT16                                      ProgressID;\r
+  ///\r
+  /// APIC ID for the processor in the system used as a timestamp clock source.\r
+  /// If only one timestamp clock source is used, this field is Reserved and populated as 0.\r
+  ///\r
+  UINT32                                      ApicID;\r
+  ///\r
+  /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
+  ///\r
+  UINT64                                      Timestamp;\r
+  ///\r
+  /// GUID of the module logging the event\r
+  ///\r
+  EFI_GUID                                    Guid;\r
+  ///\r
+  /// Qword of misc data, meaning depends on the ProgressId\r
+  ///\r
+  UINT64                                      Qword;\r
+  ///\r
+  /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).\r
+  ///\r
+  CHAR8                                       String[0];\r
+} FPDT_GUID_QWORD_STRING_EVENT_RECORD;\r
+\r
+#pragma pack()\r
+\r
+typedef struct {\r
+  UINT16                                      ProgressID;\r
+  UINT16                                      Type;\r
+  UINT8                                       RecordSize;\r
+} FPDT_BASIC_RECORD_INFO;\r
+\r
+//\r
+// Union of all FPDT records\r
+//\r
+typedef union {\r
+  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER  RecordHeader;\r
+  FPDT_GUID_EVENT_RECORD                       GuidEvent;\r
+  FPDT_DYNAMIC_STRING_EVENT_RECORD             DynamicStringEvent;\r
+  FPDT_DUAL_GUID_STRING_EVENT_RECORD           DualGuidStringEvent;\r
+  FPDT_GUID_QWORD_EVENT_RECORD                 GuidQwordEvent;\r
+  FPDT_GUID_QWORD_STRING_EVENT_RECORD          GuidQwordStringEvent;\r
+} FPDT_RECORD;\r
+\r
+//\r
+// Union of all pointers to FPDT records\r
+//\r
+typedef union {\r
+  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER  *RecordHeader;\r
+  FPDT_GUID_EVENT_RECORD                       *GuidEvent;\r
+  FPDT_DYNAMIC_STRING_EVENT_RECORD             *DynamicStringEvent;\r
+  FPDT_DUAL_GUID_STRING_EVENT_RECORD           *DualGuidStringEvent;\r
+  FPDT_GUID_QWORD_EVENT_RECORD                 *GuidQwordEvent;\r
+  FPDT_GUID_QWORD_STRING_EVENT_RECORD          *GuidQwordStringEvent;\r
+} FPDT_RECORD_PTR;\r
+\r
+///\r
+/// Hob:\r
+///   GUID - gEdkiiFpdtExtendedFirmwarePerformanceGuid;\r
+///   Data - FPDT_PEI_EXT_PERF_HEADER + one or more FPDT records\r
+///\r
+typedef struct {\r
+  UINT32                SizeOfAllEntries;\r
+  UINT32                LoadImageCount;\r
+  UINT32                HobIsFull;\r
+} FPDT_PEI_EXT_PERF_HEADER;\r
+\r
+extern EFI_GUID gEdkiiFpdtExtendedFirmwarePerformanceGuid;\r
+\r
+#endif\r
index 4697a2c41e53f2fa811da16575111950f03d9b8f..1495a466da4ffac119277bc05b78baad92408982 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI Firmware Performance Data Table (FPDT) implementation specific definitions.\r
 \r
-  Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2018, 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
@@ -94,6 +94,17 @@ typedef struct {
   //\r
 } BOOT_PERFORMANCE_TABLE;\r
 \r
+///\r
+/// Boot performance table for the performance record in SMM phase.\r
+///\r
+///\r
+typedef struct {\r
+  EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER   Header;     ///< Common ACPI table header.\r
+  //\r
+  // one or more boot performance records.\r
+  //\r
+} SMM_BOOT_PERFORMANCE_TABLE;\r
+\r
 ///\r
 /// Performance data pointed by Performance Pointer Record.\r
 ///\r
index 61d034fba85e3a088fddd61180d2ba31788dfc37..5ea2e0b1dd4bdbeb04253cf3938ba0f2e539ff45 100644 (file)
   ## Include/Guid/PlatformHasAcpi.h\r
   gEdkiiPlatformHasAcpiGuid = { 0xf0966b41, 0xc23f, 0x41b9, { 0x96, 0x04, 0x0f, 0xf7, 0xe1, 0x11, 0x96, 0x5a } }\r
 \r
+  ## Include/Guid/ExtendedFirmwarePerformance.h\r
+  gEdkiiFpdtExtendedFirmwarePerformanceGuid = { 0x3b387bfd, 0x7abc, 0x4cf2, { 0xa0, 0xca, 0xb6, 0xa1, 0x6c, 0x1b, 0x1b, 0x25 } }\r
+\r
   ## Include/Guid/EndofS3Resume.h\r
   gEdkiiEndOfS3ResumeGuid = { 0x96f5296d, 0x05f7, 0x4f3c, {0x84, 0x67, 0xe4, 0x56, 0x89, 0x0e, 0x0c, 0xb5 } }\r
 \r
   # @Prompt CapsuleMax value in capsule report variable.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax|0xFFFF|UINT16|0x00000107\r
 \r
+  ## Control which FPDT record format will be used to store the performance entry.\r
+  # On TRUE, the string FPDT record will be used to store every performance entry.\r
+  # On FALSE, the different FPDT record will be used to store the different performance entries.\r
+  # @Prompt String FPDT Record Enable Only\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdEdkiiFpdtStringRecordEnableOnly|FALSE|BOOLEAN|0x00000109\r
+\r
 [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]\r
   ## This PCD defines the Console output row. The default value is 25 according to UEFI spec.\r
   #  This PCD could be set to 0 then console output would be at max column and max row.\r
   ## This PCD specifies the additional pad size in FPDT Basic Boot Performance Table for\r
   #  the extension FPDT boot records received after ReadyToBoot and before ExitBootService.\r
   # @Prompt Pad size for extension FPDT boot records.\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize|0x0|UINT32|0x0001005F\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize|0x20000|UINT32|0x0001005F\r
 \r
   ## Indicates if ConIn device are connected on demand.<BR><BR>\r
   #   TRUE  - ConIn device are not connected during BDS and ReadKeyStroke/ReadKeyStrokeEx produced\r
index 0e068422e4f17b5e5adb4ef765a358768ea2df78..dacd6718d72ed89d21da1acb064376ed4dd2c053 100644 (file)
@@ -4,7 +4,7 @@
 // It also provides the definitions(including PPIs/PROTOCOLs/GUIDs and library classes)\r
 // and libraries instances, which are used for those modules.\r
 //\r
-// Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+// Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 //\r
 // This program and the accompanying materials are licensed and made available under\r
 // the terms and conditions of the BSD License that accompanies this distribution.\r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNvStoreDefaultValueBuffer_PROMPT  #language en-US "NV Storage Default Value Buffer"\r
 \r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNvStoreDefaultValueBuffer_HELP    #language en-US "This dynamic PCD holds the DynamicHii PCD value. Its value is the auto generated.\n"\r
+\r
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdEdkiiFpdtStringRecordEnableOnly_PROMPT  #language en-US "String FPDT Record Enable Only"\r
+\r
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdEdkiiFpdtStringRecordEnableOnly_HELP    #language en-US "Control which FPDT record format will be used to store the performance entry.\n"\r
+                                                                                                      "On TRUE, the string FPDT record will be used to store every performance entry.\n"\r
+                                                                                                      "On FALSE, the different FPDT record will be used to store the different performance entries."\r