aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-profgen/PerfReader.cpp
diff options
context:
space:
mode:
authorwlei <wlei@fb.com>2021-12-12 01:42:53 -0800
committerwlei <wlei@fb.com>2021-12-14 16:40:53 -0800
commit30c3aba998972aa042493e26dbe8f7cca37a30dd (patch)
tree9657cbfa5a862a590fd0a4821b44fb6c905585da /llvm/tools/llvm-profgen/PerfReader.cpp
parent3dcb60db9a538aa1b7144e0d5e37ee3b43d5d991 (diff)
downloadllvm-30c3aba998972aa042493e26dbe8f7cca37a30dd.zip
llvm-30c3aba998972aa042493e26dbe8f7cca37a30dd.tar.gz
llvm-30c3aba998972aa042493e26dbe8f7cca37a30dd.tar.bz2
[llvm-profgen] Fix to use getUntrackedCallsites outside the loop
Unwinder is hoisted out in https://reviews.llvm.org/D115550, so fix the useage of getUntrackedCallsites. Reviewed By: hoy, wenlei Differential Revision: https://reviews.llvm.org/D115760
Diffstat (limited to 'llvm/tools/llvm-profgen/PerfReader.cpp')
-rw-r--r--llvm/tools/llvm-profgen/PerfReader.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp
index 5d7b732..df75909 100644
--- a/llvm/tools/llvm-profgen/PerfReader.cpp
+++ b/llvm/tools/llvm-profgen/PerfReader.cpp
@@ -435,25 +435,22 @@ static std::string getContextKeyStr(ContextKey *K,
void HybridPerfReader::unwindSamples() {
if (Binary->useFSDiscriminator())
exitWithError("FS discriminator is not supported in CS profile.");
- std::set<uint64_t> AllUntrackedCallsites;
VirtualUnwinder Unwinder(&SampleCounters, Binary);
for (const auto &Item : AggregatedSamples) {
const PerfSample *Sample = Item.first.getPtr();
Unwinder.unwind(Sample, Item.second);
- auto &CurrUntrackedCallsites = Unwinder.getUntrackedCallsites();
- AllUntrackedCallsites.insert(CurrUntrackedCallsites.begin(),
- CurrUntrackedCallsites.end());
}
// Warn about untracked frames due to missing probes.
if (ShowDetailedWarning) {
- for (auto Address : AllUntrackedCallsites)
+ for (auto Address : Unwinder.getUntrackedCallsites())
WithColor::warning() << "Profile context truncated due to missing probe "
<< "for call instruction at "
<< format("0x%" PRIx64, Address) << "\n";
}
- emitWarningSummary(AllUntrackedCallsites.size(), SampleCounters.size(),
+ emitWarningSummary(Unwinder.getUntrackedCallsites().size(),
+ SampleCounters.size(),
"of profiled contexts are truncated due to missing probe "
"for call instruction.");
}