LLVM
17.0.0git
|
#include "llvm/ProfileData/SampleProfWriter.h"
Public Member Functions | |
std::error_code | writeSample (const FunctionSamples &S) override |
Write samples of a top-level function to a binary file. More... | |
std::error_code | write (const SampleProfileMap &ProfileMap) override |
Write all the sample profiles in the given map of samples. More... | |
![]() | |
SampleProfileWriterBinary (std::unique_ptr< raw_ostream > &OS) | |
![]() | |
virtual | ~SampleProfileWriter ()=default |
raw_ostream & | getOutputStream () |
virtual void | setProfileSymbolList (ProfileSymbolList *PSL) |
virtual void | setToCompressAllSections () |
virtual void | setUseMD5 () |
virtual void | setPartialProfile () |
virtual void | resetSecLayout (SectionLayout SL) |
Protected Member Functions | |
std::error_code | writeNameTable () override |
std::error_code | writeHeader (const SampleProfileMap &ProfileMap) override |
Write a file header for the profile file. More... | |
std::error_code | writeFuncOffsetTable () |
![]() | |
virtual MapVector< StringRef, uint32_t > & | getNameTable () |
virtual std::error_code | writeMagicIdent (SampleProfileFormat Format) |
std::error_code | writeSummary () |
virtual std::error_code | writeContextIdx (const SampleContext &Context) |
std::error_code | writeNameIdx (StringRef FName) |
std::error_code | writeBody (const FunctionSamples &S) |
void | stablizeNameTable (MapVector< StringRef, uint32_t > &NameTable, std::set< StringRef > &V) |
void | addName (StringRef FName) |
virtual void | addContext (const SampleContext &Context) |
void | addNames (const FunctionSamples &S) |
![]() | |
SampleProfileWriter (std::unique_ptr< raw_ostream > &OS) | |
virtual std::error_code | writeFuncProfiles (const SampleProfileMap &ProfileMap) |
void | computeSummary (const SampleProfileMap &ProfileMap) |
Compute summary for this profile. More... | |
Protected Attributes | |
MapVector< StringRef, uint64_t > | FuncOffsetTable |
The table mapping from function name to the offset of its FunctionSample towards profile start. More... | |
uint64_t | TableOffset |
The offset of the slot to be filled with the offset of FuncOffsetTable towards profile start. More... | |
![]() | |
MapVector< StringRef, uint32_t > | NameTable |
![]() | |
std::unique_ptr< raw_ostream > | OutputStream |
Output stream where to emit the profile to. More... | |
std::unique_ptr< ProfileSummary > | Summary |
Profile summary. More... | |
SampleProfileFormat | Format = SPF_None |
Profile format. More... | |
Additional Inherited Members | |
![]() | |
static ErrorOr< std::unique_ptr< SampleProfileWriter > > | create (StringRef Filename, SampleProfileFormat Format) |
Profile writer factory. More... | |
static ErrorOr< std::unique_ptr< SampleProfileWriter > > | create (std::unique_ptr< raw_ostream > &OS, SampleProfileFormat Format) |
Create a new stream writer based on the value of Format . More... | |
Definition at line 376 of file SampleProfWriter.h.
|
overridevirtual |
Write all the sample profiles in the given map of samples.
Reimplemented from llvm::sampleprof::SampleProfileWriter.
Definition at line 454 of file SampleProfWriter.cpp.
References llvm::success, llvm::sampleprof::SampleProfileWriter::write(), and writeFuncOffsetTable().
|
protected |
Definition at line 604 of file SampleProfWriter.cpp.
References llvm::encodeULEB128(), FuncOffsetTable, llvm::support::little, llvm::ostream_seek_unsupported, llvm::sampleprof::SampleProfileWriter::OutputStream, TableOffset, and llvm::support::endian::Writer::write().
Referenced by write().
|
overrideprotectedvirtual |
Write a file header for the profile file.
Reimplemented from llvm::sampleprof::SampleProfileWriterBinary.
Definition at line 745 of file SampleProfWriter.cpp.
References llvm::support::little, llvm::sampleprof::SampleProfileWriter::OutputStream, llvm::success, TableOffset, llvm::support::endian::Writer::write(), and llvm::sampleprof::SampleProfileWriterBinary::writeHeader().
|
overrideprotectedvirtual |
Reimplemented from llvm::sampleprof::SampleProfileWriterBinary.
Definition at line 629 of file SampleProfWriter.cpp.
References llvm::encodeULEB128(), llvm::MD5Hash(), N, llvm::sampleprof::SampleProfileWriterBinary::NameTable, llvm::sampleprof::SampleProfileWriter::OutputStream, llvm::sampleprof::SampleProfileWriterBinary::stablizeNameTable(), and llvm::success.
|
overridevirtual |
Write samples of a top-level function to a binary file.
Reimplemented from llvm::sampleprof::SampleProfileWriterBinary.
Definition at line 828 of file SampleProfWriter.cpp.
References llvm::encodeULEB128(), FuncOffsetTable, llvm::sampleprof::SampleProfileWriter::OutputStream, S, and llvm::sampleprof::SampleProfileWriterBinary::writeBody().
|
protected |
The table mapping from function name to the offset of its FunctionSample towards profile start.
Definition at line 386 of file SampleProfWriter.h.
Referenced by writeFuncOffsetTable(), and writeSample().
|
protected |
The offset of the slot to be filled with the offset of FuncOffsetTable towards profile start.
Definition at line 389 of file SampleProfWriter.h.
Referenced by writeFuncOffsetTable(), and writeHeader().