summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2024-05-05 01:07:29 (GMT)
committerGitHub <noreply@github.com>2024-05-05 01:07:29 (GMT)
commit1b22d801b86ed314c4804b19a1fc4b13484e3cea (patch)
tree9cb5cea113afe83bb1ce106c565396a7bb344691 /Python/sysmodule.c
parent999f0c512281995fb61a0d9eda075fd846e8c505 (diff)
downloadcpython-1b22d801b86ed314c4804b19a1fc4b13484e3cea.zip
cpython-1b22d801b86ed314c4804b19a1fc4b13484e3cea.tar.gz
cpython-1b22d801b86ed314c4804b19a1fc4b13484e3cea.tar.bz2
gh-118518: Allow perf to work without frame pointers (#112254)
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index bd7f821..17c4a5f 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2282,6 +2282,16 @@ sys_activate_stack_trampoline_impl(PyObject *module, const char *backend)
return NULL;
}
}
+ else if (strcmp(backend, "perfjit") == 0) {
+ _PyPerf_Callbacks cur_cb;
+ _PyPerfTrampoline_GetCallbacks(&cur_cb);
+ if (cur_cb.write_state != _Py_perfmap_jit_callbacks.write_state) {
+ if (_PyPerfTrampoline_SetCallbacks(&_Py_perfmap_jit_callbacks) < 0 ) {
+ PyErr_SetString(PyExc_ValueError, "can't activate perf jit trampoline");
+ return NULL;
+ }
+ }
+ }
}
else {
PyErr_Format(PyExc_ValueError, "invalid backend: %s", backend);