[llvm] [llvm-profgen] Fix bogus trace check (PR #225569)

Kunal Pathak via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 19:56:35 PDT 2026


================
@@ -881,6 +880,15 @@ void PerfScriptReader::warnIfMissingMMap() {
   }
 }
 
+// The unwinder requires that LBR tip belong to the leaf frame.
+// External addresses are not checked.
+static bool isValidTrace(ProfiledBinary *Binary, uint64_t StackLeaf,
+                         uint64_t LBRLeaf) {
+  if (StackLeaf == ExternalAddr || LBRLeaf == ExternalAddr)
----------------
kunalspathak wrote:

This will basically match the sample even if StackLeaf and LBRLeaf is pointing to different external addresses? Should we consider return this as `false` instead?

https://github.com/llvm/llvm-project/pull/225569


More information about the llvm-commits mailing list