[PATCH] D89723: [CSSPGO][llvm-profgen]Context-sensitive profile data generation

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 21:19:35 PDT 2020


wmi added inline comments.


================
Comment at: llvm/tools/llvm-profgen/PerfReader.h:104
+    uint64_t StackLeaf = CallStack.front();
+    if (StackLeaf < LBRLeaf || StackLeaf >= LBRLeaf + 0x100) {
+      WithColor::warning() << "Bogus trace: stack tip = "
----------------
wenlei wrote:
> wmi wrote:
> > What is the rationale behind the condition?
> Ideally we want tip of LBR target and tip of stack leaf to align with the help of PEBS. When we take a stack sample, the leaf IP of stack could be last LBR target address +N bytes, and N shouldn't be too large because N is essentially the sampling skid distance. So I had this in my original prototype as a sanity check to filter out broken records. However the distance chosen was somewhat arbitrary.. In reality, I don't think we've seen this firing with PEBS, but it could happen without PEBS, or if cycles is instead of branch_retired as triggering event. 
Thanks for the detailed explanation. Copying it to comment will be useful.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89723



More information about the llvm-commits mailing list