mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 03:50:17 +08:00
Add PLT dyno stats.
Summary: Get PLT call stats. (cherry picked from FBD3874799)
This commit is contained in:
@@ -2688,6 +2688,20 @@ DynoStats BinaryFunction::getDynoStats() const {
|
||||
Stats[DynoStats::FUNCTION_CALLS] += BBExecutionCount;
|
||||
if (BC.MIA->getMemoryOperandNo(Instr) != -1) {
|
||||
Stats[DynoStats::INDIRECT_CALLS] += BBExecutionCount;
|
||||
} else if (const auto *CallSymbol = BC.MIA->getTargetSymbol(Instr)) {
|
||||
if (BC.getFunctionForSymbol(CallSymbol))
|
||||
continue;
|
||||
auto GSI = BC.GlobalSymbols.find(CallSymbol->getName());
|
||||
if (GSI == BC.GlobalSymbols.end())
|
||||
continue;
|
||||
auto Section = BC.getSectionForAddress(GSI->second);
|
||||
if (!Section)
|
||||
continue;
|
||||
StringRef SectionName;
|
||||
Section->getName(SectionName);
|
||||
if (SectionName == ".plt") {
|
||||
Stats[DynoStats::PLT_CALLS] += BBExecutionCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user