Extend the Frame struct to hold the symbol name if requested
when a RawMemProfReader object is constructed. This change updates the
tests and removes the need to pass --debug to obtain the mapping from
GUID to symbol names.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
PTAL, thanks!
llvm/lib/ProfileData/RawMemProfReader.cpp | ||
---|---|---|
419 | The idea here is to save memory by not duplicating the symbol names since we can have many unique frames (a combination of symbol + location). Also the processing does not require the symbol name today, so we only populate it in the iterator interface where a single MemProfRecord object is instantiated at a time. |
lgtm
llvm/lib/ProfileData/RawMemProfReader.cpp | ||
---|---|---|
419 | Another alternative, to avoid the repeated map lookups later on, is to make SymbolName a StringRef and keep a StringSet of the unique strings for ownership. |
Thanks for the review.
llvm/lib/ProfileData/RawMemProfReader.cpp | ||
---|---|---|
419 | While it would eliminate the map lookup, it would make it very easy to introduce lifetime issues, i.e. if the MemProfRecords outlive the RawMemProfReader the symbol name StringRef would be a dangling pointer. I'll leave it as is for now. |
"should not be serialized" (missing "be")