From 78668cada3c6d3f17ccd7fd7dac3134febb921d3 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Sun, 20 Sep 2026 21:33:14 +0200 Subject: [PATCH 1/3] correct profile stats size and paddings --- InternalDocs/profiling_binary_format.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InternalDocs/profiling_binary_format.md b/InternalDocs/profiling_binary_format.md index 51b1944aa5c8a00..8165384b88033bf 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 From 237418d0345034be45f0a6f80bcf962f90fc4633 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Sun, 20 Sep 2026 22:05:02 +0200 Subject: [PATCH 2/3] missing flag --- InternalDocs/profiling_binary_format.md | 1 + 1 file changed, 1 insertion(+) diff --git a/InternalDocs/profiling_binary_format.md b/InternalDocs/profiling_binary_format.md index 8165384b88033bf..148c9f879b4b2e8 100644 --- a/InternalDocs/profiling_binary_format.md +++ b/InternalDocs/profiling_binary_format.md @@ -212,6 +212,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 process'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 From 8a48a1dcd4fbc430bc65d58b112c9bcae98ae294 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Mon, 5 Oct 2026 15:02:39 +0100 Subject: [PATCH 3/3] gh-154060: Clarify the main-thread status flag --- InternalDocs/profiling_binary_format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InternalDocs/profiling_binary_format.md b/InternalDocs/profiling_binary_format.md index 4aa5ea3c75e823d..a3d86b1a4ab5693 100644 --- a/InternalDocs/profiling_binary_format.md +++ b/InternalDocs/profiling_binary_format.md @@ -220,7 +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 process's main thread | +| 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