Lines Matching full:tsd
18 prof_tdata_get(tsd_t *tsd, bool create) { in prof_tdata_get() argument
23 tdata = tsd_prof_tdata_get(tsd); in prof_tdata_get()
26 if (tsd_nominal(tsd)) { in prof_tdata_get()
27 tdata = prof_tdata_init(tsd); in prof_tdata_get()
28 tsd_prof_tdata_set(tsd, tdata); in prof_tdata_get()
31 tdata = prof_tdata_reinit(tsd, tdata); in prof_tdata_get()
32 tsd_prof_tdata_set(tsd, tdata); in prof_tdata_get()
83 prof_sample_check(tsd_t *tsd, size_t usize, bool update) { in prof_sample_check() argument
86 int64_t bytes_until_sample = tsd_bytes_until_sample_get(tsd); in prof_sample_check()
89 if (tsd_nominal(tsd)) { in prof_sample_check()
90 tsd_bytes_until_sample_set(tsd, bytes_until_sample); in prof_sample_check()
101 prof_sample_accum_update(tsd_t *tsd, size_t usize, bool update, in prof_sample_accum_update() argument
108 if (likely(prof_sample_check(tsd, usize, update))) { in prof_sample_accum_update()
112 bool booted = tsd_prof_tdata_get(tsd); in prof_sample_accum_update()
113 tdata = prof_tdata_get(tsd, true); in prof_sample_accum_update()
131 if (!booted && prof_sample_check(tsd, usize, update)) { in prof_sample_accum_update()
135 if (tsd_reentrancy_level_get(tsd) > 0) { in prof_sample_accum_update()
146 prof_alloc_prep(tsd_t *tsd, size_t usize, bool prof_active, bool update) { in prof_alloc_prep() argument
153 if (!prof_active || likely(prof_sample_accum_update(tsd, usize, update, in prof_alloc_prep()
159 ret = prof_lookup(tsd, &bt); in prof_alloc_prep()
181 prof_realloc(tsd_t *tsd, const void *ptr, size_t usize, prof_tctx_t *tctx, in prof_realloc() argument
190 assert(usize == isalloc(tsd_tsdn(tsd), ptr)); in prof_realloc()
191 if (prof_sample_accum_update(tsd, usize, true, NULL)) { in prof_realloc()
199 prof_alloc_rollback(tsd, tctx, true); in prof_realloc()
209 prof_malloc_sample_object(tsd_tsdn(tsd), ptr, usize, tctx); in prof_realloc()
211 prof_tctx_set(tsd_tsdn(tsd), ptr, usize, NULL, in prof_realloc()
220 prof_tctx_reset(tsd_tsdn(tsd), ptr, tctx); in prof_realloc()
222 assert((uintptr_t)prof_tctx_get(tsd_tsdn(tsd), ptr, NULL) == in prof_realloc()
234 prof_free_sampled_object(tsd, ptr, old_usize, old_tctx); in prof_realloc()
239 prof_free(tsd_t *tsd, const void *ptr, size_t usize, alloc_ctx_t *alloc_ctx) { in prof_free() argument
240 prof_tctx_t *tctx = prof_tctx_get(tsd_tsdn(tsd), ptr, alloc_ctx); in prof_free()
243 assert(usize == isalloc(tsd_tsdn(tsd), ptr)); in prof_free()
246 prof_free_sampled_object(tsd, ptr, usize, tctx); in prof_free()