Skip to content

Commit 8df2580

Browse files
maurycypablogsal
andauthored
gh-154060: Fix the Profile Stats offsets in the profiling binary format docs and a missing flag (#157871)
* correct profile stats size and paddings * missing flag * gh-154060: Clarify the main-thread status flag --------- Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
1 parent 1643525 commit 8df2580

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎InternalDocs/profiling_binary_format.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ The file consists of five required sections and one optional extension:
4747
| String Table | Variable size
4848
+------------------+ frame_table_offset
4949
| Frame Table | Variable size
50-
+------------------+ file_size - 64 (when stats are present)
51-
| Profile Stats | 32 bytes (optional)
50+
+------------------+ file_size - 88 (when stats are present)
51+
| Profile Stats | 56 bytes (optional)
5252
+------------------+ file_size - 32
5353
| Footer | 32 bytes (fixed)
5454
+------------------+ file_size
@@ -220,6 +220,7 @@ The status byte is a bitfield encoding thread state at sample time:
220220
| 2 | THREAD_STATUS_UNKNOWN | Thread state could not be determined |
221221
| 3 | THREAD_STATUS_GIL_REQUESTED | Thread is waiting to acquire the GIL |
222222
| 4 | THREAD_STATUS_HAS_EXCEPTION | Thread has a pending exception |
223+
| 5 | THREAD_STATUS_MAIN_THREAD | Thread is the interpreter's main thread |
223224

224225
Multiple flags can be set simultaneously (e.g., a thread can hold the GIL
225226
while also running on CPU). Analysis tools use these to filter samples or

0 commit comments

Comments
 (0)