Skip to content

Commit c468736

Browse files
author
Your Name
committed
Revert "pythongh-124613: Don't run perf tests in JIT builds (python#124792)"
This reverts commit 35541c4.
1 parent 120729d commit c468736

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

Lib/test/test_perf_profiler.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@
2323
raise unittest.SkipTest("test crash randomly on ASAN/MSAN/UBSAN build")
2424

2525

26-
def is_jit_build():
27-
cflags = (sysconfig.get_config_var("PY_CORE_CFLAGS") or '')
28-
return "_Py_JIT" in cflags
29-
30-
31-
if is_jit_build():
32-
raise unittest.SkipTest("Perf support is not available in JIT builds")
33-
34-
3526
def supports_trampoline_profiling():
3627
perf_trampoline = sysconfig.get_config_var("PY_HAVE_PERF_TRAMPOLINE")
3728
if not perf_trampoline:
@@ -238,7 +229,7 @@ def is_unwinding_reliable_with_frame_pointers():
238229
cflags = sysconfig.get_config_var("PY_CORE_CFLAGS")
239230
if not cflags:
240231
return False
241-
return "no-omit-frame-pointer" in cflags
232+
return "no-omit-frame-pointer" in cflags and "_Py_JIT" not in cflags
242233

243234

244235
def perf_command_works():
@@ -391,7 +382,6 @@ def baz(n):
391382
self.assertNotIn(f"py::bar:{script}", stdout)
392383
self.assertNotIn(f"py::baz:{script}", stdout)
393384

394-
395385
@unittest.skipUnless(perf_command_works(), "perf command doesn't work")
396386
@unittest.skipUnless(
397387
is_unwinding_reliable_with_frame_pointers(),
@@ -504,9 +494,7 @@ def _is_perf_version_at_least(major, minor):
504494

505495

506496
@unittest.skipUnless(perf_command_works(), "perf command doesn't work")
507-
@unittest.skipUnless(
508-
_is_perf_version_at_least(6, 6), "perf command may not work due to a perf bug"
509-
)
497+
@unittest.skipUnless(_is_perf_version_at_least(6, 6), "perf command may not work due to a perf bug")
510498
class TestPerfProfilerWithDwarf(unittest.TestCase, TestPerfProfilerMixin):
511499
def run_perf(self, script_dir, script, activate_trampoline=True):
512500
if activate_trampoline:

0 commit comments

Comments
 (0)