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:610
Inherits from: SampleProfileReaderExtBinaryBase
Member Variables
Inherited from SampleProfileReaderExtBinaryBase:
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 SampleProfileReaderExtBinary(std::unique_ptr<MemoryBuffer> B, llvm::LLVMContext & C, llvm::sampleprof::SampleProfileFormat Format = SPF_Ext_Binary)
- public void collectFuncsFrom(const llvm::Module & M)
- public virtual std::unique_ptr<ProfileSymbolList> getProfileSymbolList()
- public static bool hasFormat(const llvm::MemoryBuffer & Buffer)
Inherited from SampleProfileReaderExtBinaryBase:
- public dumpSectionInfo
- public getFileSize
- public getSectionSize
- protected readHeader
- public readImpl
- protected readOneSection
- protected readSecHdrTable
- protected readSecHdrTableEntry
- 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 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
¶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:628
Parameters
- std::unique_ptr<MemoryBuffer> B
- llvm::LLVMContext& C
- llvm::sampleprof::SampleProfileFormat Format = SPF_Ext_Binary
¶void collectFuncsFrom(const llvm::Module& M)
void collectFuncsFrom(const llvm::Module& M)
Description
Collect functions with definitions in Module \p M.
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:640
Parameters
- const llvm::Module& M
¶virtual std::unique_ptr<ProfileSymbolList>
getProfileSymbolList()
virtual std::unique_ptr<ProfileSymbolList>
getProfileSymbolList()
Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:635
¶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:633
Parameters
- const llvm::MemoryBuffer& Buffer