8000 gh-96143: Improve perf profiler docs by erlend-aasland · Pull Request #96445 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-96143: Improve perf profiler docs #96445

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

Merged
merged 11 commits into from
Oct 27, 2022
Merged
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
  • Loading branch information
Erlend E. Aasland and ezio-melotti authored Oct 4, 2022
commit db4aaa219f7e1090a44ec6a85f4c929eaf125c59
11 changes: 5 additions & 6 deletions Doc/howto/perf_profiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,11 @@ Instead, if we run the same experiment with ``perf`` support enabled we get:
How to enable ``perf`` profiling support
----------------------------------------

There are three ways to enable ``perf`` profiling support;
the environment variable :envvar:`PYTHONPERFSUPPORT` and the
:option:`-X perf <-X>` option allow you to enable perf profiling from the start,
whereas the :func:`sys.activate_stack_trampoline` and
:func:`sys.deactivate_stack_trampoline` functions allow you to enable and
disable it dynamically.
``perf`` profiling support can either be enabled from the start using
the environment variable :envvar:`PYTHONPERFSUPPORT` or the
:option:`-X perf <-X>` option,
or dynamically using :func:`sys.activate_stack_trampoline` and
:func:`sys.deactivate_stack_trampoline`.

The :mod:`!sys` functions take precedence over the :option:`!-X` option,
the :option:`!-X` option takes precedence over the environment variable.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ always available.
.. function:: activate_stack_trampoline(backend, /)

Activate the stack profiler trampoline *backend*.
The only supported backend is `"perf"`.
The only supported backend is ``"perf"``.

.. availability:: Linux.

Expand Down
0