Skip to content

Commit 2c77462

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.4 [skip ci]
1 parent 98076a3 commit 2c77462

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

bolt/docs/BAT.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ information. This information enables mapping the profile back from optimized
1212
binary onto the original binary.
1313

1414
# Usage
15-
`--enable-bat` flag controls the generation of BAT section. Sampled profile
15+
`--enable-bat` flag controls the generation of BAT section. Sampled profile
1616
needs to be passed along with the optimized binary containing BAT section to
1717
`perf2bolt` which reads BAT section and produces profile for the original
1818
binary.
@@ -29,14 +29,15 @@ BAT section is created from `BoltAddressTranslation` class which captures
2929
address translation information provided by BOLT linker. It is then encoded as a
3030
note section in the output binary.
3131

32-
During profile conversion when BAT-enabled binary is passed to perf2bolt,
32+
During profile conversion when BAT-enabled binary is passed to perf2bolt,
3333
`BoltAddressTranslation` class is populated from BAT section. The class is then
3434
queried by `DataAggregator` during sample processing to reconstruct addresses/
3535
offsets in the input binary.
3636

3737
## Encoding format
38-
The encoding is specified in bolt/include/bolt/Profile/BoltAddressTranslation.h
39-
and bolt/lib/Profile/BoltAddressTranslation.cpp.
38+
The encoding is specified in
39+
[BoltAddressTranslation.h](/bolt/include/bolt/Profile/BoltAddressTranslation.h)
40+
and [BoltAddressTranslation.cpp](/bolt/lib/Profile/BoltAddressTranslation.cpp).
4041

4142
### Layout
4243
The general layout is as follows:
@@ -81,6 +82,7 @@ Hot indices are delta encoded, implicitly starting at zero.
8182
| `NumEntries` | ULEB128 | Number of address translation entries for a function |
8283
| `EqualElems` | ULEB128 | Hot functions only: number of equal offsets in the beginning of a function |
8384
| `BranchEntries` | Bitmask, `alignTo(EqualElems, 8)` bits | Hot functions only: if `EqualElems` is non-zero, bitmask denoting entries with `BRANCHENTRY` bit |
85+
8486
Function header is followed by `EqualElems` offsets (hot functions only) and
8587
`NumEntries-EqualElems` (`NumEntries` for cold functions) pairs of offsets for
8688
current function.

bolt/lib/Profile/BoltAddressTranslation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ APInt BoltAddressTranslation::calculateBranchEntriesBitMask(MapTy &Map,
143143
return BitMask;
144144
}
145145

146-
size_t BoltAddressTranslation::getNumEqualOffsets(const MapTy& Map) const {
146+
size_t BoltAddressTranslation::getNumEqualOffsets(const MapTy &Map) const {
147147
size_t EqualOffsets = 0;
148148
for (const std::pair<const uint32_t, uint32_t> &KeyVal : Map) {
149149
const uint32_t OutputOffset = KeyVal.first;

0 commit comments

Comments
 (0)