mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
gh-96143: Allow Linux perf profiler to see Python calls (GH-96123)
⚠️ ⚠️ Note for reviewers, hackers and fellow systems/low-level/compiler engineers ⚠️ ⚠️ If you have a lot of experience with this kind of shenanigans and want to improve the **first** version, **please make a PR against my branch** or **reach out by email** or **suggest code changes directly on GitHub**. If you have any **refinements or optimizations** please, wait until the first version is merged before starting hacking or proposing those so we can keep this PR productive.
This commit is contained in:
parent
0f733fffe8
commit
6d791a9736
24 changed files with 1412 additions and 2 deletions
|
@ -535,6 +535,12 @@ Miscellaneous options
|
|||
development (running from the source tree) then the default is "off".
|
||||
Note that the "importlib_bootstrap" and "importlib_bootstrap_external"
|
||||
frozen modules are always used, even if this flag is set to "off".
|
||||
* ``-X perf`` to activate compatibility mode with the ``perf`` profiler.
|
||||
When this option is activated, the Linux ``perf`` profiler will be able to
|
||||
report Python calls. This option is only available on some platforms and
|
||||
will do nothing if is not supported on the current system. The default value
|
||||
is "off". See also :envvar:`PYTHONPERFSUPPORT` and :ref:`perf_profiling`
|
||||
for more information.
|
||||
|
||||
It also allows passing arbitrary values and retrieving them through the
|
||||
:data:`sys._xoptions` dictionary.
|
||||
|
@ -1025,6 +1031,13 @@ conflict.
|
|||
|
||||
.. versionadded:: 3.11
|
||||
|
||||
.. envvar:: PYTHONPERFSUPPORT
|
||||
|
||||
If this variable is set to a nonzero value, it activates compatibility mode
|
||||
with the ``perf`` profiler so Python calls can be detected by it. See the
|
||||
:ref:`perf_profiling` section for more information.
|
||||
|
||||
.. versionadded:: 3.12
|
||||
|
||||
|
||||
Debug-mode variables
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue