LLVM
8.0.1
|
A profile data reader proxy that remaps the profile data from another sample profile data reader, by applying a provided set of equivalences between components of the symbol names in the profile. More...
#include "llvm/ProfileData/SampleProfReader.h"
Public Member Functions | |
SampleProfileReaderItaniumRemapper (std::unique_ptr< MemoryBuffer > B, LLVMContext &C, std::unique_ptr< SampleProfileReader > Underlying) | |
std::error_code | readHeader () override |
Read and validate the file header. More... | |
std::error_code | read () override |
Read remapping file and apply it to the sample profile. More... | |
FunctionSamples * | getSamplesFor (StringRef FunctionName) override |
Return the samples collected for function F . More... | |
Public Member Functions inherited from llvm::sampleprof::SampleProfileReader | |
SampleProfileReader (std::unique_ptr< MemoryBuffer > B, LLVMContext &C, SampleProfileFormat Format=SPF_None) | |
virtual | ~SampleProfileReader ()=default |
void | dumpFunctionProfile (StringRef FName, raw_ostream &OS=dbgs()) |
Print the profile for FName on stream OS . More... | |
virtual void | collectFuncsToUse (const Module &M) |
void | dump (raw_ostream &OS=dbgs()) |
Print all the profiles on stream OS . More... | |
FunctionSamples * | getSamplesFor (const Function &F) |
Return the samples collected for function F . More... | |
StringMap< FunctionSamples > & | getProfiles () |
Return all the profiles. More... | |
void | reportError (int64_t LineNumber, Twine Msg) const |
Report a parse error message. More... | |
ProfileSummary & | getSummary () |
Return the profile summary. More... | |
SampleProfileFormat | getFormat () |
Return the profile format. More... | |
Static Public Member Functions | |
static ErrorOr< std::unique_ptr< SampleProfileReader > > | create (const Twine &Filename, LLVMContext &C, std::unique_ptr< SampleProfileReader > Underlying) |
Create a remapped sample profile from the given remapping file and underlying samples. More... | |
Static Public Member Functions inherited from llvm::sampleprof::SampleProfileReader | |
static ErrorOr< std::unique_ptr< SampleProfileReader > > | create (const Twine &Filename, LLVMContext &C) |
Create a sample profile reader appropriate to the file format. More... | |
static ErrorOr< std::unique_ptr< SampleProfileReader > > | create (std::unique_ptr< MemoryBuffer > &B, LLVMContext &C) |
Create a sample profile reader from the supplied memory buffer. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::sampleprof::SampleProfileReader | |
void | computeSummary () |
Compute summary for this profile. More... | |
Static Protected Member Functions inherited from llvm::sampleprof::SampleProfileReader | |
static std::unique_ptr< ProfileSummary > | takeSummary (SampleProfileReader &Reader) |
Take ownership of the summary of this reader. More... | |
Protected Attributes inherited from llvm::sampleprof::SampleProfileReader | |
StringMap< FunctionSamples > | Profiles |
Map every function to its associated profile. More... | |
LLVMContext & | Ctx |
LLVM context used to emit diagnostics. More... | |
std::unique_ptr< MemoryBuffer > | Buffer |
Memory buffer holding the profile file. More... | |
std::unique_ptr< ProfileSummary > | Summary |
Profile summary information. More... | |
SampleProfileFormat | Format = SPF_None |
The format of sample. More... | |
A profile data reader proxy that remaps the profile data from another sample profile data reader, by applying a provided set of equivalences between components of the symbol names in the profile.
Definition at line 543 of file SampleProfReader.h.
|
inline |
Definition at line 545 of file SampleProfReader.h.
References C, llvm::sampleprof::SampleProfileReader::create(), llvm::sampleprof::SampleProfileReader::Profiles, llvm::sampleprof::SampleProfileReader::Summary, llvm::sampleprof::SampleProfileReader::takeSummary(), and llvm::BitmaskEnumDetail::Underlying().
|
static |
Create a remapped sample profile from the given remapping file and underlying samples.
Create a sample profile remapper from the given input, to remap the function names in the given profile data.
Filename | The file to open. |
C | The LLVM context to use to emit diagnostics. |
Underlying | The underlying profile data reader to remap. |
Definition at line 992 of file SampleProfReader.cpp.
References setupMemoryBuffer().
|
overridevirtual |
Return the samples collected for function F
.
Reimplemented from llvm::sampleprof::SampleProfileReader.
Definition at line 943 of file SampleProfReader.cpp.
References llvm::sampleprof::SampleProfileReader::getSamplesFor().
|
overridevirtual |
Read remapping file and apply it to the sample profile.
Implements llvm::sampleprof::SampleProfileReader.
Definition at line 915 of file SampleProfReader.cpp.
References llvm::sampleprof::SampleProfileReader::Buffer, llvm::sampleprof::SampleProfileReader::Ctx, llvm::LLVMContext::diagnose(), llvm::DS_Warning, E, llvm::sampleprof::SampleProfileReader::getFormat(), llvm::SymbolRemappingParseError::getLineNum(), llvm::SymbolRemappingParseError::getMessage(), llvm::sampleprof::SampleProfileReader::getProfiles(), llvm::handleAllErrors(), llvm::malformed, llvm::sampleprof::SampleProfileReader::reportError(), llvm::sampleprof::SPF_Compact_Binary, and llvm::success.
|
inlineoverridevirtual |
Read and validate the file header.
Implements llvm::sampleprof::SampleProfileReader.
Definition at line 563 of file SampleProfReader.h.
References llvm::sampleprof::SampleProfileReader::getSamplesFor(), llvm::sampleprof::SampleProfileReader::read(), and llvm::success.