class SampleProfileReaderRawBinary
Declaration
class SampleProfileReaderRawBinary : public SampleProfileReaderBinary { /* full declaration omitted */ };
Description
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: 1. The total number of samples collected in F. 2. 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.
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:544
Inherits from: SampleProfileReaderBinary
Member Variables
Inherited from SampleProfileReaderBinary:
- protected Data = nullptr
- protected End = nullptr
- protected NameTable
Inherited from SampleProfileReader:
- protected Profiles
- protected Ctx
- protected Buffer
- protected Summary
- protected Remapper
- protected Format = SPF_None
Method Overview
- public SampleProfileReaderRawBinary(std::unique_ptr<MemoryBuffer> B, llvm::LLVMContext & C, llvm::sampleprof::SampleProfileFormat Format = SPF_Binary)
- public static bool hasFormat(const llvm::MemoryBuffer & Buffer)
Inherited from SampleProfileReaderBinary:
- protected at_eof
- public getNameTable
- protected readFuncProfile
- public readHeader
- public readImpl
- protected readMagicIdent
- protected readNameTable
- protected readNumber
- protected readProfile
- protected readString
- protected readStringFromTable
- protected readStringIndex
- protected readSummary
- protected readUnencodedNumber
Inherited from SampleProfileReader:
- public collectFuncsFrom
- protected computeSummary
- public create
- public create
- public dump
- public dumpFunctionProfile
- public dumpSectionInfo
- public getBuffer
- public getFormat
- public getNameTable
- public getOrCreateSamplesFor
- public getProfileSymbolList
- public getProfiles
- public getSamplesFor
- public getSamplesFor
- public getSummary
- public read
- public readHeader
- public readImpl
- public reportError
- protected takeSummary
Methods
¶SampleProfileReaderRawBinary(
std::unique_ptr<MemoryBuffer> B,
llvm::LLVMContext& C,
llvm::sampleprof::SampleProfileFormat Format =
SPF_Binary)
SampleProfileReaderRawBinary(
std::unique_ptr<MemoryBuffer> B,
llvm::LLVMContext& C,
llvm::sampleprof::SampleProfileFormat Format =
SPF_Binary)
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:549
Parameters
- std::unique_ptr<MemoryBuffer> B
- llvm::LLVMContext& C
- llvm::sampleprof::SampleProfileFormat Format = SPF_Binary
¶static bool hasFormat(
const llvm::MemoryBuffer& Buffer)
static bool hasFormat(
const llvm::MemoryBuffer& Buffer)
Description
Return true if \p Buffer is in the format supported by this class.
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:554
Parameters
- const llvm::MemoryBuffer& Buffer