[llvm] [nfc][docs]Generalize header and ascii art for indexed profiles (PR #83507)

David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 16:35:24 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
----------------
david-xl wrote:

Probably document the sections are A, B, C, and D, and their order is defined in Header struct.

https://github.com/llvm/llvm-project/pull/83507


More information about the llvm-commits mailing list