Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BOLT] Fix stale functions when using BAT
Summary: If collecting data in Intel Skylake machines, we may face a bug where LBR0 or LBR1 may be duplicated w.r.t. the next entry. This makes perf2bolt interpret it as an invalid trace, which ordinarily we discard during aggregation. However, in BAT, since we do not disassemble the binary where the collection happened but rely only on the translation table, it is not possible to detect bad traces and discard them. This gets to the fdata file, and this invalid trace ends up invalidating the profile for the whole function (by being treated as stale by BOLT). In this patch, we detect Skylake by looking for LBRs with 32 entries, and discard the first 2 entries to avoid running into this problem. It also fixes an issue with collision in the translation map by prioritizing the last basic block when more than one share the same output address. (cherry picked from FBD17996791)
- Loading branch information
1 parent
103b0a7
commit b807641
Showing
3 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters