Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
gh-154090: Store profiling mode in binary files#154105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -82,15 +82,18 @@ with a single seek to `file_size - 32`, without first reading the header. | ||
| | | | | reserved) | | ||
| | 12 | 8 | uint64 | Start timestamp (microseconds) | | ||
| | 20 | 8 | uint64 | Sample interval (microseconds) | | ||
| | 28 | 4 | uint32 | Total sample count | | ||
| | 32 | 4 | uint32 | Thread count | | ||
| | 36 | 8 | uint64 | String table offset | | ||
| | 44 | 8 | uint64 | Frame table offset | | ||
| | 52 | 4 | uint32 | Compression type (0=none, 1=zstd) | | ||
| | 56 | 8 | bytes | Reserved (zero-filled) | | ||
| | 28 | 8 | uint64 | Total sample count | | ||
| | 36 | 4 | uint32 | Thread count | | ||
| | 40 | 8 | uint64 | String table offset | | ||
| | 48 | 8 | uint64 | Frame table offset | | ||
| | 56 | 4 | uint32 | Compression type (0=none, 1=zstd) | | ||
| | 60 | 4 | uint32 | Profiling mode plus one (0=unknown) | | ||
| +--------+------+---------+----------------------------------------+ | ||
| ``` | ||
| Profiling modes use their `_remote_debugging.PROFILING_MODE_*` value plus one, | ||
| leaving zero available for binaries written before this field was defined. | ||
Comment on lines
+94
to
+95
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we care about backwards compatibility that much, given that we have recently changed the total sample count from | ||
| The magic number `0x54414348` ("TACH" for Tachyon) identifies the file format | ||
| and also serves as an **endianness marker**. When read on a system with | ||
| different byte order than the writer, it appears as `0x48434154`. The reader | ||
| @@ -530,11 +533,10 @@ one write() call (or feeds through the compression stream). | ||
| ## Future Considerations | ||
| The format reserves space for future extensions. The 12 reserved bytes in | ||
| the header could hold additional metadata. The 16-byte checksum field in | ||
| the footer is currently unused. The version field allows incompatible | ||
| changes with graceful rejection. New compression types could be added | ||
| (compression_type > 1). | ||
| The Python-version field retains one reserved byte. The 16-byte checksum | ||
| field in the footer is currently unused. The version field allows | ||
| incompatible changes with graceful rejection. New compression types could | ||
| be added (compression_type > 1). | ||
| Any changes that alter the meaning of existing fields or the parsing logic | ||
| should increment the version number to prevent older readers from | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Record the profiling mode in Tachyon binary profiles and reject differential | ||
| comparisons whose known modes do not match. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you