From 94092aa60341a3e4b1e1ea7c362781b8404ac538 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Tue, 31 May 2016 13:40:24 +0800 Subject: MdeModulePkg: Extend memory profile definitions for memory leak detection 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao --- MdeModulePkg/MdeModulePkg.uni | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'MdeModulePkg/MdeModulePkg.uni') diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni index f529dced6f..1a5f24efbf 100644 --- a/MdeModulePkg/MdeModulePkg.uni +++ b/MdeModulePkg/MdeModulePkg.uni @@ -266,7 +266,8 @@ #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMemoryProfilePropertyMask_HELP #language en-US "The mask is used to control memory profile behavior.

\n" "BIT0 - Enable UEFI memory profile.
\n" - "BIT1 - Enable SMRAM profile.
" + "BIT1 - Enable SMRAM profile.
\n" + "BIT7 - Disable recording at the start.
" #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMemoryProfileMemoryType_PROMPT #language en-US "Memory profile memory type" @@ -292,6 +293,20 @@ " OS Reserved 0x80000000
\n" "e.g. Reserved+ACPINvs+ACPIReclaim+RuntimeCode+RuntimeData are needed, 0x661 should be used.
\n" +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMemoryProfileDriverPath_PROMPT #language en-US "Memory profile driver path" + +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdMemoryProfileDriverPath_HELP #language en-US "This PCD is to control which drivers need memory profile data.

\n" + "For example:
\n" + "One image only (Shell):
\n" + " Header GUID
\n" + " {0x04, 0x06, 0x14, 0x00, 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1,
\n" + " 0x7F, 0xFF, 0x04, 0x00}
\n" + "Two or more images (Shell + WinNtSimpleFileSystem):
\n" + " {0x04, 0x06, 0x14, 0x00, 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1,
\n" + " 0x7F, 0x01, 0x04, 0x00,
\n" + " 0x04, 0x06, 0x14, 0x00, 0x8B, 0xE1, 0x25, 0x9C, 0xBA, 0x76, 0xDA, 0x43, 0xA1, 0x32, 0xDB, 0xB0, 0x99, 0x7C, 0xEF, 0xEF,
\n" + " 0x7F, 0xFF, 0x04, 0x00}
\n" + #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialClockRate_PROMPT #language en-US "Serial Port Clock Rate" #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialClockRate_HELP #language en-US "UART clock frequency is for the baud rate configuration." -- cgit v1.2.3