[llvm-profgen] Ignore the whole trace with the leading external branch
authorwlei <wlei@fb.com>
Wed, 13 Oct 2021 06:42:07 +0000 (23:42 -0700)
committerwlei <wlei@fb.com>
Wed, 13 Oct 2021 23:52:29 +0000 (16:52 -0700)
commit30ca33eab00b8c815ef95fbb3a14e61dc3278b5b
treefb64e8a0925a9359a96067e733efb8f5f1dfab7f
parentab5d65e6858b25fc07672a0bd2d07f666bde6b51
[llvm-profgen] Ignore the whole trace with the leading external branch

The first LBR entry can be an external branch, we should ignore the whole trace.

```
     7f7448e889e4 0x7f7448e889e4/0x7f7448e88826/P/-/-/1  0x7f7448e8899f/0x7f7448e889d8/P/-/-/4  ...
```

Reviewed By: wenlei, hoy

Differential Revision: https://reviews.llvm.org/D111749
llvm/test/tools/llvm-profgen/Inputs/artificial-branch.perfscript [new file with mode: 0644]
llvm/test/tools/llvm-profgen/inline-noprobe2.test
llvm/tools/llvm-profgen/PerfReader.cpp