[PATCH] D115760: [llvm-profgen] Fix to use getUntrackedCallsites outside the loop

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 14 16:43:03 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG30c3aba99897: [llvm-profgen] Fix to use getUntrackedCallsites outside the loop (authored by wlei).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115760/new/

https://reviews.llvm.org/D115760

Files:
  llvm/tools/llvm-profgen/PerfReader.cpp


Index: llvm/tools/llvm-profgen/PerfReader.cpp
===================================================================
--- llvm/tools/llvm-profgen/PerfReader.cpp
+++ llvm/tools/llvm-profgen/PerfReader.cpp
@@ -435,25 +435,22 @@
 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.");
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115760.394411.patch
Type: text/x-patch
Size: 1549 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211215/9c1ff31d/attachment.bin>


More information about the llvm-commits mailing list