[CSSPGO][llvm-profgen] Truncate stack samples with invalid return address.
authorHongtao Yu <hoy@fb.com>
Tue, 14 Sep 2021 23:44:41 +0000 (16:44 -0700)
committerHongtao Yu <hoy@fb.com>
Wed, 15 Sep 2021 04:56:22 +0000 (21:56 -0700)
commit0057c7185d1cdbcfdaa9385f4b67e677066af8b8
tree62f6e140e03c1dfc085a9ab57ce2c17c894238bc
parent0dc461441eed3b49b36bec889ddf1449b502d17a
[CSSPGO][llvm-profgen] Truncate stack samples with invalid return address.

Invalid frame addresses exist in call stack samples due to bad unwinding. This could happen to frame-pointer-based unwinding and the callee functions that do not have the frame pointer chain set up. It isn't common when the program is built with the frame pointer omission disabled, but can still happen with third-party static libs built with frame pointer omitted.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D109638
llvm/test/tools/llvm-profgen/Inputs/cs-invalid-ret-addr.perfscript [new file with mode: 0644]
llvm/test/tools/llvm-profgen/cs-invalid-ret-addr.test [new file with mode: 0644]
llvm/tools/llvm-profgen/PerfReader.cpp
llvm/tools/llvm-profgen/PerfReader.h
llvm/tools/llvm-profgen/ProfiledBinary.h