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-149584: Fix excessive overhead in the Tachyon profiler regarding the cache behavior#149649
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
c5520d38be8d7d5dc0309c69a0f37a85c9a46a0b2cf7fe3be2995187d576d3805799a74245b13File 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 |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Fix excessive overhead in the Tachyon profiler when inspecting a remote | ||
| process by avoiding repeated remote page-cache scans, batching predicted | ||
| remote reads, and reusing cached profiler result objects. Patch by Pablo | ||
| Galindo and Maurycy Pawłowski-Wieroński. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -405,6 +405,8 @@ parse_code_object(RemoteUnwinderObject *unwinder, | ||
| meta->func_name = func; | ||
| meta->file_name = file; | ||
| meta->linetable = linetable; | ||
| meta->last_frame_info = NULL; | ||
| meta->last_addrq = -1; | ||
| meta->first_lineno = GET_MEMBER(int, code_object, unwinder->debug_offsets.code_object.firstlineno); | ||
| meta->addr_code_adaptive = real_address + (uintptr_t)unwinder->debug_offsets.code_object.co_code_adaptive; | ||
| @@ -482,6 +484,12 @@ parse_code_object(RemoteUnwinderObject *unwinder, | ||
| addrq = (uint16_t *)ip - (uint16_t *)meta->addr_code_adaptive; | ||
| #endif | ||
| ; // Empty statement to avoid C23 extension warning | ||
| if (!unwinder->opcodes && meta->last_frame_info != NULL && meta->last_addrq == addrq) { | ||
pablogsal marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| *result = Py_NewRef(meta->last_frame_info); | ||
| return 0; | ||
| } | ||
| LocationInfo info = {0}; | ||
| bool ok = parse_linetable(addrq, PyBytes_AS_STRING(meta->linetable), | ||
| PyBytes_GET_SIZE(meta->linetable), | ||
| @@ -529,6 +537,11 @@ parse_code_object(RemoteUnwinderObject *unwinder, | ||
| goto error; | ||
| } | ||
| if (!unwinder->opcodes) { | ||
| Py_XSETREF(meta->last_frame_info, Py_NewRef(tuple)); | ||
| meta->last_addrq = addrq; | ||
| } | ||
| *result = tuple; | ||
| return 0; | ||
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.
But this is also per interpreter, or not?
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.
This is notactually per-interpreter:
code_object_cacheis a single hashtable on the unwinder, keyed by the remote code object's address. It's shared across all interpreters in the target process.