8000 gh-124613: Don't run perf tests in JIT builds by pablogsal · Pull Request #124792 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-124613: Don't run perf tests in JIT builds #124792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
16 changes: 14 additions & 2 deletions Lib/test/test_perf_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
raise unittest.SkipTest("test crash randomly on ASAN/MSAN/UBSAN build")


def is_jit_build():
cflags = (sysconfig.get_config_var("PY_CORE_CFLAGS") or '')
return "_Py_JIT" in cflags


if is_jit_build():
raise unittest.SkipTest("Perf support is not available in JIT builds")


def supports_trampoline_profiling():
perf_trampoline = sysconfig.get_config_var("PY_HAVE_PERF_TRAMPOLINE")
if not perf_trampoline:
Expand Down Expand Up @@ -229,7 +238,7 @@ def is_unwinding_reliable_with_frame_pointers():
cflags = sysconfig.get_config_var("PY_CORE_CFLAGS")
if not cflags:
return False
return "no-omit-frame-pointer" in cflags and "_Py_JIT" not in cflags
return "no-omit-frame-pointer" in cflags


def perf_command_works():
Expand Down Expand Up @@ -382,6 +391,7 @@ def baz(n):
self.assertNotIn(f"py::bar:{script}", stdout)
self.assertNotIn(f"py::baz:{script}", stdout)


@unittest.skipUnless(perf_command_works(), "perf command doesn't work")
@unittest.skipUnless(
is_unwinding_reliable_with_frame_pointers(),
Expand Down Expand Up @@ -494,7 +504,9 @@ def _is_perf_version_at_least(major, minor):


@unittest.skipUnless(perf_command_works(), "perf command doesn't work")
@unittest.skipUnless(_is_perf_version_at_least(6, 6), "perf command may not work due to a perf bug")
@unittest.skipUnless(
_is_perf_version_at_least(6, 6), "perf command may not work due to a perf bug"
)
class TestPerfProfilerWithDwarf(unittest.TestCase, TestPerfProfilerMixin):
def run_perf(self, script_dir, script, activate_trampoline=True):
if activate_trampoline:
Expand Down
Loading
0