class SampleProfileReaderExtBinary
Declaration
class SampleProfileReaderExtBinary
: public SampleProfileReaderExtBinaryBase { /* full declaration omitted */ };
Description
SampleProfileReaderExtBinaryBase/SampleProfileWriterExtBinaryBase defines the basic structure of the extensible binary format. The format is organized in sections except the magic and version number at the beginning. There is a section table before all the sections, and each entry in the table describes the entry type, start, size and attributes. The format in each section is defined by the section itself. It is easy to add a new section while maintaining the backward compatibility of the profile. Nothing extra needs to be done. If we want to extend an existing section, like add cache misses information in addition to the sample count in the profile body, we can add a new section with the extension and retire the existing section, and we could choose to keep the parser of the old section if we want the reader to be able to read both new and old format profile. SampleProfileReaderExtBinary/SampleProfileWriterExtBinary define the commonly used sections of a profile in extensible binary format. It is possible to define other types of profile inherited from SampleProfileReaderExtBinaryBase/SampleProfileWriterExtBinaryBase.
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:789
Inherits from: SampleProfileReaderExtBinaryBase
Member Variables
Inherited from SampleProfileReaderExtBinaryBase:
- protected SecHdrTable
- protected ProfSymList
- protected FuncOffsetTable
- protected OrderedFuncOffsets
- protected FuncsToUse
- protected FixedLengthMD5 = false
- protected MD5NameMemStart = nullptr
- protected MD5StringBuf
- protected CSNameTable
- protected SkipFlatProf = false
- protected FuncOffsetsOrdered = false
Inherited from SampleProfileReaderBinary:
- protected Data = nullptr
- protected End = nullptr
- protected NameTable
Inherited from SampleProfileReader:
- protected Profiles
- protected Ctx
- protected Buffer
- protected MD5NameBuffer
- protected Summary
- protected Remapper
- protected ProfileIsProbeBased = false
- protected ProfileIsCS = false
- protected ProfileIsPreInlined = false
- protected CSProfileCount = 0
- protected ProfileIsFS = false
- protected Format = SPF_None
- protected M = nullptr
- protected MaskedBitFrom = 31
Method Overview
- public SampleProfileReaderExtBinary(std::unique_ptr<MemoryBuffer> B, llvm::LLVMContext & C, llvm::sampleprof::SampleProfileFormat Format = SPF_Ext_Binary)
- public static bool hasFormat(const llvm::MemoryBuffer & Buffer)
- private std::error_code readCustomSection(const llvm::sampleprof::SecHdrTableEntry & Entry)
- private std::error_code verifySPMagic(uint64_t Magic)
Inherited from SampleProfileReaderExtBinaryBase:
- public collectFuncsFromModule
- public dumpSectionInfo
- public getFileSize
- public getProfileSymbolList
- public getSectionSize
- protected readCSNameTableSec
- protected readContextFromTable
- protected readCustomSection
- protected readFuncMetadata
- protected readFuncMetadata
- protected readFuncOffsetTable
- protected readFuncProfiles
- protected readHeader
- public readImpl
- protected readMD5NameTable
- protected readNameTableSec
- protected readOneSection
- protected readProfileSymbolList
- protected readSampleContextFromTable
- protected readSecHdrTable
- protected readSecHdrTableEntry
- protected readStringFromTable
- public setSkipFlatProf
- public useMD5
- protected verifySPMagic
Inherited from SampleProfileReaderBinary:
- protected at_eof
- public getNameTable
- protected readFuncProfile
- public readHeader
- public readImpl
- protected readMagicIdent
- protected readNameTable
- protected readNumber
- protected readProfile
- protected readSampleContextFromTable
- protected readString
- protected readStringFromTable
- protected readStringIndex
- protected readSummary
- protected readUnencodedNumber
Inherited from SampleProfileReader:
- public collectFuncsFromModule
- protected computeSummary
- public create
- public create
- public dump
- public dumpFunctionProfile
- public dumpSectionInfo
- public getBuffer
- public getDiscriminatorMask
- public getFormat
- public getNameTable
- public getOrCreateSamplesFor
- public getProfileSymbolList
- public getProfiles
- public getRemapper
- public getSamplesFor
- public getSamplesFor
- public getSummary
- public hasUniqSuffix
- public profileIsCS
- public profileIsPreInlined
- public profileIsProbeBased
- public read
- public readHeader
- public readImpl
- public reportError
- public setDiscriminatorMaskedBitFrom
- public setModule
- public setSkipFlatProf
- protected takeSummary
- public useMD5
Methods
¶SampleProfileReaderExtBinary(
std::unique_ptr<MemoryBuffer> B,
llvm::LLVMContext& C,
llvm::sampleprof::SampleProfileFormat Format =
SPF_Ext_Binary)
SampleProfileReaderExtBinary(
std::unique_ptr<MemoryBuffer> B,
llvm::LLVMContext& C,
llvm::sampleprof::SampleProfileFormat Format =
SPF_Ext_Binary)
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:799
Parameters
- std::unique_ptr<MemoryBuffer> B
- llvm::LLVMContext& C
- llvm::sampleprof::SampleProfileFormat Format = SPF_Ext_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:804
Parameters
- const llvm::MemoryBuffer& Buffer
¶std::error_code readCustomSection(
const llvm::sampleprof::SecHdrTableEntry&
Entry)
std::error_code readCustomSection(
const llvm::sampleprof::SecHdrTableEntry&
Entry)
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:792
Parameters
- const llvm::sampleprof::SecHdrTableEntry& Entry
¶std::error_code verifySPMagic(uint64_t Magic)
std::error_code verifySPMagic(uint64_t Magic)
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:791
Parameters
- uint64_t Magic