llvm-project/llvm/tools/llvm-profgen
Hongtao Yu 3f97016857 [llvm-profgen] Decoding pseudo probe for profiled function only.
Complete pseudo probes decoding can result in large memory usage. In practice only a small porting of the decoded probes are used in profile generation. I'm changing the full decoding mode to be decoding for profiled functions only, though we still do a full scan of the .pseudoprobe section due to a missing table-of-content but we don't have to build the in-memory data structure for functions not sampled.

To build the in-memory data structure for profiled functions only, I'm rewriting the previous non-recursive probe decoding logic to be recursive. This is easy to read and maintain.

I also have to change the previous representation of unsymbolized context from probe-based stack to address-based stack since the profiled functions are unknown yet by the time of virtual unwinding. The address-based stack will be converted to probe-based stack after virtual unwinding and on-demand probe decoding.

I'm seeing 20GB memory is saved for one of our internal large service.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D121643
2022-03-23 14:15:11 -07:00
..
CMakeLists.txt [llvm-profgen] Switch to DWARF-based symbol and ranges 2021-10-29 09:59:12 -07:00
CSPreInliner.cpp Cleanup include: DebugInfo/Symbolize 2022-02-24 13:25:11 +01:00
CSPreInliner.h [CSSPGO] Split context string to deduplicate function name used in the context. 2021-08-30 20:09:29 -07:00
CallContext.h [CSSPGO] Rename the field of SampleContextFrame 2021-10-04 19:06:59 -07:00
ErrorHandling.h [llvm-profgen] Fix bug of setting function entry 2021-11-12 12:18:43 -08:00
PerfReader.cpp [llvm-profgen] Decoding pseudo probe for profiled function only. 2022-03-23 14:15:11 -07:00
PerfReader.h [llvm-profgen] Decoding pseudo probe for profiled function only. 2022-03-23 14:15:11 -07:00
ProfileGenerator.cpp [llvm-profgen] Decoding pseudo probe for profiled function only. 2022-03-23 14:15:11 -07:00
ProfileGenerator.h [llvm-profgen] Decoding pseudo probe for profiled function only. 2022-03-23 14:15:11 -07:00
ProfiledBinary.cpp [llvm-profgen] Decoding pseudo probe for profiled function only. 2022-03-23 14:15:11 -07:00
ProfiledBinary.h [llvm-profgen] Decoding pseudo probe for profiled function only. 2022-03-23 14:15:11 -07:00
llvm-profgen.cpp Cleanup include: DebugInfo/Symbolize 2022-02-24 13:25:11 +01:00