Skip to content

Commit 2cf78fb

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.4 [skip ci]
1 parent 01c1231 commit 2cf78fb

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 fdata profile for the original
1818
binary. Note that YAML profile generation is not supported since BAT doesn't
@@ -30,14 +30,15 @@ BAT section is created from `BoltAddressTranslation` class which captures
3030
address translation information provided by BOLT linker. It is then encoded as a
3131
note section in the output binary.
3232

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

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

4243
### Layout
4344
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
@@ -127,7 +127,7 @@ APInt BoltAddressTranslation::calculateBranchEntriesBitMask(MapTy &Map,
127127
return BitMask;
128128
}
129129

130-
size_t BoltAddressTranslation::getNumEqualOffsets(const MapTy& Map) const {
130+
size_t BoltAddressTranslation::getNumEqualOffsets(const MapTy &Map) const {
131131
size_t EqualOffsets = 0;
132132
for (const std::pair<const uint32_t, uint32_t> &KeyVal : Map) {
133133
const uint32_t OutputOffset = KeyVal.first;

0 commit comments

Comments
 (0)