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).

Cc: Jiewen Yao <jienwen....@intel.com>
Cc: Liming Gao <liming....@intel.com>
Cc: Yonghong Zhu <yonghong....@intel.com>

Star Zeng (10):
  MdeModulePkg: Extend memory profile definitions for memory leak
    detection
  MdeModulePkg DxeCore: Enhance memory profile for memory leak detection
  MdeModulePkg PiSmmCore: Enhance memory profile for memory leak
    detection
  MdeModulePkg MemoryProfileInfo: Enhance output info for memory leak
    detection
  MdeModulePkg: Introduce new library class MemoryProfileLib
  MdeModulePkg: Implement new library instance
    UefiMemoryAllocationProfileLib
  MdeModulePkg: Implement new library instance
    SmmMemoryAllocationProfileLib
  MdeModulePkg DxeCoreMemoryAllocationLib: Extend to support
    MemoryProfileLib
  MdeModulePkg PiSmmCoreMemoryAllocLib:  Extend to support
    MemoryProfileLib
  BaseTools Scripts: Add MemoryProfileSymbolGen.py

 BaseTools/Scripts/MemoryProfileSymbolGen.py        |  281 +++++
 .../MemoryProfileInfo/MemoryProfileInfo.c          |  788 +++++++++---
 .../MemoryProfileInfo/MemoryProfileInfo.inf        |    3 +-
 MdeModulePkg/Core/Dxe/DxeMain.h                    |   35 +-
 MdeModulePkg/Core/Dxe/DxeMain.inf                  |    1 +
 MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c    |  817 ++++++++----
 MdeModulePkg/Core/Dxe/Mem/Page.c                   |   18 +-
 MdeModulePkg/Core/Dxe/Mem/Pool.c                   |   18 +-
 MdeModulePkg/Core/PiSmmCore/Page.c                 |   20 +-
 MdeModulePkg/Core/PiSmmCore/PiSmmCore.c            |    3 +-
 MdeModulePkg/Core/PiSmmCore/PiSmmCore.h            |   57 +-
 MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf          |    6 +-
 MdeModulePkg/Core/PiSmmCore/Pool.c                 |   20 +-
 MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c   | 1331 +++++++++++++++-----
 MdeModulePkg/Include/Guid/MemoryProfile.h          |  189 ++-
 MdeModulePkg/Include/Library/MemoryProfileLib.h    |   53 +
 .../DxeCoreMemoryAllocationLib.inf                 |   15 +-
 .../DxeCoreMemoryAllocationLib.uni                 |   12 +-
 .../DxeCoreMemoryProfileLib.c                      |   57 +
 .../DxeCoreMemoryProfileServices.h                 |   54 +
 .../MemoryAllocationLib.c                          |  277 +++-
 .../MemoryAllocationLib.c                          |  188 ++-
 .../PiSmmCoreMemoryAllocationLib.inf               |   17 +-
 .../PiSmmCoreMemoryAllocationLib.uni               |   12 +-
 .../PiSmmCoreMemoryProfileLib.c                    |  123 ++
 .../PiSmmCoreMemoryProfileServices.h               |   54 +
 .../MemoryAllocationLib.c                          |  613 ++++++---
 .../SmmMemoryAllocationProfileLib.inf              |   62 +
 .../SmmMemoryAllocationProfileLib.uni              |   23 +
 .../SmmMemoryProfileLib.c                          |  143 +++
 .../DxeMemoryProfileLib.c                          |  102 ++
 .../MemoryAllocationLib.c                          |  312 ++++-
 .../UefiMemoryAllocationProfileLib.inf             |   53 +
 .../UefiMemoryAllocationProfileLib.uni             |   23 +
 MdeModulePkg/MdeModulePkg.dec                      |   20 +
 MdeModulePkg/MdeModulePkg.dsc                      |    2 +
 MdeModulePkg/MdeModulePkg.uni                      |   17 +-
 37 files changed, 4805 insertions(+), 1014 deletions(-)
 create mode 100644 BaseTools/Scripts/MemoryProfileSymbolGen.py
 create mode 100644 MdeModulePkg/Include/Library/MemoryProfileLib.h
 create mode 100644 
MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryProfileLib.c
 create mode 100644 
MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryProfileServices.h
 create mode 100644 
MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryProfileLib.c
 create mode 100644 
MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryProfileServices.h
 copy MdeModulePkg/Library/{PiSmmCoreMemoryAllocationLib => 
SmmMemoryAllocationProfileLib}/MemoryAllocationLib.c (55%)
 create mode 100644 
MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryAllocationProfileLib.inf
 create mode 100644 
MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryAllocationProfileLib.uni
 create mode 100644 
MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryProfileLib.c
 create mode 100644 
MdeModulePkg/Library/UefiMemoryAllocationProfileLib/DxeMemoryProfileLib.c
 copy MdeModulePkg/Library/{DxeCoreMemoryAllocationLib => 
UefiMemoryAllocationProfileLib}/MemoryAllocationLib.c (74%)
 create mode 100644 
MdeModulePkg/Library/UefiMemoryAllocationProfileLib/UefiMemoryAllocationProfileLib.inf
 create mode 100644 
MdeModulePkg/Library/UefiMemoryAllocationProfileLib/UefiMemoryAllocationProfileLib.uni

-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to