diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-05-08 14:50:24 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.ru> | 2022-05-08 14:50:24 +0300 |
commit | 47f77dd72345a996fc6b396a364d24253bd35944 (patch) | |
tree | f26f14a025ea7519f7615fecd72adcec2b1221df /contrib/libs/jemalloc | |
parent | 830eb9b3d7e50b775628321023cf08319eeae176 (diff) | |
download | ydb-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')
-rw-r--r-- | contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_defs-linux.h | 4 | ||||
-rw-r--r-- | contrib/libs/jemalloc/src/prof.c | 22 |
2 files changed, 7 insertions, 19 deletions
diff --git a/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_defs-linux.h b/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_defs-linux.h index 28cc151f07e..5ded1075336 100644 --- a/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_defs-linux.h +++ b/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_defs-linux.h @@ -148,10 +148,10 @@ #define JEMALLOC_PROF /* Use libunwind for profile backtracing if defined. */ -#define JEMALLOC_PROF_LIBUNWIND +/* #undef JEMALLOC_PROF_LIBUNWIND */ /* Use libgcc for profile backtracing if defined. */ -/* #undef JEMALLOC_PROF_LIBGCC */ +#define JEMALLOC_PROF_LIBGCC /* Use gcc intrinsics for profile backtracing if defined. */ /* #undef JEMALLOC_PROF_GCC */ diff --git a/contrib/libs/jemalloc/src/prof.c b/contrib/libs/jemalloc/src/prof.c index da834b54fb1..13334cb4c0b 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 |