Skip to content

Commit 9c72023

Browse files
Address Victor's review
1 parent 31c0eb8 commit 9c72023

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

Doc/howto/perf_profiling.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ As you can see here, the Python functions are not shown in the output, only ``_P
102102
functions use the same C function to evaluate bytecode so we cannot know which Python function corresponds to which
103103
bytecode-evaluating function.
104104

105-
Instead, if we run the same experiment with ``perf`` support activated we get:
105+
Instead, if we run the same experiment with ``perf`` support enabled we get:
106106

107107
.. code-block:: shell-session
108108
@@ -148,10 +148,10 @@ Instead, if we run the same experiment with ``perf`` support activated we get:
148148
149149
150150
151-
How to enable the ``perf`` profiling mode
152-
-----------------------------------------
151+
How to enable ``perf`` profiling support
152+
----------------------------------------
153153

154-
There are three ways to activate the ``perf`` profiling mode:
154+
There are three ways to enable ``perf`` profiling support:
155155

156156
* using the :option:`-Xperf <-X>` command-line option
157157
* using the :envvar:`PYTHONPERFSUPPORT` environment variable
@@ -163,11 +163,11 @@ use the :option:`-Xperf <-X>` option::
163163

164164
$ python -Xperf my_script.py
165165

166-
If you need to activate the ``perf`` profiling mode globally,
166+
If you need to enable ``perf`` profiling support globally,
167167
set the environment variable :envvar:`PYTHONPERFSUPPORT`
168168
to a nonzero value.
169169

170-
If you need to dynamically activate and deactivate the ``perf`` profiling mode
170+
If you need to dynamically enable and disable ``perf`` profiling
171171
in response to a signal or other communication mechanisms with your process,
172172
use the :func:`sys.activate_stack_trampoline` and
173173
:func:`sys.deactivate_stack_trampoline` APIs:

Doc/using/cmdline.rst

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -535,13 +535,11 @@ Miscellaneous options
535535
development (running from the source tree) then the default is "off".
536536
Note that the "importlib_bootstrap" and "importlib_bootstrap_external"
537537
frozen modules are always used, even if this flag is set to "off".
538-
* ``-X perf`` activates compatibility mode with the ``perf`` profiler.
539-
When this option is activated, the Linux ``perf`` profiler will be able to
538+
* ``-X perf`` enables support for the Linux ``perf`` profiler.
539+
When this option is provided, the ``perf`` profiler will be able to
540540
report Python calls. This option is only available on some platforms and
541541
will do nothing if is not supported on the current system. The default value
542-
is "off". See :ref:`perf_profiling` for more details.
543-
This option is equivalent to setting the environment variable
544-
:envvar:`PYTHONPERFSUPPORT` to ``1``.
542+
is "off". See also :envvar:`PYTHONPERFSUPPORT` and :ref:`perf_profiling`.
545543

546544
It also allows passing arbitrary values and retrieving them through the
547545
:data:`sys._xoptions` dictionary.
@@ -1036,14 +1034,13 @@ conflict.
10361034

10371035
.. envvar:: PYTHONPERFSUPPORT
10381036

1039-
If this variable is set to a nonzero value, it activates compatibility mode
1040-
with the ``perf`` profiler so Python calls can be detected by it.
1041-
This is exactly equivalent to setting :option:`-X perf <-X>`
1042-
on the command line.
1037+
If this variable is set to a nonzero value, it enables support for
1038+
the Linux ``perf`` profiler so Python calls can be detected by it.
10431039

1044-
If set to ``0``, disable ``perf`` profiler support.
1040+
If set to ``0``, disable Linux ``perf`` profiler support.
10451041

1046-
See :ref:`perf_profiling` for more details.
1042+
See also the :option:`-X perf <-X>` command-line option
1043+
and :ref:`perf_profiling`.
10471044

10481045
.. versionadded:: 3.12
10491046

0 commit comments

Comments
 (0)