Skip to content
Merged
Prev Previous commit
Next Next commit
Address review: add links to perf wiki, and use bullet points
  • Loading branch information
erlend-aasland committed Aug 30, 2022
commit 31c0eb819c2b951051e5cb12d497db01af28bcd4
19 changes: 11 additions & 8 deletions Doc/howto/perf_profiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ Python support for the Linux ``perf`` profiler

:author: Pablo Galindo

The Linux ``perf`` profiler is a very powerful tool that allows you to profile and
obtain information about the performance of your application. ``perf`` also has
a very vibrant ecosystem of tools that aid with the analysis of the data that it
produces.
`The Linux perf profiler <http://perf.wiki.kernel.org>`_
is a very powerful tool that allows you to profile and obtain
information about the performance of your application.
``perf`` also has a very vibrant ecosystem of tools
that aid with the analysis of the data that it produces.

The main problem with using the ``perf`` profiler with Python applications is that
``perf`` only allows to get information about native symbols, this is, the names of
Expand Down Expand Up @@ -151,10 +152,12 @@ How to enable the ``perf`` profiling mode
-----------------------------------------

There are three ways to activate the ``perf`` profiling mode:
using the :option:`-Xperf <-X>` command-line option,
using the :envvar:`PYTHONPERFSUPPORT` environment variable,
and using the :func:`sys.activate_stack_trampoline` and
:func:`sys.deactivate_stack_trampoline` APIs.

* using the :option:`-Xperf <-X>` command-line option
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated
* using the :envvar:`PYTHONPERFSUPPORT` environment variable
* using the :func:`sys.activate_stack_trampoline` and
:func:`sys.deactivate_stack_trampoline` APIs
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated

If you want profiling to be active when you start the Python interpreter,
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated
use the :option:`-Xperf <-X>` option::

Expand Down
3 changes: 2 additions & 1 deletion Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,8 @@ always available.

.. seealso::

:ref:`perf_profiling`
* :ref:`perf_profiling`
* https://perf.wiki.kernel.org

.. function:: deactivate_stack_trampoline()

Expand Down