Skip to content

Commit 63c6f50

Browse files
committed
Update docs
1 parent 191458a commit 63c6f50

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

InternalDocs/profiling_binary_format.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,25 @@ with a single seek to `file_size - 32`, without first reading the header.
7676
Offset Size Type Description
7777
+--------+------+---------+----------------------------------------+
7878
| 0 | 4 | uint32 | Magic number (0x54414348 = "TACH") |
79-
| 4 | 4 | uint32 | Format version (currently 2) |
80-
| 8 | 8 | uint64 | Start timestamp (microseconds) |
81-
| 16 | 8 | uint64 | Sample interval (microseconds) |
82-
| 24 | 4 | uint32 | Total sample count |
83-
| 28 | 4 | uint32 | Thread count |
84-
| 32 | 8 | uint64 | String table offset |
85-
| 40 | 8 | uint64 | Frame table offset |
86-
| 48 | 4 | uint32 | Compression type (0=none, 1=zstd) |
87-
| 52 | 12 | bytes | Reserved (zero-filled) |
79+
| 4 | 4 | uint32 | Format version |
80+
| 8 | 4 | bytes | Python version (major, minor, micro, |
81+
| | | | reserved) |
82+
| 12 | 8 | uint64 | Start timestamp (microseconds) |
83+
| 20 | 8 | uint64 | Sample interval (microseconds) |
84+
| 28 | 4 | uint32 | Total sample count |
85+
| 32 | 4 | uint32 | Thread count |
86+
| 36 | 8 | uint64 | String table offset |
87+
| 44 | 8 | uint64 | Frame table offset |
88+
| 52 | 4 | uint32 | Compression type (0=none, 1=zstd) |
89+
| 56 | 8 | bytes | Reserved (zero-filled) |
8890
+--------+------+---------+----------------------------------------+
8991
```
9092

93+
The Python version field records the major, minor, and micro version numbers
94+
of the Python interpreter that generated the file. This allows analysis tools
95+
to detect version mismatches when replaying data collected on a different
96+
Python version, which may have different internal structures or behaviors.
97+
9198
The header is written as zeros initially, then overwritten with actual values
9299
during finalization. This requires the output stream to be seekable, which
93100
is acceptable since the format targets regular files rather than pipes or

0 commit comments

Comments
 (0)