gh-118518: Allow perf to work without frame pointers (#112254)

This commit is contained in:
Pablo Galindo Salgado 2024-05-05 03:07:29 +02:00 committed by GitHub
parent 999f0c5122
commit 1b22d801b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 892 additions and 39 deletions

View file

@ -1210,7 +1210,14 @@ init_interp_main(PyThreadState *tstate)
#ifdef PY_HAVE_PERF_TRAMPOLINE
if (config->perf_profiling) {
if (_PyPerfTrampoline_SetCallbacks(&_Py_perfmap_callbacks) < 0 ||
_PyPerf_Callbacks *cur_cb;
if (config->perf_profiling == 1) {
cur_cb = &_Py_perfmap_callbacks;
}
else {
cur_cb = &_Py_perfmap_jit_callbacks;
}
if (_PyPerfTrampoline_SetCallbacks(cur_cb) < 0 ||
_PyPerfTrampoline_Init(config->perf_profiling) < 0) {
return _PyStatus_ERR("can't initialize the perf trampoline");
}