Skip to content

gh-138122: Extend binary profiling format with full source location and opcode - #143088

Merged
pablogsal merged 5 commits into
python:mainfrom
pablogsal:tachyon-binary-file-refux
Dec 24, 2025
Merged

pablogsal merged 5 commits into
python:mainfrom
pablogsal:tachyon-binary-file-refux

Conversation

@pablogsal

@pablogsal pablogsal commented Dec 23, 2025 •

Copy link
Copy Markdown
Member

Add end_lineno, column, end_column, and opcode fields to frame entries.
Uses delta encoding for end positions to minimize file size.
reader, writer, tests, and documentation.

@pablogsal

pablogsal commented Dec 23, 2025 •

Copy link
Copy Markdown
Member Author

@lkollar smaller PR here to add opcode and location support to the file format. Most of the bulk is tests + docs update.

…tion and opcode

Add end_lineno, column, end_column, and opcode fields to frame entries.
Uses delta encoding for end positions to minimize file size.
reader, writer, tests, and documentation.
@pablogsal
pablogsal force-pushed the tachyon-binary-file-refux branch from 97a86dd to bb4129f Compare December 23, 2025 01:42
Comment thread InternalDocs/profiling_binary_format.md Resolved
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>

@lkollar lkollar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, just a couple of minor things.

@pablogsal

Copy link
Copy Markdown
Member Author

@lkollar fixed

@pablogsal
pablogsal requested a review from lkollar December 24, 2025 14:39
f"Thread ({interp_id}, {thread_id}), sample {i}, "
f"frame {j}: opcode mismatch "
f"(expected {exp_frame['opcode']}, got {act_frame['opcode']})",
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a long and duplicate list, that's not very dry, I wrote pablogsal#119

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @StanFromIreland !

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pablogsal
pablogsal merged commit 7c44f37 into python:main Dec 24, 2025
@pablogsal
pablogsal deleted the tachyon-binary-file-refux branch December 24, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants