aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/jemalloc/src
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.ru>2022-05-08 14:50:24 +0300
committerthegeorg <thegeorg@yandex-team.ru>2022-05-08 14:50:24 +0300
commit47f77dd72345a996fc6b396a364d24253bd35944 (patch)
treef26f14a025ea7519f7615fecd72adcec2b1221df /contrib/libs/jemalloc/src
parent830eb9b3d7e50b775628321023cf08319eeae176 (diff)
downloadydb-47f77dd72345a996fc6b396a364d24253bd35944.tar.gz
Improve some jemalloc patches
* Remove patching context when patching a platform dispatcher * Drop `--enable-prof-libunwind` configure flag which refers to HP libunwind which is not compatible with LLVM one * Remove llvm-libunwind.patch due to proper configuration ref:a360e809f8917459e645913f070b2ef832b3425b
Diffstat (limited to 'contrib/libs/jemalloc/src')
-rw-r--r--contrib/libs/jemalloc/src/prof.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/contrib/libs/jemalloc/src/prof.c b/contrib/libs/jemalloc/src/prof.c
index da834b54fb..13334cb4c0 100644
--- a/contrib/libs/jemalloc/src/prof.c
+++ b/contrib/libs/jemalloc/src/prof.c
@@ -586,29 +586,17 @@ prof_leave(tsd_t *tsd, prof_tdata_t *tdata) {
#ifdef JEMALLOC_PROF_LIBUNWIND
void
prof_backtrace(prof_bt_t *bt) {
- unw_context_t uc;
- unw_cursor_t cursor;
- unsigned i;
- int err;
+ int nframes;
cassert(config_prof);
assert(bt->len == 0);
assert(bt->vec != NULL);
- unw_getcontext(&uc);
- unw_init_local(&cursor, &uc);
-
- /*
- * Iterate over stack frames until there are no more, or until no space
- * remains in bt.
- */
- for (i = 0; i < PROF_BT_MAX; i++) {
- unw_get_reg(&cursor, UNW_REG_IP, (unw_word_t *)&bt->vec[i]);
- bt->len++;
- err = unw_step(&cursor);
- if (err <= 0)
- break;
+ nframes = unw_backtrace(bt->vec, PROF_BT_MAX);
+ if (nframes <= 0) {
+ return;
}
+ bt->len = nframes;
}
#elif (defined(JEMALLOC_PROF_LIBGCC))
static _Unwind_Reason_Code