Some tests with binary IDs would fail with error: no profile can be merged. This is because raw profiles could have unaligned headers when emitting binary IDs. This means padding should be emitted after binary IDs are emitted to ensure everything else is aligned. This patch accounts for that padding in __llvm_write_binary_ids.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
compiler-rt/lib/profile/InstrProfilingPlatformLinux.c | ||
---|---|---|
171 | Since WriteBinaryIds isn't used from anywhere else, I'd just combine the two functions. |
Thanks for the fix @leonardchan
Other type of paddings are added in:
https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/profile/InstrProfilingBuffer.c#L86
Do you think we can follow the same pattern?
That could work, but I think that would mean needing to call __llvm_profile_get_padding_sizes_for_counters after each instance we call __llvm_write_binary_ids when we instead could just pack it in __llvm_write_binary_ids. I imagine this is much simpler.
This appears to have broken PPC bots:
https://lab.llvm.org/buildbot/#/builders/105/builds/15291
https://lab.llvm.org/buildbot/#/builders/121/builds/11749
If you don't have an easy fix, please revert.
I have a fix up at https://reviews.llvm.org/D110365 but it looks like it's not ready to land yet. Feel free to revert it now if you can. I'm not at my keyboard right now.
clang-format: please reformat the code