Pass tsd down to prof_backtrace()

This commit is contained in:
Yinan Zhang 2019-09-04 09:24:34 -07:00
parent 671f120e26
commit 93d6151800
4 changed files with 4 additions and 5 deletions

View File

@ -56,7 +56,7 @@ void prof_malloc_sample_object(tsdn_t *tsdn, const void *ptr, size_t usize,
void prof_free_sampled_object(tsd_t *tsd, const void *ptr, size_t usize,
prof_tctx_t *tctx);
void bt_init(prof_bt_t *bt, void **vec);
void prof_backtrace(prof_bt_t *bt);
void prof_backtrace(tsd_t *tsd, prof_bt_t *bt);
prof_tctx_t *prof_lookup(tsd_t *tsd, prof_bt_t *bt);
#ifdef JEMALLOC_JET
size_t prof_tdata_count(void);

View File

@ -155,7 +155,7 @@ prof_alloc_prep(tsd_t *tsd, size_t usize, bool prof_active, bool update) {
ret = (prof_tctx_t *)(uintptr_t)1U;
} else {
bt_init(&bt, tdata->vec);
prof_backtrace(&bt);
prof_backtrace(tsd, &bt);
ret = prof_lookup(tsd, &bt);
}

View File

@ -430,9 +430,8 @@ prof_backtrace_impl(prof_bt_t *bt) {
#endif
void
prof_backtrace(prof_bt_t *bt) {
prof_backtrace(tsd_t *tsd, prof_bt_t *bt) {
cassert(config_prof);
tsd_t *tsd = tsd_fetch();
pre_reentrancy(tsd, NULL);
prof_backtrace_impl(bt);
post_reentrancy(tsd);

View File

@ -246,7 +246,7 @@ prof_try_log(tsd_t *tsd, const void *ptr, size_t usize, prof_tctx_t *tctx) {
prof_bt_t bt;
/* Initialize the backtrace, using the buffer in tdata to store it. */
bt_init(&bt, cons_tdata->vec);
prof_backtrace(&bt);
prof_backtrace(tsd, &bt);
prof_bt_t *cons_bt = &bt;
/* We haven't destroyed tctx yet, so gctx should be good to read. */