[llvm-branch-commits] [llvm-profgen] Support [buildid:]addr in unsymbolized profile context (PR #194205)
Amir Ayupov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Apr 25 22:49:14 PDT 2026
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/194205
Extend createCtxVectorFromStr with an optional FilterBuildID parameter
to handle [buildid:] prefixed address frames in unsymbolized profiles.
This enables a single multi-DSO unsymbolized profile file where profgen
is invoked N times with --filter-build-id=X against the same file.
Context format: [buildid:0xaddr1 @ buildid:0xaddr2 @ ...]
Ranges/branches remain plain hex — they inherit the DSO from the leaf
context frame.
createCtxVectorFromStr (SampleProf.h):
- Accept optional FilterBuildID parameter
- Strip matching buildid prefix, replace non-matching with 0x0
- Return bool: true if leaf frame buildid matches (internal)
readUnsymbolizedProfile (PerfReader.cpp):
- Pass BinaryBuildID to createCtxVectorFromStr
- Skip entire block (context + ranges + branches) when leaf is external
Test Plan:
filter-build-id-unsymbolized.test verifies:
- Matching buildid produces correct profile
- Non-matching buildid only processes its own contexts
- Backward compatibility with non-buildid unsymbolized profiles
More information about the llvm-branch-commits
mailing list