#include "PerfReader.h"
#include "ProfileGenerator.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/ToolOutputFile.h"
#define DEBUG_TYPE …
cl::opt<bool> SkipSymbolization("skip-symbolization",
cl::desc("Dump the unsymbolized profile to the "
"output file. It will show unwinder "
"output for CS profile generation."));
static cl::opt<bool> ShowMmapEvents("show-mmap-events",
cl::desc("Print binary load events."));
static cl::opt<bool>
UseOffset("use-offset", cl::init(true),
cl::desc("Work with `--skip-symbolization` or "
"`--unsymbolized-profile` to write/read the "
"offset instead of virtual address."));
static cl::opt<bool> UseLoadableSegmentAsBase(
"use-first-loadable-segment-as-base",
cl::desc("Use first loadable segment address as base address "
"for offsets in unsymbolized profile. By default "
"first executable segment address is used"));
static cl::opt<bool>
IgnoreStackSamples("ignore-stack-samples",
cl::desc("Ignore call stack samples for hybrid samples "
"and produce context-insensitive profile."));
cl::opt<bool> ShowDetailedWarning("show-detailed-warning",
cl::desc("Show detailed warning message."));
extern cl::opt<std::string> PerfTraceFilename;
extern cl::opt<bool> ShowDisassemblyOnly;
extern cl::opt<bool> ShowSourceLocations;
extern cl::opt<std::string> OutputFilename;
namespace llvm {
namespace sampleprof {
void VirtualUnwinder::unwindCall(UnwindState &State) { … }
void VirtualUnwinder::unwindLinear(UnwindState &State, uint64_t Repeat) { … }
void VirtualUnwinder::unwindReturn(UnwindState &State) { … }
void VirtualUnwinder::unwindBranch(UnwindState &State) { … }
std::shared_ptr<StringBasedCtxKey> FrameStack::getContextKey() { … }
std::shared_ptr<AddrBasedCtxKey> AddressStack::getContextKey() { … }
template <typename T>
void VirtualUnwinder::collectSamplesFromFrame(UnwindState::ProfiledFrame *Cur,
T &Stack) { … }
template <typename T>
void VirtualUnwinder::collectSamplesFromFrameTrie(
UnwindState::ProfiledFrame *Cur, T &Stack) { … }
void VirtualUnwinder::collectSamplesFromFrameTrie(
UnwindState::ProfiledFrame *Cur) { … }
void VirtualUnwinder::recordBranchCount(const LBREntry &Branch,
UnwindState &State, uint64_t Repeat) { … }
bool VirtualUnwinder::unwind(const PerfSample *Sample, uint64_t Repeat) { … }
std::unique_ptr<PerfReaderBase>
PerfReaderBase::create(ProfiledBinary *Binary, PerfInputFile &PerfInput,
std::optional<int32_t> PIDFilter) { … }
PerfInputFile
PerfScriptReader::convertPerfDataToTrace(ProfiledBinary *Binary, bool SkipPID,
PerfInputFile &File,
std::optional<int32_t> PIDFilter) { … }
static StringRef filename(StringRef Path, bool UseBackSlash) { … }
void PerfScriptReader::updateBinaryAddress(const MMapEvent &Event) { … }
static std::string getContextKeyStr(ContextKey *K,
const ProfiledBinary *Binary) { … }
void HybridPerfReader::unwindSamples() { … }
bool PerfScriptReader::extractLBRStack(TraceStream &TraceIt,
SmallVectorImpl<LBREntry> &LBRStack) { … }
bool PerfScriptReader::extractCallstack(TraceStream &TraceIt,
SmallVectorImpl<uint64_t> &CallStack) { … }
void PerfScriptReader::warnIfMissingMMap() { … }
void HybridPerfReader::parseSample(TraceStream &TraceIt, uint64_t Count) { … }
void PerfScriptReader::writeUnsymbolizedProfile(StringRef Filename) { … }
OrderedCounterForPrint;
void PerfScriptReader::writeUnsymbolizedProfile(raw_fd_ostream &OS) { … }
void UnsymbolizedProfileReader::readSampleCounters(TraceStream &TraceIt,
SampleCounter &SCounters) { … }
void UnsymbolizedProfileReader::readUnsymbolizedProfile(StringRef FileName) { … }
void UnsymbolizedProfileReader::parsePerfTraces() { … }
void PerfScriptReader::computeCounterFromLBR(const PerfSample *Sample,
uint64_t Repeat) { … }
void LBRPerfReader::parseSample(TraceStream &TraceIt, uint64_t Count) { … }
void PerfScriptReader::generateUnsymbolizedProfile() { … }
uint64_t PerfScriptReader::parseAggregatedCount(TraceStream &TraceIt) { … }
void PerfScriptReader::parseSample(TraceStream &TraceIt) { … }
bool PerfScriptReader::extractMMapEventForBinary(ProfiledBinary *Binary,
StringRef Line,
MMapEvent &MMap) { … }
void PerfScriptReader::parseMMapEvent(TraceStream &TraceIt) { … }
void PerfScriptReader::parseEventOrSample(TraceStream &TraceIt) { … }
void PerfScriptReader::parseAndAggregateTrace() { … }
bool PerfScriptReader::isLBRSample(StringRef Line) { … }
bool PerfScriptReader::isMMapEvent(StringRef Line) { … }
PerfContent PerfScriptReader::checkPerfScriptType(StringRef FileName) { … }
void HybridPerfReader::generateUnsymbolizedProfile() { … }
void PerfScriptReader::warnTruncatedStack() { … }
void PerfScriptReader::warnInvalidRange() { … }
void PerfScriptReader::parsePerfTraces() { … }
SmallVector<CleanupInstaller, 2> PerfScriptReader::TempFileCleanups;
}
}