Skip to content

Commit 30c3aba

Browse files
committed
[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
1 parent 3dcb60d commit 30c3aba

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/tools/llvm-profgen/PerfReader.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -435,25 +435,22 @@ static std::string getContextKeyStr(ContextKey *K,
435435
void HybridPerfReader::unwindSamples() {
436436
if (Binary->useFSDiscriminator())
437437
exitWithError("FS discriminator is not supported in CS profile.");
438-
std::set<uint64_t> AllUntrackedCallsites;
439438
VirtualUnwinder Unwinder(&SampleCounters, Binary);
440439
for (const auto &Item : AggregatedSamples) {
441440
const PerfSample *Sample = Item.first.getPtr();
442441
Unwinder.unwind(Sample, Item.second);
443-
auto &CurrUntrackedCallsites = Unwinder.getUntrackedCallsites();
444-
AllUntrackedCallsites.insert(CurrUntrackedCallsites.begin(),
445-
CurrUntrackedCallsites.end());
446442
}
447443

448444
// Warn about untracked frames due to missing probes.
449445
if (ShowDetailedWarning) {
450-
for (auto Address : AllUntrackedCallsites)
446+
for (auto Address : Unwinder.getUntrackedCallsites())
451447
WithColor::warning() << "Profile context truncated due to missing probe "
452448
<< "for call instruction at "
453449
<< format("0x%" PRIx64, Address) << "\n";
454450
}
455451

456-
emitWarningSummary(AllUntrackedCallsites.size(), SampleCounters.size(),
452+
emitWarningSummary(Unwinder.getUntrackedCallsites().size(),
453+
SampleCounters.size(),
457454
"of profiled contexts are truncated due to missing probe "
458455
"for call instruction.");
459456
}

0 commit comments

Comments
 (0)