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/2] 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/2] 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