class SampleProfileReaderExtBinaryBase
Declaration
class SampleProfileReaderExtBinaryBase
: public SampleProfileReaderBinary { /* 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:576
Inherits from: SampleProfileReaderBinary
Member Variables
- protected std::vector<SecHdrTableEntry> SecHdrTable
- protected std::unique_ptr<ProfileSymbolList> ProfSymList
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 SampleProfileReaderExtBinaryBase(std::unique_ptr<MemoryBuffer> B, llvm::LLVMContext & C, llvm::sampleprof::SampleProfileFormat Format)
- public virtual bool dumpSectionInfo(llvm::raw_ostream & OS = dbgs())
- public uint64_t getFileSize()
- public uint64_t getSectionSize(llvm::sampleprof::SecType Type)
- protected virtual std::error_code readHeader()
- public std::error_code readImpl()
- protected virtual std::error_code readOneSection(const uint8_t * Start, uint64_t Size, llvm::sampleprof::SecType Type)
- protected std::error_code readSecHdrTable()
- protected std::error_code readSecHdrTableEntry()
- protected virtual std::error_code verifySPMagic(uint64_t Magic)
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
¶SampleProfileReaderExtBinaryBase(
std::unique_ptr<MemoryBuffer> B,
llvm::LLVMContext& C,
llvm::sampleprof::SampleProfileFormat Format)
SampleProfileReaderExtBinaryBase(
std::unique_ptr<MemoryBuffer> B,
llvm::LLVMContext& C,
llvm::sampleprof::SampleProfileFormat Format)
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:596
Parameters
- std::unique_ptr<MemoryBuffer> B
- llvm::LLVMContext& C
- llvm::sampleprof::SampleProfileFormat Format
¶virtual bool dumpSectionInfo(
llvm::raw_ostream& OS = dbgs())
virtual bool dumpSectionInfo(
llvm::raw_ostream& OS = dbgs())
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:607
Parameters
- llvm::raw_ostream& OS = dbgs()
¶uint64_t getFileSize()
uint64_t getFileSize()
Description
Get the total size of header and all sections.
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:606
¶uint64_t getSectionSize(
llvm::sampleprof::SecType Type)
uint64_t getSectionSize(
llvm::sampleprof::SecType Type)
Description
Get the total size of all \p Type sections.
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:604
Parameters
- llvm::sampleprof::SecType Type
¶virtual std::error_code readHeader()
virtual std::error_code readHeader()
Description
Read and validate the file header.
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:590
¶std::error_code readImpl()
std::error_code readImpl()
Description
Read sample profiles in extensible format from the associated file.
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:601
¶virtual std::error_code readOneSection(
const uint8_t* Start,
uint64_t Size,
llvm::sampleprof::SecType Type)
virtual std::error_code readOneSection(
const uint8_t* Start,
uint64_t Size,
llvm::sampleprof::SecType Type)
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:592
Parameters
- const uint8_t* Start
- uint64_t Size
- llvm::sampleprof::SecType Type
¶std::error_code readSecHdrTable()
std::error_code readSecHdrTable()
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:589
¶std::error_code readSecHdrTableEntry()
std::error_code readSecHdrTableEntry()
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:588
¶virtual std::error_code verifySPMagic(
uint64_t Magic)
virtual std::error_code verifySPMagic(
uint64_t Magic)
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:591
Parameters
- uint64_t Magic