class RawInstrProfReader
Declaration
template <class IntPtrT>
class RawInstrProfReader : public InstrProfReader { /* full declaration omitted */ };
Description
Reader for the raw instrprof binary format from runtime. This format is a raw memory dump of the instrumentation-based profiling data from the runtime. It has no index. Templated on the unsigned type whose size matches pointers on the platform that wrote the profile.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:258
Inherits from: InstrProfReader
Templates
- IntPtrT
Member Variables
- private std::unique_ptr<MemoryBuffer> DataBuffer
- The profile data file contents.
- private const InstrProfCorrelatorImpl<IntPtrT>* Correlator
- If available, this hold the ProfileData array used to correlate raw instrumentation data to their functions.
- private bool ShouldSwapBytes
- private uint64_t Version
- private uint64_t CountersDelta
- private uint64_t NamesDelta
- private const RawInstrProf::ProfileData<IntPtrT>* Data
- private const RawInstrProf::ProfileData<IntPtrT>* DataEnd
- private const char* CountersStart
- private const char* CountersEnd
- private const char* NamesStart
- private const char* NamesEnd
- private const uint8_t* ValueDataStart
- private uint32_t ValueKindLast
- private uint32_t CurValueDataSize
- private uint64_t BinaryIdsSize
- private const uint8_t* BinaryIdsStart
Inherited from InstrProfReader:
Method Overview
- public RawInstrProfReader<IntPtrT>(const RawInstrProfReader<IntPtrT> &)
- public RawInstrProfReader<IntPtrT>(std::unique_ptr<MemoryBuffer> DataBuffer, const llvm::InstrProfCorrelator * Correlator)
- private void advanceData()
- private bool atEnd() const
- private llvm::Error createSymtab(llvm::InstrProfSymtab & Symtab)
- public bool functionEntryOnly() const
- private int getCounterTypeSize() const
- private support::endianness getDataEndianness() const
- private llvm::StringRef getName(uint64_t NameRef) const
- private const char * getNextHeaderPos() const
- private inline uint8_t getNumPaddingBytes(uint64_t SizeInBytes)
- public llvm::InstrProfKind getProfileKind() const
- public llvm::InstrProfSymtab & getSymtab()
- public bool hasCSIRLevelProfile() const
- public static bool hasFormat(const llvm::MemoryBuffer & DataBuffer)
- public bool hasSingleByteCoverage() const
- public bool instrEntryBBEnabled() const
- public bool isIRLevelProfile() const
- public llvm::Error printBinaryIds(llvm::raw_ostream & OS)
- private llvm::Error readFuncHash(llvm::NamedInstrProfRecord & Record)
- private llvm::Error readHeader(const RawInstrProf::Header & Header)
- public llvm::Error readHeader()
- private llvm::Error readName(llvm::NamedInstrProfRecord & Record)
- private llvm::Error readNextHeader(const char * CurrentPos)
- public llvm::Error readNextRecord(llvm::NamedInstrProfRecord & Record)
- private llvm::Error readRawCounts(llvm::InstrProfRecord & Record)
- private llvm::Error readValueProfilingData(llvm::InstrProfRecord & Record)
- private template <class IntT>IntT swap(IntT Int) const
- public bool useDebugInfoCorrelate() const
Inherited from InstrProfReader:
- public accumulateCounts
- public begin
- public create
- public create
- public end
- protected error
- protected error
- public functionEntryOnly
- public getError
- public getProfileKind
- public getSymtab
- public hasCSIRLevelProfile
- public hasError
- public hasSingleByteCoverage
- public instrEntryBBEnabled
- public isEOF
- public isIRLevelProfile
- public printBinaryIds
- public readHeader
- public readNextRecord
- protected success
- public useDebugInfoCorrelate
Methods
¶RawInstrProfReader<IntPtrT>(
const RawInstrProfReader<IntPtrT>&)
RawInstrProfReader<IntPtrT>(
const RawInstrProfReader<IntPtrT>&)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:293
Parameters
- const RawInstrProfReader<IntPtrT>&
¶RawInstrProfReader<IntPtrT>(
std::unique_ptr<MemoryBuffer> DataBuffer,
const llvm::InstrProfCorrelator* Correlator)
RawInstrProfReader<IntPtrT>(
std::unique_ptr<MemoryBuffer> DataBuffer,
const llvm::InstrProfCorrelator* Correlator)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:288
Parameters
- std::unique_ptr<MemoryBuffer> DataBuffer
- const llvm::InstrProfCorrelator* Correlator
¶void advanceData()
void advanceData()
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:362
¶bool atEnd() const
bool atEnd() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:360
¶llvm::Error createSymtab(
llvm::InstrProfSymtab& Symtab)
llvm::Error createSymtab(
llvm::InstrProfSymtab& Symtab)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:334
Parameters
- llvm::InstrProfSymtab& Symtab
¶bool functionEntryOnly() const
bool functionEntryOnly() const
Description
Return true if the profile only instruments function entries.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:321
¶int getCounterTypeSize() const
int getCounterTypeSize() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:385
¶support::endianness getDataEndianness() const
support::endianness getDataEndianness() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:342
¶llvm::StringRef getName(uint64_t NameRef) const
llvm::StringRef getName(uint64_t NameRef) const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:381
Parameters
- uint64_t NameRef
¶const char* getNextHeaderPos() const
const char* getNextHeaderPos() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:376
¶inline uint8_t getNumPaddingBytes(
uint64_t SizeInBytes)
inline uint8_t getNumPaddingBytes(
uint64_t SizeInBytes)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:352
Parameters
- uint64_t SizeInBytes
¶llvm::InstrProfKind getProfileKind() const
llvm::InstrProfKind getProfileKind() const
Description
Returns a BitsetEnum describing the attributes of the raw instr profile.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:326
¶llvm::InstrProfSymtab& getSymtab()
llvm::InstrProfSymtab& getSymtab()
Description
Return the PGO symtab. There are three different readers: Raw, Text, and Indexed profile readers. The first two types of readers are used only by llvm-profdata tool, while the indexed profile reader is also used by llvm-cov tool and the compiler ( backend or frontend). Since creating PGO symtab can create significant runtime and memory overhead (as it touches data for the whole program), InstrProfSymtab for the indexed profile reader should be created on demand and it is recommended to be only used for dumping purpose with llvm-proftool, not with the compiler.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:328
¶bool hasCSIRLevelProfile() const
bool hasCSIRLevelProfile() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:305
¶static bool hasFormat(
const llvm::MemoryBuffer& DataBuffer)
static bool hasFormat(
const llvm::MemoryBuffer& DataBuffer)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:296
Parameters
- const llvm::MemoryBuffer& DataBuffer
¶bool hasSingleByteCoverage() const
bool hasSingleByteCoverage() const
Description
Return true if the profile has single byte counters representing coverage.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:317
¶bool instrEntryBBEnabled() const
bool instrEntryBBEnabled() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:309
¶bool isIRLevelProfile() const
bool isIRLevelProfile() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:301
¶llvm::Error printBinaryIds(llvm::raw_ostream& OS)
llvm::Error printBinaryIds(llvm::raw_ostream& OS)
Description
Print binary ids on stream OS.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:299
Parameters
¶llvm::Error readFuncHash(
llvm::NamedInstrProfRecord& Record)
llvm::Error readFuncHash(
llvm::NamedInstrProfRecord& Record)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:357
Parameters
- llvm::NamedInstrProfRecord& Record
¶llvm::Error readHeader(
const RawInstrProf::Header& Header)
llvm::Error readHeader(
const RawInstrProf::Header& Header)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:336
Parameters
- const RawInstrProf::Header& Header
¶llvm::Error readHeader()
llvm::Error readHeader()
Description
Read the header. Required before reading first record.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:297
¶llvm::Error readName(
llvm::NamedInstrProfRecord& Record)
llvm::Error readName(
llvm::NamedInstrProfRecord& Record)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:356
Parameters
- llvm::NamedInstrProfRecord& Record
¶llvm::Error readNextHeader(const char* CurrentPos)
llvm::Error readNextHeader(const char* CurrentPos)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:335
Parameters
- const char* CurrentPos
¶llvm::Error readNextRecord(
llvm::NamedInstrProfRecord& Record)
llvm::Error readNextRecord(
llvm::NamedInstrProfRecord& Record)
Description
Read a single record.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:298
Parameters
- llvm::NamedInstrProfRecord& Record
¶llvm::Error readRawCounts(
llvm::InstrProfRecord& Record)
llvm::Error readRawCounts(
llvm::InstrProfRecord& Record)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:358
Parameters
- llvm::InstrProfRecord& Record
¶llvm::Error readValueProfilingData(
llvm::InstrProfRecord& Record)
llvm::Error readValueProfilingData(
llvm::InstrProfRecord& Record)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:359
Parameters
- llvm::InstrProfRecord& Record
¶template <class IntT>
IntT swap(IntT Int) const
template <class IntT>
IntT swap(IntT Int) const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:338
Templates
- IntT
Parameters
- IntT Int
¶bool useDebugInfoCorrelate() const
bool useDebugInfoCorrelate() const
Description
Return true if we must provide debug info to create PGO profiles.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:313