1#ifndef LLVM_PROFILEDATA_RAWMEMPROFREADER_H_
2#define LLVM_PROFILEDATA_RAWMEMPROFREADER_H_
58 bool KeepName =
false);
64 Iter = FunctionProfileData.begin();
79 CallstackProfileData(Prof), StackMap(SM), KeepSymbolName(KeepName) {
85 if (
Error E = symbolizeAndFilterStackFrames())
87 if (
Error E = mapRawProfileToRecords())
99 return FunctionProfileData;
104 : Binary(
std::
move(
Bin)), KeepSymbolName(KeepName) {}
106 Error initialize(std::unique_ptr<MemoryBuffer> DataBuffer);
108 Error readRawProfile(std::unique_ptr<MemoryBuffer> DataBuffer);
110 Error setupForSymbolization();
115 Error symbolizeAndFilterStackFrames();
119 Error mapRawProfileToRecords();
122 const Frame &idToFrame(
const FrameId Id)
const {
123 auto It = IdToFrame.find(Id);
124 assert(It != IdToFrame.end() &&
"Id not found in map.");
125 return It->getSecond();
128 object::SectionedAddress getModuleOffset(
uint64_t VirtualAddress);
131 object::OwningBinary<object::Binary> Binary;
133 std::unique_ptr<llvm::symbolize::SymbolizableModule> Symbolizer;
135 uint64_t PreferredTextSegmentAddress = 0;
137 uint64_t ProfiledTextSegmentStart = 0;
139 uint64_t ProfiledTextSegmentEnd = 0;
158 bool KeepSymbolName =
false;
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file defines the DenseMap class.
This file implements a map that provides insertion order iteration.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
A file format agnostic iterator over profiling data.
This class implements a map that also provides access to all stored values in a deterministic order.
typename VectorType::iterator iterator
This interface provides simple read-only access to a block of memory, and provides simple methods for...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
InstrProfIterator< GuidMemProfRecordPair, RawMemProfReader > Iterator
void printYAML(raw_ostream &OS)
RawMemProfReader & operator=(const RawMemProfReader &)=delete
const llvm::MapVector< GlobalValue::GUID, IndexedMemProfRecord > & getProfileData() const
RawMemProfReader(const RawMemProfReader &)=delete
const llvm::DenseMap< FrameId, Frame > & getFrameMapping() const
std::pair< GlobalValue::GUID, MemProfRecord > GuidMemProfRecordPair
static Expected< std::unique_ptr< RawMemProfReader > > create(const Twine &Path, const StringRef ProfiledBinary, bool KeepName=false)
Error readNextRecord(GuidMemProfRecordPair &GuidRecord)
RawMemProfReader(std::unique_ptr< llvm::symbolize::SymbolizableModule > Sym, llvm::SmallVectorImpl< SegmentEntry > &Seg, llvm::MapVector< uint64_t, MemInfoBlock > &Prof, CallStackMap &SM, bool KeepName=false)
static bool hasFormat(const MemoryBuffer &DataBuffer)
InstrProfKind getProfileKind() const
This class implements an extremely fast bulk output stream that can only output to a stream.
llvm::DenseMap< uint64_t, llvm::SmallVector< uint64_t > > CallStackMap
This is an optimization pass for GlobalISel generic memory operations.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
InstrProfKind
An enum describing the attributes of an instrumented profile.