class SampleProfileWriterExtBinaryBase

Declaration

class SampleProfileWriterExtBinaryBase
    : public SampleProfileWriterBinary { /* full declaration omitted */ };

Description

Sample-based profile writer (binary format).

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:186

Inherits from: SampleProfileWriterBinary

Member Variables

protected llvm::sampleprof::SectionLayout SecLayout = DefaultLayout
protected SmallVector<llvm::sampleprof::SecHdrTableEntry, 8> SectionHdrLayout = ExtBinaryHdrLayoutTable[DefaultLayout]
protected uint64_t SecLBRProfileStart = 0
private std::unique_ptr<raw_ostream> LocalBufStream
private uint64_t FileStart
private uint64_t SecHdrTableOffset
private std::vector<SecHdrTableEntry> SecHdrTable
private MapVector<llvm::sampleprof::SampleContext, uint64_t> FuncOffsetTable
private bool UseMD5 = false
private MapVector<llvm::sampleprof::SampleContext, uint32_t> CSNameTable
CSNameTable maps function context to its offset in SecCSNameTable section. The offset will be used everywhere where the context is referenced.
private llvm::sampleprof::ProfileSymbolList* ProfSymList = nullptr

Inherited from SampleProfileWriterBinary:

protected NameTable

Inherited from SampleProfileWriter:

protected OutputStream
protected Summary
protected Format = SPF_None

Method Overview

Inherited from SampleProfileWriterBinary:

Inherited from SampleProfileWriter:

Methods

void addContext(
    const llvm::sampleprof::SampleContext&
        Context)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:244

Parameters

const llvm::sampleprof::SampleContext& Context

std::error_code addNewSection(
    llvm::sampleprof::SecType Sec,
    uint32_t LayoutIdx,
    uint64_t SectionStart)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:230

Parameters

llvm::sampleprof::SecType Sec
uint32_t LayoutIdx
uint64_t SectionStart

template <class SecFlagType>
void addSectionFlag(uint32_t SectionIdx,
                    SecFlagType Flag)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:240

Templates

SecFlagType

Parameters

uint32_t SectionIdx
SecFlagType Flag

template <class SecFlagType>
void addSectionFlag(
    llvm::sampleprof::SecType Type,
    SecFlagType Flag)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:233

Templates

SecFlagType

Parameters

llvm::sampleprof::SecType Type
SecFlagType Flag

void allocSecHdrTable()

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:287

std::error_code compressAndOutput()

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:290

uint64_t markSectionStart(
    llvm::sampleprof::SecType Type,
    uint32_t LayoutIdx)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:229

Parameters

llvm::sampleprof::SecType Type
uint32_t LayoutIdx

void resetSecLayout(
    llvm::sampleprof::SectionLayout SL)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:215

Parameters

llvm::sampleprof::SectionLayout SL

void setPartialProfile()

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:207

void setProfileSymbolList(
    llvm::sampleprof::ProfileSymbolList* PSL)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:211

Parameters

llvm::sampleprof::ProfileSymbolList* PSL

void setToCompressAllSections()

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:191

void setToCompressSection(
    llvm::sampleprof::SecType Type)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:192

Parameters

llvm::sampleprof::SecType Type

void setUseMD5()

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:196

virtual void verifySecLayout(
    llvm::sampleprof::SectionLayout SL)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:249

Parameters

llvm::sampleprof::SectionLayout SL

std::error_code write(
    const llvm::sampleprof::SampleProfileMap&
        ProfileMap)

Description

Write all the sample profiles in the given map of samples.

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:189

Parameters

const llvm::sampleprof::SampleProfileMap& ProfileMap

Returns

status code of the file update operation.

std::error_code writeCSNameIdx(
    const llvm::sampleprof::SampleContext&
        Context)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:262

Parameters

const llvm::sampleprof::SampleContext& Context

std::error_code writeCSNameTableSection()

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:263

std::error_code writeContextIdx(
    const llvm::sampleprof::SampleContext&
        Context)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:261

Parameters

const llvm::sampleprof::SampleContext& Context

virtual std::error_code writeCustomSection(
    llvm::sampleprof::SecType Type)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:247

Parameters

llvm::sampleprof::SecType Type

std::error_code writeFuncMetadata(
    const llvm::sampleprof::SampleProfileMap&
        Profiles)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:265

Parameters

const llvm::sampleprof::SampleProfileMap& Profiles

std::error_code writeFuncMetadata(
    const llvm::sampleprof::FunctionSamples&
        Profile)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:266

Parameters

const llvm::sampleprof::FunctionSamples& Profile

std::error_code writeFuncOffsetTable()

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:270

std::error_code writeHeader(
    const llvm::sampleprof::SampleProfileMap&
        ProfileMap)

Description

Write a file header for the profile file.

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:289

Parameters

const llvm::sampleprof::SampleProfileMap& ProfileMap

std::error_code writeNameTable()

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:260

std::error_code writeNameTableSection(
    const llvm::sampleprof::SampleProfileMap&
        ProfileMap)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:269

Parameters

const llvm::sampleprof::SampleProfileMap& ProfileMap

virtual std::error_code writeOneSection(
    llvm::sampleprof::SecType Type,
    uint32_t LayoutIdx,
    const llvm::sampleprof::SampleProfileMap&
        ProfileMap)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:256

Parameters

llvm::sampleprof::SecType Type
uint32_t LayoutIdx
const llvm::sampleprof::SampleProfileMap& ProfileMap

std::error_code writeProfileSymbolListSection()

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:271

std::error_code writeSample(
    const llvm::sampleprof::FunctionSamples& S)

Description

Write sample profiles in \p S.

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:193

Parameters

const llvm::sampleprof::FunctionSamples& S

Returns

status code of the file update operation.

std::error_code writeSecHdrTable()

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

virtual std::error_code writeSections(
    const llvm::sampleprof::SampleProfileMap&
        ProfileMap)

Declared at: llvm/include/llvm/ProfileData/SampleProfWriter.h:252

Parameters

const llvm::sampleprof::SampleProfileMap& ProfileMap