[PATCH] D153588: [Pseudo Probe] Remove the assert of allowing only one call probe for a callsite.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 14:03:13 PDT 2023


hoy created this revision.
Herald added subscribers: wlei, modimo, wenlei, hiraditya.
Herald added a project: All.
hoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Compiler-generated static symbols, such as the global initializers, can shared the same name and can coexist in the binary. As a result, their pseudo probes are all kept in the binary too. This could cause multiple call probes decoded against one callsite, as probes are decoded against there owning functions by name. I'm temporarily disabling an assert to keep the debug build green until we have a better fix.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153588

Files:
  llvm/lib/MC/MCPseudoProbe.cpp


Index: llvm/lib/MC/MCPseudoProbe.cpp
===================================================================
--- llvm/lib/MC/MCPseudoProbe.cpp
+++ llvm/lib/MC/MCPseudoProbe.cpp
@@ -584,10 +584,18 @@
   const MCDecodedPseudoProbe *CallProbe = nullptr;
   for (const auto &Probe : Probes) {
     if (Probe.isCall()) {
-      assert(!CallProbe &&
-             "There should be only one call probe corresponding to address "
-             "which is a callsite.");
+      // Disabling the assert and returning first call probe seen so far.
+      // Subsequent call probes, if any, are ignored. Due to the the way
+      // .pseudo_probe section is decoded, probes of the same-named independent
+      // static functions are merged thus multiple call probes may be seen for a
+      // callsite.
+      // TODO: re-enable or narrow down the assert to static functions only.
+      //
+      // assert(!CallProbe &&
+      //        "There should be only one call probe corresponding to address "
+      //        "which is a callsite.");
       CallProbe = &Probe;
+      break;
     }
   }
   return CallProbe;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153588.533775.patch
Type: text/x-patch
Size: 1105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230622/9d4d890c/attachment.bin>


More information about the llvm-commits mailing list