Go to the documentation of this file. 1 #ifndef LLVM_PROFILEDATA_RAWMEMPROFREADER_H_
2 #define LLVM_PROFILEDATA_RAWMEMPROFREADER_H_
42 : DataBuffer(
std::
move(DataBuffer)) {}
66 Iter = FunctionProfileData.begin();
81 CallstackProfileData(Prof), StackMap(SM) {
87 if (
Error E = symbolizeAndFilterStackFrames())
89 if (
Error E = mapRawProfileToRecords())
101 return FunctionProfileData;
109 Error readRawProfile();
114 Error symbolizeAndFilterStackFrames();
118 Error mapRawProfileToRecords();
121 const Frame &idToFrame(
const FrameId Id)
const {
122 auto It = IdToFrame.find(
Id);
123 assert(It != IdToFrame.end() &&
"Id not found in map.");
124 return It->getSecond();
127 object::SectionedAddress getModuleOffset(
uint64_t VirtualAddress);
130 void printSummaries(raw_ostream &OS)
const;
132 std::unique_ptr<MemoryBuffer> DataBuffer;
133 object::OwningBinary<object::Binary> Binary;
134 std::unique_ptr<llvm::symbolize::SymbolizableModule> Symbolizer;
154 #endif // LLVM_PROFILEDATA_RAWMEMPROFREADER_H_
typename VectorType::iterator iterator
RawMemProfReader & operator=(const RawMemProfReader &)=delete
This is an optimization pass for GlobalISel generic memory operations.
Tagged union holding either a T or a Error.
This interface provides simple read-only access to a block of memory, and provides simple methods for...
RawMemProfReader(std::unique_ptr< MemoryBuffer > DataBuffer)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static Expected< std::unique_ptr< RawMemProfReader > > create(const Twine &Path, const StringRef ProfiledBinary)
Error readNextRecord(GuidMemProfRecordPair &GuidRecord)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class implements an extremely fast bulk output stream that can only output to a stream.
InstrProfKind getProfileKind() const
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
void printYAML(raw_ostream &OS)
const llvm::DenseMap< FrameId, Frame > & getFrameMapping() const
RawMemProfReader(std::unique_ptr< llvm::symbolize::SymbolizableModule > Sym, llvm::SmallVectorImpl< SegmentEntry > &Seg, llvm::MapVector< uint64_t, MemInfoBlock > &Prof, CallStackMap &SM)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
std::pair< GlobalValue::GUID, MemProfRecord > GuidMemProfRecordPair
StringRef - Represent a constant reference to a string, i.e.
InstrProfIterator< GuidMemProfRecordPair, RawMemProfReader > Iterator
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static bool hasFormat(const MemoryBuffer &DataBuffer)
Lightweight error class with error context and mandatory checking.
llvm::DenseMap< uint64_t, llvm::SmallVector< uint64_t > > CallStackMap
InstrProfKind
An enum describing the attributes of an instrumented profile.
const llvm::MapVector< GlobalValue::GUID, IndexedMemProfRecord > & getProfileData() const
A file format agnostic iterator over profiling data.