diff options
author | Star Zeng <star.zeng@intel.com> | 2016-06-18 09:03:20 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-07-01 09:39:55 +0800 |
commit | 1d60fe96422206d37e1d74198bb11b2cf6195157 (patch) | |
tree | 271e60f99c49b59bc0da18abfbff78a208f03ec9 /MdeModulePkg/Core/Dxe/Mem/Page.c | |
parent | 94092aa60341a3e4b1e1ea7c362781b8404ac538 (diff) | |
download | edk2-platforms-1d60fe96422206d37e1d74198bb11b2cf6195157.tar.xz |
MdeModulePkg DxeCore: Enhance memory profile for memory leak detection
1. Implement include GetRecordingState/SetRecordingState/Record for
memory profile protocol.
2. Consume PcdMemoryProfilePropertyMask to support disable recording
at the start.
3. Consume 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>
Diffstat (limited to 'MdeModulePkg/Core/Dxe/Mem/Page.c')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Mem/Page.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index 898b722a43..b02bafb4be 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -1335,7 +1335,14 @@ CoreAllocatePages ( Status = CoreInternalAllocatePages (Type, MemoryType, NumberOfPages, Memory);
if (!EFI_ERROR (Status)) {
- CoreUpdateProfile ((EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionAllocatePages, MemoryType, EFI_PAGES_TO_SIZE (NumberOfPages), (VOID *) (UINTN) *Memory);
+ CoreUpdateProfile (
+ (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0),
+ MemoryProfileActionAllocatePages,
+ MemoryType,
+ EFI_PAGES_TO_SIZE (NumberOfPages),
+ (VOID *) (UINTN) *Memory,
+ NULL
+ );
InstallMemoryAttributesTableOnMemoryAllocation (MemoryType);
}
return Status;
@@ -1444,7 +1451,14 @@ CoreFreePages ( Status = CoreInternalFreePages (Memory, NumberOfPages, &MemoryType);
if (!EFI_ERROR (Status)) {
- CoreUpdateProfile ((EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionFreePages, MemoryType, EFI_PAGES_TO_SIZE (NumberOfPages), (VOID *) (UINTN) Memory);
+ CoreUpdateProfile (
+ (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0),
+ MemoryProfileActionFreePages,
+ MemoryType,
+ EFI_PAGES_TO_SIZE (NumberOfPages),
+ (VOID *) (UINTN) Memory,
+ NULL
+ );
InstallMemoryAttributesTableOnMemoryAllocation (MemoryType);
}
return Status;
|