At 94092aa60341a3e4b1e1ea7c362781b8404ac538, we extended
MEMORY_PROFILE_ALLOC_INFO to add ActionStringOffset and
Reserved2[6] fields, that was not aware the Reserved[4]
field can be reused to have better memory profile database
size efficiency.

With the patch, PcdMemoryProfilePropertyMask|0x3 and
PcdMemoryProfileMemoryType|0xffff, the memory profile
database size can be reduced as below on my sample platform.

UefiMemoryProfileSize - 0x1597A8 -> UefiMemoryProfileSize - 0x12AB28
SmramProfileSize - 0xCF68 -> SmramProfileSize - 0xB8E8

Cc: Jiewen Yao <jiewen....@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.z...@intel.com>
---
 MdeModulePkg/Include/Guid/MemoryProfile.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Include/Guid/MemoryProfile.h 
b/MdeModulePkg/Include/Guid/MemoryProfile.h
index 38a64945e368..777f950db79a 100644
--- a/MdeModulePkg/Include/Guid/MemoryProfile.h
+++ b/MdeModulePkg/Include/Guid/MemoryProfile.h
@@ -146,13 +146,12 @@ typedef struct {
   MEMORY_PROFILE_COMMON_HEADER  Header;
   PHYSICAL_ADDRESS              CallerAddress;
   UINT32                        SequenceId;
-  UINT8                         Reserved[4];
+  UINT8                         Reserved[2];
+  UINT16                        ActionStringOffset;
   MEMORY_PROFILE_ACTION         Action;
   EFI_MEMORY_TYPE               MemoryType;
   PHYSICAL_ADDRESS              Buffer;
   UINT64                        Size;
-  UINT16                        ActionStringOffset;
-  UINT8                         Reserved2[6];
 //CHAR8                         ActionString[];
 } MEMORY_PROFILE_ALLOC_INFO;
 
-- 
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