Skip to content

Commit

Permalink
Rename perfjit to use underscores: perf_jit
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed May 7, 2024
1 parent d89201e commit 13f27bb
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ PyConfig
Set by :option:`-X perf <-X>` command-line option and by the
:envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support
with stack pointers and :option:`-X perfjit <-X>` command-line option
with stack pointers and :option:`-X perf_jit <-X>` command-line option
and by the :envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf
support with DWARF JIT information.
Expand Down
4 changes: 2 additions & 2 deletions Doc/howto/perf_profiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ needs to generate unwinding information for every Python function call on the fl
information to unwind the stack and this is a slow process.

To enable this mode, you can use the environment variable :envvar:`PYTHON_PERF_JIT_SUPPORT` or the
:option:`-X perfjit <-X>` option, which will enable the JIT mode for the ``perf`` profiler.
:option:`-X perf_jit <-X>` option, which will enable the JIT mode for the ``perf`` profiler.

When using the perf JIT mode, you need an extra step before you can run ``perf report``. You need to
call the ``perf inject`` command to inject the JIT information into the ``perf.data`` file.

$ perf record -F 9999 -g --call-graph dwarf -o perf.data python -Xperfjit my_script.py
$ perf record -F 9999 -g --call-graph dwarf -o perf.data python -Xperf_jit my_script.py
$ perf inject -i perf.data --jit
$ perf report -g -i perf.data

Expand Down
4 changes: 2 additions & 2 deletions Doc/using/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ Miscellaneous options

.. versionadded:: 3.12

* ``-X perfjit`` enables support for the Linux ``perf`` profiler with DWARF
* ``-X perf_jit`` enables support for the Linux ``perf`` profiler with DWARF
support. When this option is provided, the ``perf`` profiler will be able
to report Python calls using DWARF information. This option is only available on
some platforms and will do nothing if is not supported on the current
Expand Down Expand Up @@ -1145,7 +1145,7 @@ conflict.

If set to ``0``, disable Linux ``perf`` profiler support.

See also the :option:`-X perfjit <-X>` command-line option
See also the :option:`-X perf_jit <-X>` command-line option
and :ref:`perf_profiling`.

.. versionadded:: 3.13
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ Other Language Changes

* Add :ref:`support for the perf profiler <perf_profiling>` working without
frame pointers through the new environment variable
:envvar:`PYTHON_PERF_JIT_SUPPORT` and command-line option :option:`-X perfjit
:envvar:`PYTHON_PERF_JIT_SUPPORT` and command-line option :option:`-X perf_jit
<-X>` (Contributed by Pablo Galindo in :gh:`118518`.)

* The new :envvar:`PYTHON_HISTORY` environment variable can be used to change
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_perf_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ class TestPerfProfilerWithDwarf(unittest.TestCase, TestPerfProfilerMixin):
def run_perf(self, script_dir, script, activate_trampoline=True):
if activate_trampoline:
return run_perf(
script_dir, sys.executable, "-Xperfjit", script, use_jit=True
script_dir, sys.executable, "-Xperf_jit", script, use_jit=True
)
return run_perf(script_dir, sys.executable, script, use_jit=True)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Allow the Linux perf support to work without frame pointers using perf's
advanced JIT support. The feature is activated when using the
``PYTHON_PERF_JIT_SUPPORT`` environment variable or when running Python with
``-Xperfjit``. Patch by Pablo Galindo.
``-Xperf_jit``. Patch by Pablo Galindo.
2 changes: 1 addition & 1 deletion Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ config_init_perf_profiling(PyConfig *config)
config->perf_profiling = 2;
}
}
xoption = config_get_xoption(config, L"perfjit");
xoption = config_get_xoption(config, L"perf_jit");
if (xoption) {
config->perf_profiling = 2;
}
Expand Down
2 changes: 1 addition & 1 deletion Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2294,7 +2294,7 @@ sys_activate_stack_trampoline_impl(PyObject *module, const char *backend)
return NULL;
}
}
else if (strcmp(backend, "perfjit") == 0) {
else if (strcmp(backend, "perf_jit") == 0) {
_PyPerf_Callbacks cur_cb;
_PyPerfTrampoline_GetCallbacks(&cur_cb);
if (cur_cb.write_state != _Py_perfmap_jit_callbacks.write_state) {
Expand Down

0 comments on commit 13f27bb

Please sign in to comment.