[llvm-profgen] Ignore broken LBR samples
Perf script can sometimes give disordered LBR samples like below. ``` b022500 32de0044 3386e1d1 7f118e05720c 7f118df2d81f 0x2a0b9622/0x2a0b9610/P/-/-/1 0x2a0b79ff/0x2a0b9618/P/-/-/2 0x2a0b7a4a/0x2a0b79e8/P/-/-/1 0x2a0b7a33/0x2a0b7a46/P/-/-/1 0x2a0b7a42/0x2a0b7a23/P/-/-/1 0x2a0b7a21/0x2a0b7a37/P/-/-/2 0x2a0b79e6/0x2a0b7a07/P/-/-/1 0x2a0b79d4/0x2a0b79dc/P/-/-/2 0x2a0b7a03/0x2a0b79aa/P/-/-/1 0x2a0b79a8/0x2a0b7a00/P/-/-/234 0x2a0b9613/0x2a0b7930/P/-/-/1 0x2a0b9622/0x2a0b9610/P/-/-/1 0x2a0b79ff/0x2a0b9618/P/-/-/2 0x2a0b7a4a/0x2aWarning: Processed 10263226 events and lost 1 chunks! ``` Note that the last LBR record `0x2a0b7a4a/0x2aWarning:` . Currently llvm-profgen does not detect that and as a result an uninitialized branch target value will be used. The uninitialized value can cause creepy instruction ranges created which which in turn will result in a completely wrong profile. An example is like ``` .... @ _ZN5folly13loadUnalignedIsEET_PKv]:18446744073709551615:18446744073709551615 1: 18446744073709551615 !CFGChecksum: 4294967295 !Attributes: 0 ``` Reviewed By: wenlei, wlei Differential Revision: https://reviews.llvm.org/D109637
Loading
Please register or sign in to comment