|
LLVM 23.0.0git
|
Sample-based profile reader. More...
#include "llvm/ProfileData/SampleProfReader.h"
Classes | |
| class | iterator |
| iterator is a lightweight, self-contained input iterator designed to stream FunctionId symbols from either the memory-mapped file buffer (lazy loading from the FixedMD5 layout) or from an eagerly loaded vector of FunctionId objects (fallback). More... | |
Public Types | |
| using | const_iterator = iterator |
Public Member Functions | |
| SampleProfileNameTable ()=default | |
| void | clear () |
| void | setLazy (const uint8_t *S, size_t Sz) |
| Transitions the table to lazy-loading mode, pointing directly to a contiguous buffer of little-endian 64-bit MD5 hashes. | |
| std::vector< FunctionId > & | setToEager () |
| Transitions the table to eager-loading mode by clearing previous state and returning a mutable reference to the underlying vector for population. | |
| size_t | size () const |
| bool | empty () const |
| FunctionId | operator[] (size_t Idx) const |
| iterator | begin () const |
| iterator | end () const |
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:
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 352 of file SampleProfReader.h.
Definition at line 403 of file SampleProfReader.h.
|
default |
|
inline |
Definition at line 438 of file SampleProfReader.h.
References llvm::sampleprof::SampleProfileNameTable::iterator::UseLazy.
|
inline |
Definition at line 407 of file SampleProfReader.h.
Referenced by setLazy(), and setToEager().
|
inline |
Definition at line 429 of file SampleProfReader.h.
References size().
|
inline |
Definition at line 444 of file SampleProfReader.h.
References llvm::sampleprof::SampleProfileNameTable::iterator::UseLazy.
|
inline |
Definition at line 431 of file SampleProfReader.h.
Transitions the table to lazy-loading mode, pointing directly to a contiguous buffer of little-endian 64-bit MD5 hashes.
Definition at line 415 of file SampleProfReader.h.
References clear().
|
inline |
Transitions the table to eager-loading mode by clearing previous state and returning a mutable reference to the underlying vector for population.
Definition at line 423 of file SampleProfReader.h.
References clear().
|
inline |
Definition at line 428 of file SampleProfReader.h.
Referenced by empty(), and operator[]().