]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Extend memory profile definitions for memory leak detection
authorStar Zeng <star.zeng@intel.com>
Tue, 31 May 2016 05:40:24 +0000 (13:40 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 1 Jul 2016 01:39:50 +0000 (09:39 +0800)
Current memory profile feature:
1. Shows which line of code calls gBS->AllocateXXX(). But most entries
are from MemoryAllocationLib.
2. Records at the start.
3. Records all modules.

Enhanced memory profile feature:
1. User can know which line of code calls AllocateXXX() API instead of
gBS->Allocate().
2. User can know which line of code calls a specific API that will call
AllocateXXX().
3. User can know total memory allocated by a specific line of code.
4. User can configure to record single module.
5. User can configure when to enable recording.
6. User can know RVA<->Symbol (Function, Source, Line).

For the enhanced memory profile feature,
1. Extend MEMORY_PROFILE_DRIVER_INFO to include PdbString.
2. Extend MEMORY_PROFILE_ALLOC_INFO to include ActionString.
3. Extend MEMORY_PROFILE_ACTION to indicate action in memory allocation
lib and user defined action.
4. Extend memory profile protocol to include GetRecordingState/
SetRecordingState/Record.
5. Define SMM memory profile protocol.
6. Extend PcdMemoryProfilePropertyMask to support disable recording at
the start.
7. Introduce new PCD PcdMemoryProfileDriverPath to control which drivers
need memory profile data.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Include/Guid/MemoryProfile.h
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.uni

index 9c70b9df3924b81c3cc8a78415d14de9000cdf69..38a64945e36843d6be89d2d6c108db22e49b59a1 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef _MEMORY_PROFILE_H_\r
 #define _MEMORY_PROFILE_H_\r
 \r
 #ifndef _MEMORY_PROFILE_H_\r
 #define _MEMORY_PROFILE_H_\r
 \r
+#include <Pi/PiFirmwareFile.h>\r
+\r
 //\r
 // For BIOS MemoryType (0 ~ EfiMaxMemoryType - 1), it is recorded in UsageByType[MemoryType]. (Each valid entry has one entry)\r
 // For OS MemoryType (0x80000000 ~ 0xFFFFFFFF), it is recorded in UsageByType[EfiMaxMemoryType]. (All types are combined into one entry)\r
 //\r
 // For BIOS MemoryType (0 ~ EfiMaxMemoryType - 1), it is recorded in UsageByType[MemoryType]. (Each valid entry has one entry)\r
 // For OS MemoryType (0x80000000 ~ 0xFFFFFFFF), it is recorded in UsageByType[EfiMaxMemoryType]. (All types are combined into one entry)\r
@@ -42,7 +44,7 @@ typedef struct {
 } MEMORY_PROFILE_CONTEXT;\r
 \r
 #define MEMORY_PROFILE_DRIVER_INFO_SIGNATURE SIGNATURE_32 ('M','P','D','I')\r
 } MEMORY_PROFILE_CONTEXT;\r
 \r
 #define MEMORY_PROFILE_DRIVER_INFO_SIGNATURE SIGNATURE_32 ('M','P','D','I')\r
-#define MEMORY_PROFILE_DRIVER_INFO_REVISION 0x0002\r
+#define MEMORY_PROFILE_DRIVER_INFO_REVISION 0x0003\r
 \r
 typedef struct {\r
   MEMORY_PROFILE_COMMON_HEADER  Header;\r
 \r
 typedef struct {\r
   MEMORY_PROFILE_COMMON_HEADER  Header;\r
@@ -58,6 +60,9 @@ typedef struct {
   UINT64                        PeakUsage;\r
   UINT64                        CurrentUsageByType[EfiMaxMemoryType + 2];\r
   UINT64                        PeakUsageByType[EfiMaxMemoryType + 2];\r
   UINT64                        PeakUsage;\r
   UINT64                        CurrentUsageByType[EfiMaxMemoryType + 2];\r
   UINT64                        PeakUsageByType[EfiMaxMemoryType + 2];\r
+  UINT16                        PdbStringOffset;\r
+  UINT8                         Reserved2[6];\r
+//CHAR8                         PdbString[];\r
 } MEMORY_PROFILE_DRIVER_INFO;\r
 \r
 typedef enum {\r
 } MEMORY_PROFILE_DRIVER_INFO;\r
 \r
 typedef enum {\r
@@ -67,8 +72,75 @@ typedef enum {
   MemoryProfileActionFreePool = 4,\r
 } MEMORY_PROFILE_ACTION;\r
 \r
   MemoryProfileActionFreePool = 4,\r
 } MEMORY_PROFILE_ACTION;\r
 \r
+//\r
+// Below is the detailed MEMORY_PROFILE_ACTION definition.\r
+//\r
+//  31       15      9  8  8 7  7 6   6 5-4  3 - 0\r
+// +----------------------------------------------+\r
+// |User |  |Lib|   |Re|Copy|Zero|Align|Type|Basic|\r
+// +----------------------------------------------+\r
+//\r
+\r
+//\r
+// Basic Action\r
+//      1 : AllocatePages\r
+//      2 : FreePages\r
+//      3 : AllocatePool\r
+//      4 : FreePool\r
+//\r
+#define MEMORY_PROFILE_ACTION_BASIC_MASK 0xF\r
+\r
+//\r
+// Extension\r
+//\r
+#define MEMORY_PROFILE_ACTION_EXTENSION_MASK               0xFFF0\r
+#define MEMORY_PROFILE_ACTION_EXTENSION_LIB_MASK           0x8000\r
+#define MEMORY_PROFILE_ACTION_EXTENSION_REALLOC_MASK       0x0200\r
+#define MEMORY_PROFILE_ACTION_EXTENSION_COPY_MASK          0x0100\r
+#define MEMORY_PROFILE_ACTION_EXTENSION_ZERO_MASK          0x0080\r
+#define MEMORY_PROFILE_ACTION_EXTENSION_ALIGN_MASK         0x0040\r
+#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_MASK      0x0030\r
+#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_BASIC     0x0000\r
+#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_RUNTIME   0x0010\r
+#define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_RESERVED  0x0020\r
+\r
+//\r
+// Extension (used by memory allocation lib)\r
+//\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_PAGES                    0x8001\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_PAGES            0x8011\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_PAGES           0x8021\r
+#define MEMORY_PROFILE_ACTION_LIB_FREE_PAGES                        0x8002\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_PAGES            0x8041\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_RUNTIME_PAGES    0x8051\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_RESERVED_PAGES   0x8061\r
+#define MEMORY_PROFILE_ACTION_LIB_FREE_ALIGNED_PAGES                0x8042\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_POOL                     0x8003\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_POOL             0x8013\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_POOL            0x8023\r
+#define MEMORY_PROFILE_ACTION_LIB_FREE_POOL                         0x8004\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ZERO_POOL                0x8083\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_ZERO_POOL        0x8093\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_ZERO_POOL       0x80a3\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_COPY_POOL                0x8103\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_COPY_POOL        0x8113\r
+#define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_COPY_POOL       0x8123\r
+#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_POOL                   0x8203\r
+#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RUNTIME_POOL           0x8213\r
+#define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RESERVED_POOL          0x8223\r
+\r
+//\r
+// User defined: 0x80000000~0xFFFFFFFF\r
+//\r
+// NOTE: User defined action MUST OR the basic action,\r
+//       so that core can know the action is allocate or free,\r
+//       and the type is pages (can be freed partially)\r
+//       or pool (cannot be freed partially).\r
+//\r
+#define MEMORY_PROFILE_ACTION_USER_DEFINED_MASK           0x80000000\r
+\r
 #define MEMORY_PROFILE_ALLOC_INFO_SIGNATURE SIGNATURE_32 ('M','P','A','I')\r
 #define MEMORY_PROFILE_ALLOC_INFO_SIGNATURE SIGNATURE_32 ('M','P','A','I')\r
-#define MEMORY_PROFILE_ALLOC_INFO_REVISION 0x0001\r
+#define MEMORY_PROFILE_ALLOC_INFO_REVISION 0x0002\r
 \r
 typedef struct {\r
   MEMORY_PROFILE_COMMON_HEADER  Header;\r
 \r
 typedef struct {\r
   MEMORY_PROFILE_COMMON_HEADER  Header;\r
@@ -79,6 +151,9 @@ typedef struct {
   EFI_MEMORY_TYPE               MemoryType;\r
   PHYSICAL_ADDRESS              Buffer;\r
   UINT64                        Size;\r
   EFI_MEMORY_TYPE               MemoryType;\r
   PHYSICAL_ADDRESS              Buffer;\r
   UINT64                        Size;\r
+  UINT16                        ActionStringOffset;\r
+  UINT8                         Reserved2[6];\r
+//CHAR8                         ActionString[];\r
 } MEMORY_PROFILE_ALLOC_INFO;\r
 \r
 #define MEMORY_PROFILE_DESCRIPTOR_SIGNATURE SIGNATURE_32 ('M','P','D','R')\r
 } MEMORY_PROFILE_ALLOC_INFO;\r
 \r
 #define MEMORY_PROFILE_DESCRIPTOR_SIGNATURE SIGNATURE_32 ('M','P','D','R')\r
@@ -141,6 +216,7 @@ typedef struct _EDKII_MEMORY_PROFILE_PROTOCOL EDKII_MEMORY_PROFILE_PROTOCOL;
   @param[out]     ProfileBuffer     Profile buffer.\r
                       \r
   @return EFI_SUCCESS               Get the memory profile data successfully.\r
   @param[out]     ProfileBuffer     Profile buffer.\r
                       \r
   @return EFI_SUCCESS               Get the memory profile data successfully.\r
+  @return EFI_UNSUPPORTED           Memory profile is unsupported.\r
   @return EFI_BUFFER_TO_SMALL       The ProfileSize is too small for the resulting data. \r
                                     ProfileSize is updated with the size required.\r
 \r
   @return EFI_BUFFER_TO_SMALL       The ProfileSize is too small for the resulting data. \r
                                     ProfileSize is updated with the size required.\r
 \r
@@ -162,8 +238,10 @@ EFI_STATUS
   @param[in] ImageSize          Image size.\r
   @param[in] FileType           File type of the image.\r
 \r
   @param[in] ImageSize          Image size.\r
   @param[in] FileType           File type of the image.\r
 \r
-  @return EFI_SUCCESS           Register success.\r
-  @return EFI_OUT_OF_RESOURCE   No enough resource for this register.\r
+  @return EFI_SUCCESS           Register successfully.\r
+  @return EFI_UNSUPPORTED       Memory profile is unsupported,\r
+                                or memory profile for the image is not required.\r
+  @return EFI_OUT_OF_RESOURCES  No enough resource for this register.\r
 \r
 **/\r
 typedef\r
 \r
 **/\r
 typedef\r
@@ -184,7 +262,9 @@ EFI_STATUS
   @param[in] ImageBase          Image base address.\r
   @param[in] ImageSize          Image size.\r
 \r
   @param[in] ImageBase          Image base address.\r
   @param[in] ImageSize          Image size.\r
 \r
-  @return EFI_SUCCESS           Unregister success.\r
+  @return EFI_SUCCESS           Unregister successfully.\r
+  @return EFI_UNSUPPORTED       Memory profile is unsupported,\r
+                                or memory profile for the image is not required.\r
   @return EFI_NOT_FOUND         The image is not found.\r
 \r
 **/\r
   @return EFI_NOT_FOUND         The image is not found.\r
 \r
 **/\r
@@ -197,10 +277,86 @@ EFI_STATUS
   IN UINT64                             ImageSize\r
   );\r
 \r
   IN UINT64                             ImageSize\r
   );\r
 \r
+#define MEMORY_PROFILE_RECORDING_ENABLE     TRUE\r
+#define MEMORY_PROFILE_RECORDING_DISABLE    FALSE\r
+\r
+/**\r
+  Get memory profile recording state.\r
+\r
+  @param[in]  This              The EDKII_MEMORY_PROFILE_PROTOCOL instance.\r
+  @param[out] RecordingState    Recording state.\r
+\r
+  @return EFI_SUCCESS           Memory profile recording state is returned.\r
+  @return EFI_UNSUPPORTED       Memory profile is unsupported.\r
+  @return EFI_INVALID_PARAMETER RecordingState is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EDKII_MEMORY_PROFILE_GET_RECORDING_STATE) (\r
+  IN EDKII_MEMORY_PROFILE_PROTOCOL      *This,\r
+  OUT BOOLEAN                           *RecordingState\r
+  );\r
+\r
+/**\r
+  Set memory profile recording state.\r
+\r
+  @param[in] This               The EDKII_MEMORY_PROFILE_PROTOCOL instance.\r
+  @param[in] RecordingState     Recording state.\r
+\r
+  @return EFI_SUCCESS           Set memory profile recording state successfully.\r
+  @return EFI_UNSUPPORTED       Memory profile is unsupported.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EDKII_MEMORY_PROFILE_SET_RECORDING_STATE) (\r
+  IN EDKII_MEMORY_PROFILE_PROTOCOL      *This,\r
+  IN BOOLEAN                            RecordingState\r
+  );\r
+\r
+/**\r
+  Record memory profile of multilevel caller.\r
+\r
+  @param[in] This               The EDKII_MEMORY_PROFILE_PROTOCOL instance.\r
+  @param[in] CallerAddress      Address of caller.\r
+  @param[in] Action             Memory profile action.\r
+  @param[in] MemoryType         Memory type.\r
+                                EfiMaxMemoryType means the MemoryType is unknown.\r
+  @param[in] Buffer             Buffer address.\r
+  @param[in] Size               Buffer size.\r
+  @param[in] ActionString       String for memory profile action.\r
+                                Only needed for user defined allocate action.\r
+\r
+  @return EFI_SUCCESS           Memory profile is updated.\r
+  @return EFI_UNSUPPORTED       Memory profile is unsupported,\r
+                                or memory profile for the image is not required,\r
+                                or memory profile for the memory type is not required.\r
+  @return EFI_ACCESS_DENIED     It is during memory profile data getting.\r
+  @return EFI_ABORTED           Memory profile recording is not enabled.\r
+  @return EFI_OUT_OF_RESOURCES  No enough resource to update memory profile for allocate action.\r
+  @return EFI_NOT_FOUND         No matched allocate info found for free action.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EDKII_MEMORY_PROFILE_RECORD) (\r
+  IN EDKII_MEMORY_PROFILE_PROTOCOL      *This,\r
+  IN PHYSICAL_ADDRESS                   CallerAddress,\r
+  IN MEMORY_PROFILE_ACTION              Action,\r
+  IN EFI_MEMORY_TYPE                    MemoryType,\r
+  IN VOID                               *Buffer,\r
+  IN UINTN                              Size,\r
+  IN CHAR8                              *ActionString OPTIONAL\r
+  );\r
+\r
 struct _EDKII_MEMORY_PROFILE_PROTOCOL {\r
 struct _EDKII_MEMORY_PROFILE_PROTOCOL {\r
-  EDKII_MEMORY_PROFILE_GET_DATA         GetData;\r
-  EDKII_MEMORY_PROFILE_REGISTER_IMAGE   RegisterImage;\r
-  EDKII_MEMORY_PROFILE_UNREGISTER_IMAGE UnregisterImage;\r
+  EDKII_MEMORY_PROFILE_GET_DATA             GetData;\r
+  EDKII_MEMORY_PROFILE_REGISTER_IMAGE       RegisterImage;\r
+  EDKII_MEMORY_PROFILE_UNREGISTER_IMAGE     UnregisterImage;\r
+  EDKII_MEMORY_PROFILE_GET_RECORDING_STATE  GetRecordingState;\r
+  EDKII_MEMORY_PROFILE_SET_RECORDING_STATE  SetRecordingState;\r
+  EDKII_MEMORY_PROFILE_RECORD               Record;\r
 };\r
 \r
 //\r
 };\r
 \r
 //\r
@@ -246,6 +402,8 @@ struct _EDKII_MEMORY_PROFILE_PROTOCOL {
 #define SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE           0x4\r
 \r
 #define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET 0x5\r
 #define SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE           0x4\r
 \r
 #define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET 0x5\r
+#define SMRAM_PROFILE_COMMAND_GET_RECORDING_STATE        0x6\r
+#define SMRAM_PROFILE_COMMAND_SET_RECORDING_STATE        0x7\r
 \r
 typedef struct {\r
   UINT32                            Command;\r
 \r
 typedef struct {\r
   UINT32                            Command;\r
@@ -279,6 +437,11 @@ typedef struct {
   UINT64                            ProfileOffset;\r
 } SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA_BY_OFFSET;\r
 \r
   UINT64                            ProfileOffset;\r
 } SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA_BY_OFFSET;\r
 \r
+typedef struct {\r
+  SMRAM_PROFILE_PARAMETER_HEADER    Header;\r
+  BOOLEAN                           RecordingState;\r
+} SMRAM_PROFILE_PARAMETER_RECORDING_STATE;\r
+\r
 typedef struct {\r
   SMRAM_PROFILE_PARAMETER_HEADER    Header;\r
   EFI_GUID                          FileName;\r
 typedef struct {\r
   SMRAM_PROFILE_PARAMETER_HEADER    Header;\r
   EFI_GUID                          FileName;\r
@@ -295,10 +458,18 @@ typedef struct {
 \r
 \r
 #define EDKII_MEMORY_PROFILE_GUID { \\r
 \r
 \r
 #define EDKII_MEMORY_PROFILE_GUID { \\r
-  0x821c9a09, 0x541a, 0x40f6, 0x9f, 0x43, 0xa, 0xd1, 0x93, 0xa1, 0x2c, 0xfe \\r
+  0x821c9a09, 0x541a, 0x40f6, { 0x9f, 0x43, 0xa, 0xd1, 0x93, 0xa1, 0x2c, 0xfe } \\r
 }\r
 \r
 extern EFI_GUID gEdkiiMemoryProfileGuid;\r
 \r
 }\r
 \r
 extern EFI_GUID gEdkiiMemoryProfileGuid;\r
 \r
+typedef EDKII_MEMORY_PROFILE_PROTOCOL EDKII_SMM_MEMORY_PROFILE_PROTOCOL;\r
+\r
+#define EDKII_SMM_MEMORY_PROFILE_GUID { \\r
+  0xe22bbcca, 0x516a, 0x46a8, { 0x80, 0xe2, 0x67, 0x45, 0xe8, 0x36, 0x93, 0xbd } \\r
+}\r
+\r
+extern EFI_GUID gEdkiiSmmMemoryProfileGuid;\r
+\r
 #endif\r
 \r
 #endif\r
 \r
index 27efb378bde9ead04de16f088ebbcc7d2642bc54..9014635736061fd5e1198cf8feeea6a7ab7db1c5 100644 (file)
 \r
   ## Include/Guid/MemoryProfile.h\r
   gEdkiiMemoryProfileGuid              = { 0x821c9a09, 0x541a, 0x40f6, { 0x9f, 0x43, 0xa, 0xd1, 0x93, 0xa1, 0x2c, 0xfe }}\r
 \r
   ## Include/Guid/MemoryProfile.h\r
   gEdkiiMemoryProfileGuid              = { 0x821c9a09, 0x541a, 0x40f6, { 0x9f, 0x43, 0xa, 0xd1, 0x93, 0xa1, 0x2c, 0xfe }}\r
+  gEdkiiSmmMemoryProfileGuid           = { 0xe22bbcca, 0x516a, 0x46a8, { 0x80, 0xe2, 0x67, 0x45, 0xe8, 0x36, 0x93, 0xbd }}\r
 \r
   ## Include/Protocol/VarErrorFlag.h\r
   gEdkiiVarErrorFlagGuid               = { 0x4b37fe8, 0xf6ae, 0x480b, { 0xbd, 0xd5, 0x37, 0xd9, 0x8c, 0x5e, 0x89, 0xaa } }\r
 \r
   ## Include/Protocol/VarErrorFlag.h\r
   gEdkiiVarErrorFlagGuid               = { 0x4b37fe8, 0xf6ae, 0x480b, { 0xbd, 0xd5, 0x37, 0xd9, 0x8c, 0x5e, 0x89, 0xaa } }\r
   ## The mask is used to control memory profile behavior.<BR><BR>\r
   #  BIT0 - Enable UEFI memory profile.<BR>\r
   #  BIT1 - Enable SMRAM profile.<BR>\r
   ## The mask is used to control memory profile behavior.<BR><BR>\r
   #  BIT0 - Enable UEFI memory profile.<BR>\r
   #  BIT1 - Enable SMRAM profile.<BR>\r
+  #  BIT7 - Disable recording at the start.<BR>\r
   # @Prompt Memory Profile Property.\r
   # @Prompt Memory Profile Property.\r
-  # @Expression  0x80000002 | (gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfilePropertyMask & 0xFC) == 0\r
+  # @Expression  0x80000002 | (gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfilePropertyMask & 0x7C) == 0\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfilePropertyMask|0x0|UINT8|0x30001041\r
 \r
   ## This flag is to control which memory types of alloc info will be recorded by DxeCore & SmmCore.<BR><BR>\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfilePropertyMask|0x0|UINT8|0x30001041\r
 \r
   ## This flag is to control which memory types of alloc info will be recorded by DxeCore & SmmCore.<BR><BR>\r
   # @Prompt Memory profile memory type.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfileMemoryType|0x0|UINT64|0x30001042\r
 \r
   # @Prompt Memory profile memory type.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfileMemoryType|0x0|UINT64|0x30001042\r
 \r
+  ## This PCD is to control which drivers need memory profile data.<BR><BR>\r
+  # For example:<BR>\r
+  # One image only (Shell):<BR>\r
+  #     Header                    GUID<BR>\r
+  #     {0x04, 0x06, 0x14, 0x00,  0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1,<BR>\r
+  #      0x7F, 0xFF, 0x04, 0x00}<BR>\r
+  # Two or more images (Shell + WinNtSimpleFileSystem):<BR>\r
+  #     {0x04, 0x06, 0x14, 0x00,  0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1,<BR>\r
+  #      0x7F, 0x01, 0x04, 0x00,<BR>\r
+  #      0x04, 0x06, 0x14, 0x00,  0x8B, 0xE1, 0x25, 0x9C, 0xBA, 0x76, 0xDA, 0x43, 0xA1, 0x32, 0xDB, 0xB0, 0x99, 0x7C, 0xEF, 0xEF,<BR>\r
+  #      0x7F, 0xFF, 0x04, 0x00}<BR>\r
+  # @Prompt Memory profile driver path.\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfileDriverPath|{0x0}|VOID*|0x00001043\r
+\r
   ## PCI Serial Device Info. It is an array of Device, Function, and Power Management\r
   #  information that describes the path that contains zero or more PCI to PCI briges\r
   #  followed by a PCI serial device.  Each array entry is 4-bytes in length.  The\r
   ## PCI Serial Device Info. It is an array of Device, Function, and Power Management\r
   #  information that describes the path that contains zero or more PCI to PCI briges\r
   #  followed by a PCI serial device.  Each array entry is 4-bytes in length.  The\r
index f529dced6f0eac30fea48f772fa31e6f2103a108..1a5f24efbf3e18eff57df3e1ff861bc73de73734 100644 (file)
 \r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMemoryProfilePropertyMask_HELP  #language en-US "The mask is used to control memory profile behavior.<BR><BR>\n"\r
                                                                                            "BIT0 - Enable UEFI memory profile.<BR>\n"\r
 \r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMemoryProfilePropertyMask_HELP  #language en-US "The mask is used to control memory profile behavior.<BR><BR>\n"\r
                                                                                            "BIT0 - Enable UEFI memory profile.<BR>\n"\r
-                                                                                           "BIT1 - Enable SMRAM profile.<BR>"\r
+                                                                                           "BIT1 - Enable SMRAM profile.<BR>\n"\r
+                                                                                           "BIT7 - Disable recording at the start.<BR>"\r
 \r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMemoryProfileMemoryType_PROMPT  #language en-US "Memory profile memory type"\r
 \r
 \r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMemoryProfileMemoryType_PROMPT  #language en-US "Memory profile memory type"\r
 \r
                                                                                    " OS Reserved                0x80000000<BR>\n"\r
                                                                                    "e.g. Reserved+ACPINvs+ACPIReclaim+RuntimeCode+RuntimeData are needed, 0x661 should be used.<BR>\n"\r
 \r
                                                                                    " OS Reserved                0x80000000<BR>\n"\r
                                                                                    "e.g. Reserved+ACPINvs+ACPIReclaim+RuntimeCode+RuntimeData are needed, 0x661 should be used.<BR>\n"\r
 \r
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMemoryProfileDriverPath_PROMPT  #language en-US "Memory profile driver path"\r
+\r
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMemoryProfileDriverPath_HELP  #language en-US "This PCD is to control which drivers need memory profile data.<BR><BR>\n"\r
+                                                                                   "For example:<BR>\n"\r
+                                                                                   "One image only (Shell):<BR>\n"\r
+                                                                                   "    Header                    GUID<BR>\n"\r
+                                                                                   "    {0x04, 0x06, 0x14, 0x00,  0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1,<BR>\n"\r
+                                                                                   "     0x7F, 0xFF, 0x04, 0x00}<BR>\n"\r
+                                                                                   "Two or more images (Shell + WinNtSimpleFileSystem):<BR>\n"\r
+                                                                                   "    {0x04, 0x06, 0x14, 0x00,  0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1,<BR>\n"\r
+                                                                                   "     0x7F, 0x01, 0x04, 0x00,<BR>\n"\r
+                                                                                   "     0x04, 0x06, 0x14, 0x00,  0x8B, 0xE1, 0x25, 0x9C, 0xBA, 0x76, 0xDA, 0x43, 0xA1, 0x32, 0xDB, 0xB0, 0x99, 0x7C, 0xEF, 0xEF,<BR>\n"\r
+                                                                                   "     0x7F, 0xFF, 0x04, 0x00}<BR>\n"\r
+\r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialClockRate_PROMPT  #language en-US "Serial Port Clock Rate"\r
 \r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialClockRate_HELP  #language en-US "UART clock frequency is for the baud rate configuration."\r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialClockRate_PROMPT  #language en-US "Serial Port Clock Rate"\r
 \r
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialClockRate_HELP  #language en-US "UART clock frequency is for the baud rate configuration."\r