Skip to content

Commit 914b746

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.4 [skip ci]
1 parent 7c21d30 commit 914b746

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:
@@ -82,6 +83,7 @@ Hot indices are delta encoded, implicitly starting at zero.
8283
| `NumEntries` | ULEB128 | Number of address translation entries for a function |
8384
| `EqualElems` | ULEB128 | Hot functions only: number of equal offsets in the beginning of a function |
8485
| `BranchEntries` | Bitmask, `alignTo(EqualElems, 8)` bits | Hot functions only: if `EqualElems` is non-zero, bitmask denoting entries with `BRANCHENTRY` bit |
86+
8587
Function header is followed by `EqualElems` offsets (hot functions only) and
8688
`NumEntries-EqualElems` (`NumEntries` for cold functions) pairs of offsets for
8789
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)