#include "MissingFrameInferrer.h"
#include "PerfReader.h"
#include "ProfiledBinary.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/ADT/Statistic.h"
#include <algorithm>
#include <cstdint>
#include <iterator>
#include <queue>
#include <sys/types.h>
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespacesampleprof;
STATISTIC(TailCallUniReachable,
"Number of frame pairs reachable via a unique tail call path");
STATISTIC(TailCallMultiReachable,
"Number of frame pairs reachable via a multiple tail call paths");
STATISTIC(TailCallUnreachable,
"Number of frame pairs unreachable via any tail call path");
STATISTIC(TailCallFuncSingleTailCalls,
"Number of functions with single tail call site");
STATISTIC(TailCallFuncMultipleTailCalls,
"Number of functions with multiple tail call sites");
STATISTIC(TailCallMaxTailCallPath, "Length of the longest tail call path");
static cl::opt<uint32_t>
MaximumSearchDepth("max-search-depth", cl::init(UINT32_MAX - 1),
cl::desc("The maximum levels the DFS-based missing "
"frame search should go with"));
void MissingFrameInferrer::initialize(
const ContextSampleCounterMap *SampleCounters) { … }
uint64_t MissingFrameInferrer::computeUniqueTailCallPath(
BinaryFunction *From, BinaryFunction *To, SmallVectorImpl<uint64_t> &Path) { … }
uint64_t MissingFrameInferrer::computeUniqueTailCallPath(
uint64_t From, BinaryFunction *To, SmallVectorImpl<uint64_t> &Path) { … }
bool MissingFrameInferrer::inferMissingFrames(
uint64_t From, uint64_t To, SmallVectorImpl<uint64_t> &UniquePath) { … }
void MissingFrameInferrer::inferMissingFrames(
const SmallVectorImpl<uint64_t> &Context,
SmallVectorImpl<uint64_t> &NewContext) { … }