Commit graph

19 commits

Author SHA1 Message Date
Miss Islington (bot)
4d025a2318
[3.14] gh-136476: Show the full stack in get_async_stack_trace in _remote_debugging (GH-136483) (#136490)
gh-136476: Show the full stack in get_async_stack_trace in _remote_debugging (GH-136483)
(cherry picked from commit ea45a2f97c)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-07-10 00:57:40 +01:00
Miss Islington (bot)
78c1227381
[3.14] gh-136186: Fix race condition in test_external_inspection.test_only_active_thread (GH-136347) (#136416) 2025-07-08 12:48:03 +00:00
Pablo Galindo Salgado
c66b54f361
[3.14] gh-91048: Fix external inspection multi-threaded performance (GH-136005) (#136080)
(cherry picked from commit 5334732f9c)
2025-06-28 19:12:54 +01:00
Miss Islington (bot)
f8f99b1cfc
[3.14] gh-135371: Fix asyncio introspection output to include internal coroutine chains (GH-135436) (#135509)
gh-135371: Fix asyncio introspection output to include internal coroutine chains (GH-135436)
(cherry picked from commit 028309fb47)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-06-15 18:38:56 +00:00
Miss Islington (bot)
f303532857
[3.14] gh-91048: Reorder result tuple of parse_code_object (GH-134898) (#134956)
* gh-91048:  Reorder result tuple of parse_code_object (GH-134898)

Reorder result tuple of parse_code_object

The standard followed by APIs like pstat.Stats is to take a file, line,
function triplet. The parse_code_object function (and callers exposing
this in Python like RemoteUnwinder.get_stack_trace) return function,
file, line triplets which requires the caller to reorder these when
using it in classes like pstat.Stats.
(cherry picked from commit 8e8786f898)

Co-authored-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>

* Reorder asyncio

---------

Co-authored-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2025-06-11 01:33:46 +00:00
Miss Islington (bot)
aded785b8c
[3.14] gh-91048: Add better error messages for remote debugging for CI builds (GH-134682) (#134719) 2025-05-26 15:04:36 +00:00
Pablo Galindo Salgado
1822f33b1a
[3.14] gh-91048: Refactor and optimize remote debugging module (#134652) (#134673)
gh-91048: Refactor and optimize remote debugging module (#134652)

Completely refactor Modules/_remote_debugging_module.c with improved
code organization, replacing scattered reference counting and error
handling with centralized goto error paths. This cleanup improves
maintainability and reduces code duplication throughout the module while
preserving the same external API.

Implement memory page caching optimization in Python/remote_debug.h to
avoid repeated reads of the same memory regions during debugging
operations. The cache stores previously read memory pages and reuses
them for subsequent reads, significantly reducing system calls and
improving performance.

Add code object caching mechanism with a new code_object_generation
field in the interpreter state that tracks when code object caches need
invalidation. This allows efficient reuse of parsed code object metadata
and eliminates redundant processing of the same code objects across
debugging sessions.

Optimize memory operations by replacing multiple individual structure
copies with single bulk reads for the same data structures. This reduces
the number of memory operations and system calls required to gather
debugging information from the target process.

Update Makefile.pre.in to include Python/remote_debug.h in the headers
list, ensuring that changes to the remote debugging header force proper
recompilation of dependent modules and maintain build consistency across
the codebase.

Also, make the module compatible with the free threading build as an extra :)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>

(cherry picked from commit 42b25ad4d3)
2025-05-25 22:10:20 +00:00
Victor Stinner
8d5f3cd2ce
gh-133419: fix test_external_inspection race assert (#133433)
Follow-up of commit c4cc5d58ae,
fix more tests.
2025-05-05 12:38:51 +00:00
Gregory P. Smith
c4cc5d58ae
[GH-133419] fix test_external_inspection race assert (#133422)
[tests] fix test_external_inspection race assert

either line could be where the inspection finds the foo()
function as after ready is sent, the process may not have made progress
onto the next line yet.  "solve" by putting the statements on the same
line.
2025-05-05 04:41:22 +00:00
Adam Turner
3f80165a26
GH-91048: Minor fixes for `_remotedebugging & rename to _remote_debugging` (#133398) 2025-05-05 02:30:14 +02:00
Pablo Galindo Salgado
3109c47be8
gh-91048: Add filename and line number to external inspection routines (GH-133385)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2025-05-04 23:33:37 +02:00
Pablo Galindo Salgado
8eaaf16402
gh-91048: Relax test_async_global_awaited_by to fix flakyness (#133368)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2025-05-04 16:52:20 +00:00
Pablo Galindo Salgado
2bc8365231
GH-91048: Add utils for printing the call stack for asyncio tasks (#133284) 2025-05-04 00:51:57 +00:00
Pablo Galindo Salgado
e8cf3a1a64
gh-91048: Refactor _testexternalinspection and add Windows support (#132852) 2025-04-25 14:12:16 +01:00
Łukasz Langa
c9bc458d30
gh-91048: Add ability to list all pending asyncio tasks in a process remotely (#132807) 2025-04-23 18:22:29 +01:00
Thomas Grainger
fccbfc40b5
gh-129195: use future_add_to_awaited_by/future_discard_from_awaited_by in asyncio.staggered.staggered_race (#129253)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-26 21:14:16 +05:30
Yury Selivanov
188598851d
GH-91048: Add utils for capturing async call stack for asyncio programs and enable profiling (#124640)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Co-authored-by: Jacob Coffee <jacob@z7x.org>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-01-22 17:25:29 +01:00
Erlend E. Aasland
ea94b3b149
gh-116303: Skip test module dependent tests if test modules are unavailable (#117341) 2024-04-03 15:11:36 +02:00
Pablo Galindo Salgado
1752b51012
gh-115773: Add tests to exercise the _Py_DebugOffsets structure (#115774) 2024-02-28 10:17:34 +00:00