This patch adds support for recording BuildIds usng the sanitizer
ListOfModules API. We add another entry to the SegmentEntry struct and
change the memprof raw version.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
compiler-rt/include/profile/MemProfData.inc | ||
---|---|---|
58–59 | Do we need to record the size or can we just pad with zeros if less than the max? Is it ever not 32 in practice? Looks like it is defined to 32 in sanitizer_common.h. |
Looking into the regenerating the profiles for the PGOProfile tests.
compiler-rt/include/profile/MemProfData.inc | ||
---|---|---|
58–59 | I think we need it. In practice, we usually have 16 or 20 byte buildids [1] but they could be of arbitrary length if it's provided by the user rather than generated by the linker. Also the build id is a raw sequence of bytes. Padding with zeros is not enough to distinguish the length if the build id itself contains leading/trailing zero bytes. |
compiler-rt/include/profile/MemProfData.inc | ||
---|---|---|
58–59 | Ok got it. I thought sanitizer_common.h always used 32, but I now see another interface where it can be variable (but max of 32, which matches the handling here). |
Yes, I will rebase this patch once that is submitted. I need to look at the LLVM.Transforms/PGOProfile::memprof.ll test failures.
@tejohnson I've rebased the patch and updated the raw profiles for all the tests with the new version. Also added a new test for llvm-profdata to check the buildid we serialize in the raw profile. No changes to the code from prior diffs. PTAL, thanks!
Reopening since I missed the updates to the memprof unit tests in compiler-rt. This was caught by the buildbots. As part of the changes I modified the SerializeToRawProfile API slightly to make it easier to test. Also regenerated the raw profiles and binaries again since the runtime changed.
@tejohnson PTAL, thanks!
Do we need to record the size or can we just pad with zeros if less than the max? Is it ever not 32 in practice? Looks like it is defined to 32 in sanitizer_common.h.