Commit graph

25 commits

Author SHA1 Message Date
Pablo Galindo Salgado
274a26cca8
gh-135953: Simplify GC markers in the tachyon profiler (#141666) 2025-11-17 16:32:08 +00:00
Brandt Bucher
336366fd7c
GH-140643: Add <native> and <GC> frames to the sampling profiler (#141108)
- Introduce a new field in the GC state to store the frame that initiated garbage collection.
- Update RemoteUnwinder to include options for including "<native>" and "<GC>" frames in the stack trace.
- Modify the sampling profiler to accept parameters for controlling the inclusion of native and GC frames.
- Enhance the stack collector to properly format and append these frames during profiling.
- Add tests to verify the correct behavior of the profiler with respect to native and GC frames, including options to exclude them.

Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-11-17 13:39:00 +00:00
Pablo Galindo Salgado
89a914c58d
gh-135953: Add GIL contention markers to sampling profiler Gecko format (#139485)
This commit enhances the Gecko format reporter in the sampling profiler
to include markers for GIL acquisition events.
2025-11-17 12:46:26 +00:00
Victor Stinner
f458ac01ba
Fix compiler warnings in remote debugging (#141060)
Example of fixed warnings on 32-bit Windows:

    Python\remote_debugging.c(24,53): warning C4244: 'function':
    conversion from 'uint64_t' to 'uintptr_t', possible loss of data

    Modules\_remote_debugging_module.c(789,44): warning C4244:
    'function': conversion from 'uint64_t' to 'size_t', possible loss
    of data
2025-11-05 20:18:45 +01:00
Pablo Galindo Salgado
1963e70100
gh-139275: Fix compilation of Modules/_remote_debugging_module.c when the system doesn't have process_vm_readv (#139307) 2025-09-25 00:16:44 +01:00
Pablo Galindo Salgado
67636f72d2
gh-138709: Implement CPU time profiling in profiling.sample (#138710) 2025-09-19 19:17:28 +01:00
Bénédikt Tran
4978bfca10
gh-116946: add Py_TPFLAGS_IMMUTABLETYPE to several internal types (#138582)
The following types are now immutable:

* `_curses_panel.panel`,
* `[posix,nt].ScandirIterator`, `[posix,nt].DirEntry` (exposed in `os.py`),
* `_remote_debugging.RemoteUnwinder`,
* `_tkinter.Tcl_Obj`, `_tkinter.tkapp`, `_tkinter.tktimertoken`,
* `zlib.Compress`, and `zlib.Decompress`.
2025-09-11 09:56:20 +02:00
Pablo Galindo Salgado
03ee060ec8
gh-138385: Sample all interpreters in the tachyon profiler (#138398) 2025-09-09 00:41:08 +01:00
Adam Turner
918e3ba6c0
GH-137623: Use an AC decorator for docstring line length enforcement (#137690) 2025-08-18 18:29:00 +01:00
László Kiss Kollár
4497ad409e
gh-135953: Profile a module or script with sampling profiler (#136777) 2025-08-11 12:36:43 +01:00
Kumar Aditya
b7d722547b
gh-136669: build _asyncio as static module (#136670)
`_asyncio` is now built as a static module so that thread states can be accessed directly via registers and avoids the overhead of function call.
2025-07-16 22:09:08 +05:30
Petr Viktorin
b44316a097
gh-136476: Remove creation of unused list (GH-136494) 2025-07-10 08:12:23 +00:00
Pablo Galindo Salgado
ea45a2f97c
gh-136476: Show the full stack in get_async_stack_trace in _remote_debugging (#136483) 2025-07-09 23:11:17 +00:00
Pablo Galindo Salgado
77d25e5b16
gh-91048: Revert the memory cache removal for remote debugging (#136440)
gh-91048: Reintroduce the memory cache for remote debugging
2025-07-09 00:31:17 +00:00
Pablo Galindo Salgado
5334732f9c
gh-91048: Fix external inspection multi-threaded performance (#136005) 2025-06-28 14:11:31 +01:00
Bénédikt Tran
54e29ea4eb
gh-111178: fix UBSan failures for RemoteUnwinderObject (#135539) 2025-06-15 21:00:58 +02:00
Pablo Galindo Salgado
b9a1b04982
gh-135371: Clean tags from pointers in all cases in remote debugging module (#135534) 2025-06-15 18:32:32 +00:00
Pablo Galindo Salgado
028309fb47
gh-135371: Fix asyncio introspection output to include internal coroutine chains (#135436) 2025-06-14 13:48:25 +01:00
László Kiss Kollár
8e8786f898
gh-91048: Reorder result tuple of parse_code_object (#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.
2025-05-31 00:32:36 +00:00
sobolevn
806107d7a2
gh-134693: Fix [-Wmaybe-uninitialized] warning in _remote_debugging_module.c (#134694) 2025-05-26 16:06:33 +01:00
Pablo Galindo Salgado
0909d6d8e8
gh-91048: Add better error messages for remote debugging for CI builds (#134682) 2025-05-26 15:31:47 +01:00
Pablo Galindo Salgado
42b25ad4d3
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>
2025-05-25 20:19:29 +00:00
Pablo Galindo Salgado
d327159eb4
gh-91048: Fix error path result in _remote_debugging_module (#134347) 2025-05-20 19:54:09 -04:00
László Kiss Kollár
c4ad92e155
Fix typo in get_stack_trace docstring (#134246) 2025-05-19 16:07:39 +00:00
Adam Turner
3f80165a26
GH-91048: Minor fixes for `_remotedebugging & rename to _remote_debugging` (#133398) 2025-05-05 02:30:14 +02:00
Renamed from Modules/_remotedebuggingmodule.c (Browse further)