aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
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 bd7f821931d..17c4a5f46c0 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);