Sample-based profile reader.
Each profile contains sample counts for all the functions executed. Inside each function, statements are annotated with the collected samples on all the instructions associated with that statement.
For this to produce meaningful data, the program needs to be compiled with some debug information (at minimum, line numbers: -gline-tables-only). Otherwise, it will be impossible to match IR instructions to the line numbers collected by the profiler.
From the profile file, we are interested in collecting the following information:
- A list of functions included in the profile (mangled names).
- For each function F:
- The total number of samples collected in F.
- The samples collected at each line in F. To provide some protection against source code shuffling, line numbers should be relative to the start of the function.
The reader supports two file formats: text and binary. The text format is useful for debugging and testing, while the binary format is more compact and I/O efficient. They can both be used interchangeably. Manages the sample profile name table, supporting both an eagerly loaded std::vector of FunctionId objects and lazy-loaded MD5 hashes read directly from the memory-mapped buffer. It enforces the exclusivity of these two formats and provides a unified read-only container interface.
Definition at line 353 of file SampleProfReader.h.