https://github.com/python/cpython/commit/6dfba4d967eb5fb131a35877125c4141ade54b3e
commit: 6dfba4d967eb5fb131a35877125c4141ade54b3e
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: pablogsal <[email protected]>
date: 2026-10-05T14:20:11Z
summary:

[3.15] gh-154060: Fix the `Profile Stats` offsets in the profiling binary 
format docs and a missing flag (GH-157871) (#158855)

gh-154060: Fix the `Profile Stats` offsets in the profiling binary format docs 
and a missing flag (GH-157871)

* correct profile stats size and paddings

* missing flag

* gh-154060: Clarify the main-thread status flag

---------
(cherry picked from commit 8df25809e928b88db5ec16c73470dd6bd4ed3653)

Co-authored-by: Maurycy Pawłowski-Wieroński <[email protected]>
Co-authored-by: Pablo Galindo Salgado <[email protected]>

files:
M InternalDocs/profiling_binary_format.md

diff --git a/InternalDocs/profiling_binary_format.md 
b/InternalDocs/profiling_binary_format.md
index 0947e946f41bd0c..a3d86b1a4ab5693 100644
--- a/InternalDocs/profiling_binary_format.md
+++ b/InternalDocs/profiling_binary_format.md
@@ -47,8 +47,8 @@ The file consists of five required sections and one optional 
extension:
 |   String Table   |  Variable size
 +------------------+  frame_table_offset
 |   Frame Table    |  Variable size
-+------------------+  file_size - 64 (when stats are present)
-| Profile Stats    |  32 bytes (optional)
++------------------+  file_size - 88 (when stats are present)
+| Profile Stats    |  56 bytes (optional)
 +------------------+  file_size - 32
 |     Footer       |  32 bytes (fixed)
 +------------------+  file_size
@@ -220,6 +220,7 @@ The status byte is a bitfield encoding thread state at 
sample time:
 |  2  | THREAD_STATUS_UNKNOWN | Thread state could not be determined       |
 |  3  | THREAD_STATUS_GIL_REQUESTED | Thread is waiting to acquire the GIL  |
 |  4  | THREAD_STATUS_HAS_EXCEPTION | Thread has a pending exception         |
+|  5  | THREAD_STATUS_MAIN_THREAD | Thread is the interpreter's main thread |
 
 Multiple flags can be set simultaneously (e.g., a thread can hold the GIL
 while also running on CPU). Analysis tools use these to filter samples or

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to