Re: Possibly incorrect size in memory profile structure
Not sure I can understand your question correctly. But try best to recall and comment since not on it for long time. 😊toggle quoted messageShow quoted text
,  and  are all for interior storage management by MEMORY_PROFILE_DRIVER_INFO_DATA, MEMORY_PROFILE_DRIVER_INFO_DATA.PdbString points to the PDB string.
Exterior storage are managed by ProfileProtocolGetData() and MemoryProfileCopyData() from interior storage, 8B alignment are for exterior storage, PDB string is at the end of MEMORY_PROFILE_DRIVER_INFO structure.
From: firstname.lastname@example.org <email@example.com> On Behalf Of Marvin Häuser
Sent: 2021年6月19日 18:56
To: Zeng, Star <firstname.lastname@example.org>; Yao, Jiewen <email@example.com>; firstname.lastname@example.org
Subject: [edk2-devel] Possibly incorrect size in memory profile structure
I have a question regarding a part of the memory profiling code. Namely this piece of code  introduced storing the PDB file name among the driver information. This is implement by a string pointer in the "MEMORY_PROFILE_DRIVER_INFO_DATA" structure (which embeds the "MEMORY_PROFILE_DRIVER_INFO" structure ). The length of the embedded "MEMORY_PROFILE_DRIVER_INFO" instance is set to the header size plus the 8B-aligned size of the PDB name , albeit its storage is not used for the PDB file name, and the storage that is used instead is not aligned by 8B . Ominously, the interior structure does have a comment that indicates it is (or was) supposed to hold the PDB file name at some point .
I do not see that concept being used, and instead see the previously described way of storage, so I believe the aligned size is a forgotten piece from a refactoring. I imagine early on, the interior structure was supposed to hold the PDB name, and the alignment was needed to satisfy the following data's requirements. However, the change to the exterior storage should make this superfluous, and the specified size seems to be incorrect in all cases.
Can you please give this a quick look and help me determine whether this is a bug? Thank you for your time!