|
23 | 23 | raise unittest.SkipTest("test crash randomly on ASAN/MSAN/UBSAN build") |
24 | 24 |
|
25 | 25 |
|
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 | | - |
35 | 26 | def supports_trampoline_profiling(): |
36 | 27 | perf_trampoline = sysconfig.get_config_var("PY_HAVE_PERF_TRAMPOLINE") |
37 | 28 | if not perf_trampoline: |
@@ -238,7 +229,7 @@ def is_unwinding_reliable_with_frame_pointers(): |
238 | 229 | cflags = sysconfig.get_config_var("PY_CORE_CFLAGS") |
239 | 230 | if not cflags: |
240 | 231 | return False |
241 | | - return "no-omit-frame-pointer" in cflags |
| 232 | + return "no-omit-frame-pointer" in cflags and "_Py_JIT" not in cflags |
242 | 233 |
|
243 | 234 |
|
244 | 235 | def perf_command_works(): |
@@ -391,7 +382,6 @@ def baz(n): |
391 | 382 | self.assertNotIn(f"py::bar:{script}", stdout) |
392 | 383 | self.assertNotIn(f"py::baz:{script}", stdout) |
393 | 384 |
|
394 | | - |
395 | 385 | @unittest.skipUnless(perf_command_works(), "perf command doesn't work") |
396 | 386 | @unittest.skipUnless( |
397 | 387 | is_unwinding_reliable_with_frame_pointers(), |
@@ -504,9 +494,7 @@ def _is_perf_version_at_least(major, minor): |
504 | 494 |
|
505 | 495 |
|
506 | 496 | @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") |
510 | 498 | class TestPerfProfilerWithDwarf(unittest.TestCase, TestPerfProfilerMixin): |
511 | 499 | def run_perf(self, script_dir, script, activate_trampoline=True): |
512 | 500 | if activate_trampoline: |
|
0 commit comments