[llvm-branch-commits] [llvm] [BOLT] Add BOLT Address Translation documentation (PR #76898)
Amir Ayupov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jan 4 07:23:07 PST 2024
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/76898
>From 5a55a403683003bfa937a563092f45cc4fbfb578 Mon Sep 17 00:00:00 2001
From: Amir Ayupov <aaupov at fb.com>
Date: Thu, 4 Jan 2024 07:22:58 -0800
Subject: [PATCH] Fix table rendering
Created using spr 1.3.4
---
bolt/docs/BAT.md | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/bolt/docs/BAT.md b/bolt/docs/BAT.md
index 17845b906afe76..22986f7db2b17f 100644
--- a/bolt/docs/BAT.md
+++ b/bolt/docs/BAT.md
@@ -12,7 +12,7 @@ information. This information enables mapping the profile back from optimized
binary onto the original binary.
# Usage
-`--enable-bat` flag controls the generation of BAT section. Sampled profile
+`--enable-bat` flag controls the generation of BAT section. Sampled profile
needs to be passed along with the optimized binary containing BAT section to
`perf2bolt` which reads BAT section and produces fdata profile for the original
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
address translation information provided by BOLT linker. It is then encoded as a
note section in the output binary.
-During profile conversion when BAT-enabled binary is passed to perf2bolt,
+During profile conversion when BAT-enabled binary is passed to perf2bolt,
`BoltAddressTranslation` class is populated from BAT section. The class is then
queried by `DataAggregator` during sample processing to reconstruct addresses/
offsets in the input binary.
## Encoding format
-The encoding is specified in bolt/include/bolt/Profile/BoltAddressTranslation.h
-and bolt/lib/Profile/BoltAddressTranslation.cpp.
+The encoding is specified in
+[BoltAddressTranslation.h](/bolt/include/bolt/Profile/BoltAddressTranslation.h)
+and [BoltAddressTranslation.cpp](/bolt/lib/Profile/BoltAddressTranslation.cpp).
### Layout
The general layout is as follows:
@@ -67,6 +68,7 @@ The header is followed by Functions table with `NumFuncs` entries.
| ------ | ------| ----------- |
| `Address` | 8b | Function address in the output binary |
| `NumEntries` | 4b | Number of address translation entries for a function |
+
Function header is followed by `NumEntries` pairs of offsets for current
function.
More information about the llvm-branch-commits
mailing list