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:

protected Symtab

Method Overview

Inherited from InstrProfReader:

Methods

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)

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:288

Parameters

std::unique_ptr<MemoryBuffer> DataBuffer
const llvm::InstrProfCorrelator* Correlator

void advanceData()

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:362

bool atEnd() const

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:360

llvm::Error createSymtab(
    llvm::InstrProfSymtab& Symtab)

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:334

Parameters

llvm::InstrProfSymtab& Symtab

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

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:385

support::endianness getDataEndianness() const

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:342

llvm::StringRef getName(uint64_t NameRef) const

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:381

Parameters

uint64_t NameRef

const char* getNextHeaderPos() const

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:376

inline uint8_t getNumPaddingBytes(
    uint64_t SizeInBytes)

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:352

Parameters

uint64_t SizeInBytes

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()

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

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:305

static bool hasFormat(
    const llvm::MemoryBuffer& DataBuffer)

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:296

Parameters

const llvm::MemoryBuffer& DataBuffer

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

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:309

bool isIRLevelProfile() const

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:301

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::raw_ostream& OS

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)

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:336

Parameters

const RawInstrProf::Header& Header

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)

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:356

Parameters

llvm::NamedInstrProfRecord& Record

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)

Description

Read a single record.

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:298

Parameters

llvm::NamedInstrProfRecord& 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)

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:359

Parameters

llvm::InstrProfRecord& Record

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

Description

Return true if we must provide debug info to create PGO profiles.

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:313