[llvm] [nfc][docs]Generalize header and ascii art for indexed profiles (PR #83507)
Mingming Liu via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 29 18:08:25 PST 2024
================
@@ -369,55 +373,45 @@ General Storage Layout
+-----------------------+ |
| HashType | H
+-----------------------+ E
- +-------| HashOffset | A
- | +-----------------------+ D
- +-----------| MemProfOffset | E
- | | +-----------------------+ R
- | | +--| BinaryIdOffset | |
- | | | +-----------------------+ |
- +---------------| TemporalProf- | |
- | | | | | TracesOffset | |
- | | | | +-----------------------+---+
- | | | | | Profile Summary | |
- | | | | +-----------------------+ P
- | | +------>| Function data | A
- | | | +-----------------------+ Y
- | +---------->| MemProf profile data | L
- | | +-----------------------+ O
- | +->| Binary Ids | A
+ | Byte Offset | A
+ +------ | of section 2 | D
+ | +-----------------------+ E
+ | | Byte Offset | R
+ +-----------| of section 3 | |
+ | | +-----------------------+ |
+ | | | ... | |
+ | | +-----------------------+ |
+ | | | Byte Offset | |
+ +---------------| of section N | |
+ | | | +-----------------------+---+
+ | | | | Section 1 | |
+ | | | | (Profile Summary) | |
+ | | | +-----------------------+ P
+ | | +------>| Section 2 | A
+ | | +-----------------------+ Y
+ | +---------->| Section 3 | L
+ | +-----------------------+ O
+ | | ... | A
| +-----------------------+ D
- +-------------->| Temporal profiles | |
+ +-------------->| Section N | |
+-----------------------+---+
Header
--------
-``Magic``
- The purpose of the magic number is to be able to tell if the profile is an
- indexed profile.
-
-``Version``
- Similar to raw profile version, the lower 32 bits specify the version of the
- indexed profile and the most significant 32 bits are reserved to specify the
- variant types of the profile.
-
-``HashType``
- The hashing scheme for on-disk hash table keys. Only MD5 hashing is used as of
- writing.
+The `Header struct`_ should be the source of truth. Field names and comments
----------------
minglotus-6 wrote:
Incorporate the section names in the graph above and reworded the paragraph slightly.
For indexed profiles, the byte offset is relative to the start of profile memory buffer. Thereby the field order in the struct definition doesn't need to be the same as the order of payloads in the profile (e.g., if we need it sometime in the future).
https://github.com/llvm/llvm-project/pull/83507
More information about the llvm-commits
mailing list