diff --git a/Misc/NEWS.d/next/Library/2026-05-09-01-30-13.gh-issue-149584.yqz8x3.rst b/Misc/NEWS.d/next/Library/2026-05-09-01-30-13.gh-issue-149584.yqz8x3.rst new file mode 100644 index 00000000000000..491d98eeb333ec --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-05-09-01-30-13.gh-issue-149584.yqz8x3.rst @@ -0,0 +1,2 @@ +Improve the performance of the Tachyon profiler by avoiding full page reads +of remote process memory. Patch by Maurycy Pawłowski-Wieroński. diff --git a/Modules/_remote_debugging/frames.c b/Modules/_remote_debugging/frames.c index bbdfce3f7201d9..7e56576392737b 100644 --- a/Modules/_remote_debugging/frames.c +++ b/Modules/_remote_debugging/frames.c @@ -197,7 +197,7 @@ parse_frame_object( char frame[SIZEOF_INTERP_FRAME]; *address_of_code_object = 0; - Py_ssize_t bytes_read = _Py_RemoteDebug_PagedReadRemoteMemory( + Py_ssize_t bytes_read = _Py_RemoteDebug_ReadRemoteMemory( &unwinder->handle, address, SIZEOF_INTERP_FRAME, diff --git a/Modules/_remote_debugging/module.c b/Modules/_remote_debugging/module.c index 172f8711a2a2a0..f034fbbf15fbc9 100644 --- a/Modules/_remote_debugging/module.c +++ b/Modules/_remote_debugging/module.c @@ -537,7 +537,7 @@ _remote_debugging_RemoteUnwinder_get_stack_trace_impl(RemoteUnwinderObject *self while (current_interpreter != 0) { // Read interpreter state to get the interpreter ID char interp_state_buffer[INTERP_STATE_BUFFER_SIZE]; - if (_Py_RemoteDebug_PagedReadRemoteMemory( + if (_Py_RemoteDebug_ReadRemoteMemory( &self->handle, current_interpreter, INTERP_STATE_BUFFER_SIZE, diff --git a/Modules/_remote_debugging/threads.c b/Modules/_remote_debugging/threads.c index 4daa5e5f92bcd9..31d83f561a8ddf 100644 --- a/Modules/_remote_debugging/threads.c +++ b/Modules/_remote_debugging/threads.c @@ -303,7 +303,7 @@ unwind_stack_for_thread( StackChunkList chunks = {0}; char ts[SIZEOF_THREAD_STATE]; - int bytes_read = _Py_RemoteDebug_PagedReadRemoteMemory( + int bytes_read = _Py_RemoteDebug_ReadRemoteMemory( &unwinder->handle, *current_tstate, (size_t)unwinder->debug_offsets.thread_state.size, ts); if (bytes_read < 0) { set_exception_cause(unwinder, PyExc_RuntimeError, "Failed to read thread state");