LLVM
8.0.1
|
Sample-based profile writer (binary format). More...
#include "llvm/ProfileData/SampleProfWriter.h"
Public Member Functions | |
virtual std::error_code | write (const FunctionSamples &S) override |
Write samples of a top-level function to a binary file. More... | |
SampleProfileWriterBinary (std::unique_ptr< raw_ostream > &OS) | |
Public Member Functions inherited from llvm::sampleprof::SampleProfileWriter | |
virtual | ~SampleProfileWriter ()=default |
virtual std::error_code | write (const StringMap< FunctionSamples > &ProfileMap) |
Write all the sample profiles in the given map of samples. More... | |
raw_ostream & | getOutputStream () |
Protected Member Functions | |
virtual std::error_code | writeNameTable ()=0 |
virtual std::error_code | writeMagicIdent ()=0 |
virtual std::error_code | writeHeader (const StringMap< FunctionSamples > &ProfileMap) override |
Write a file header for the profile file. More... | |
std::error_code | writeSummary () |
std::error_code | writeNameIdx (StringRef FName) |
std::error_code | writeBody (const FunctionSamples &S) |
void | stablizeNameTable (std::set< StringRef > &V) |
Protected Member Functions inherited from llvm::sampleprof::SampleProfileWriter | |
SampleProfileWriter (std::unique_ptr< raw_ostream > &OS) | |
void | computeSummary (const StringMap< FunctionSamples > &ProfileMap) |
Compute summary for this profile. More... | |
Protected Attributes | |
MapVector< StringRef, uint32_t > | NameTable |
Protected Attributes inherited from llvm::sampleprof::SampleProfileWriter | |
std::unique_ptr< raw_ostream > | OutputStream |
Output stream where to emit the profile to. More... | |
std::unique_ptr< ProfileSummary > | Summary |
Profile summary. More... | |
Friends | |
ErrorOr< std::unique_ptr< SampleProfileWriter > > | SampleProfileWriter::create (std::unique_ptr< raw_ostream > &OS, SampleProfileFormat Format) |
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::sampleprof::SampleProfileWriter | |
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... | |
Sample-based profile writer (binary format).
Definition at line 104 of file SampleProfWriter.h.
|
inline |
Definition at line 107 of file SampleProfWriter.h.
References llvm::sampleprof::SampleProfileWriter::writeHeader().
|
inlineprotected |
Definition at line 159 of file SampleProfWriter.cpp.
|
overridevirtual |
Write samples of a top-level function to a binary file.
Implements llvm::sampleprof::SampleProfileWriter.
Reimplemented in llvm::sampleprof::SampleProfileWriterCompactBinary.
Definition at line 329 of file SampleProfWriter.cpp.
References llvm::encodeULEB128(), llvm::sampleprof::FunctionSamples::getHeadSamples(), and llvm::sampleprof::SampleProfileWriter::OutputStream.
|
protected |
Definition at line 282 of file SampleProfWriter.cpp.
References Callee, llvm::sampleprof::LineLocation::Discriminator, llvm::encodeULEB128(), llvm::sampleprof::FunctionSamples::getBodySamples(), llvm::sampleprof::FunctionSamples::getCallsiteSamples(), llvm::sampleprof::SampleRecord::getCallTargets(), llvm::sampleprof::FunctionSamples::getName(), llvm::sampleprof::SampleRecord::getSamples(), llvm::sampleprof::FunctionSamples::getTotalSamples(), I, llvm::sampleprof::LineLocation::LineOffset, llvm::sampleprof::SampleProfileWriter::OutputStream, llvm::StringMapImpl::size(), and llvm::success.
|
overrideprotectedvirtual |
Write a file header for the profile file.
Implements llvm::sampleprof::SampleProfileWriter.
Reimplemented in llvm::sampleprof::SampleProfileWriterCompactBinary.
Definition at line 235 of file SampleProfWriter.cpp.
References llvm::sampleprof::SampleProfileWriter::computeSummary(), I, and llvm::success.
Referenced by llvm::sampleprof::SampleProfileWriterCompactBinary::writeHeader().
|
protectedpure virtual |
|
protected |
Definition at line 130 of file SampleProfWriter.cpp.
References llvm::encodeULEB128(), llvm::sampleprof::FunctionSamples::getBodySamples(), llvm::sampleprof::FunctionSamples::getCallsiteSamples(), llvm::sampleprof::SampleRecord::getCallTargets(), llvm::sampleprof::FunctionSamples::getName(), I, llvm::success, and llvm::truncated_name_table.
|
protectedpure virtual |
|
protected |
Definition at line 266 of file SampleProfWriter.cpp.
References llvm::encodeULEB128(), llvm::sampleprof::SampleProfileWriter::OutputStream, llvm::success, and llvm::sampleprof::SampleProfileWriter::Summary.
|
friend |
Definition at line 120 of file SampleProfWriter.h.