[PATCH] D135912: [PseudoProbe] Replace relocation with offset for entry probe.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 12:41:05 PDT 2022


hoy marked 2 inline comments as done.
hoy added inline comments.


================
Comment at: llvm/include/llvm/MC/MCPseudoProbe.h:293
+  // A collection of MCPseudoProbe for each binary function. The MCPseudoProbes
+  // are grouped by GUIDs due to inlining that can bring probes from different functions into one function.
   MCProbeDivisionMap MCProbeDivisions;
----------------
rafauler wrote:
> Is this over 80col?
Yes, it is. Fixed.


================
Comment at: llvm/lib/MC/MCPseudoProbe.cpp:206-220
+      std::map<InlineSite, MCPseudoProbeInlineTree *> Inlinees;
+      for (auto Child = Root.getChildren().begin();
+           Child != Root.getChildren().end(); ++Child)
+        Inlinees[Child->first] = Child->second.get();
+
+      for (const auto &Inlinee : Inlinees) {
+        // Emit the group guarded by a sentinel probe.
----------------
rafauler wrote:
> std::map is an expensive data structure. For usage patterns that are strictly  "insert then query", considering using a vector + std::sort.
> 
> Reference https://llvm.org/docs/ProgrammersManual.html#dss-sortedvectormap
Good point. Changed to using vector+sort.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135912



More information about the llvm-commits mailing list