diff options
author | Star Zeng <star.zeng@intel.com> | 2016-06-18 10:14:40 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-07-01 09:39:56 +0800 |
commit | e524f680647679ff7bf9b22dfba1dea4291a9cfe (patch) | |
tree | a8c03f77f7b374183a85ef1763dc046571dd30fd /MdeModulePkg/Core/PiSmmCore/Page.c | |
parent | c16b7fe71aa99d9bf27ca5d88e15274c39a7a559 (diff) | |
download | edk2-platforms-e524f680647679ff7bf9b22dfba1dea4291a9cfe.tar.xz |
MdeModulePkg PiSmmCore: Enhance memory profile for memory leak detection
1. Produce SMM 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/PiSmmCore/Page.c')
-rw-r--r-- | MdeModulePkg/Core/PiSmmCore/Page.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/MdeModulePkg/Core/PiSmmCore/Page.c b/MdeModulePkg/Core/PiSmmCore/Page.c index 9cc2a4cabc..5c04e8c8bf 100644 --- a/MdeModulePkg/Core/PiSmmCore/Page.c +++ b/MdeModulePkg/Core/PiSmmCore/Page.c @@ -1,7 +1,7 @@ /** @file
SMM Memory page management functions.
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
distribution. The full text of the license may be found at
@@ -226,7 +226,14 @@ SmmAllocatePages ( Status = SmmInternalAllocatePages (Type, MemoryType, NumberOfPages, Memory);
if (!EFI_ERROR (Status)) {
- SmmCoreUpdateProfile ((EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionAllocatePages, MemoryType, EFI_PAGES_TO_SIZE (NumberOfPages), (VOID *) (UINTN) *Memory);
+ SmmCoreUpdateProfile (
+ (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0),
+ MemoryProfileActionAllocatePages,
+ MemoryType,
+ EFI_PAGES_TO_SIZE (NumberOfPages),
+ (VOID *) (UINTN) *Memory,
+ NULL
+ );
}
return Status;
}
@@ -344,7 +351,14 @@ SmmFreePages ( Status = SmmInternalFreePages (Memory, NumberOfPages);
if (!EFI_ERROR (Status)) {
- SmmCoreUpdateProfile ((EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionFreePages, 0, EFI_PAGES_TO_SIZE (NumberOfPages), (VOID *) (UINTN) Memory);
+ SmmCoreUpdateProfile (
+ (EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0),
+ MemoryProfileActionFreePages,
+ EfiMaxMemoryType,
+ EFI_PAGES_TO_SIZE (NumberOfPages),
+ (VOID *) (UINTN) Memory,
+ NULL
+ );
}
return Status;
}
|