• Home
  • Raw
  • Download

Lines Matching refs:tsd

125 static void	prof_tctx_destroy(tsd_t *tsd, prof_tctx_t *tctx);
128 static void prof_tdata_destroy(tsd_t *tsd, prof_tdata_t *tdata,
197 prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated) in rb_gen()
210 tdata = prof_tdata_get(tsd, true); in rb_gen()
216 malloc_mutex_lock(tsd_tsdn(tsd), tctx->tdata->lock); in rb_gen()
218 if (prof_tctx_should_destroy(tsd_tsdn(tsd), tctx)) in rb_gen()
219 prof_tctx_destroy(tsd, tctx); in rb_gen()
221 malloc_mutex_unlock(tsd_tsdn(tsd), tctx->tdata->lock); in rb_gen()
244 prof_free_sampled_object(tsd_t *tsd, size_t usize, prof_tctx_t *tctx) in prof_free_sampled_object() argument
247 malloc_mutex_lock(tsd_tsdn(tsd), tctx->tdata->lock); in prof_free_sampled_object()
253 if (prof_tctx_should_destroy(tsd_tsdn(tsd), tctx)) in prof_free_sampled_object()
254 prof_tctx_destroy(tsd, tctx); in prof_free_sampled_object()
256 malloc_mutex_unlock(tsd_tsdn(tsd), tctx->tdata->lock); in prof_free_sampled_object()
270 prof_enter(tsd_t *tsd, prof_tdata_t *tdata) in prof_enter() argument
274 assert(tdata == prof_tdata_get(tsd, false)); in prof_enter()
281 malloc_mutex_lock(tsd_tsdn(tsd), &bt2gctx_mtx); in prof_enter()
285 prof_leave(tsd_t *tsd, prof_tdata_t *tdata) in prof_leave() argument
289 assert(tdata == prof_tdata_get(tsd, false)); in prof_leave()
291 malloc_mutex_unlock(tsd_tsdn(tsd), &bt2gctx_mtx); in prof_leave()
304 prof_idump(tsd_tsdn(tsd)); in prof_leave()
306 prof_gdump(tsd_tsdn(tsd)); in prof_leave()
576 prof_gctx_try_destroy(tsd_t *tsd, prof_tdata_t *tdata_self, prof_gctx_t *gctx, in prof_gctx_try_destroy() argument
589 prof_enter(tsd, tdata_self); in prof_gctx_try_destroy()
590 malloc_mutex_lock(tsd_tsdn(tsd), gctx->lock); in prof_gctx_try_destroy()
594 if (ckh_remove(tsd, &bt2gctx, &gctx->bt, NULL, NULL)) in prof_gctx_try_destroy()
596 prof_leave(tsd, tdata_self); in prof_gctx_try_destroy()
598 malloc_mutex_unlock(tsd_tsdn(tsd), gctx->lock); in prof_gctx_try_destroy()
599 idalloctm(tsd_tsdn(tsd), gctx, NULL, true, true); in prof_gctx_try_destroy()
606 malloc_mutex_unlock(tsd_tsdn(tsd), gctx->lock); in prof_gctx_try_destroy()
607 prof_leave(tsd, tdata_self); in prof_gctx_try_destroy()
640 prof_tctx_destroy(tsd_t *tsd, prof_tctx_t *tctx) in prof_tctx_destroy() argument
646 malloc_mutex_assert_owner(tsd_tsdn(tsd), tctx->tdata->lock); in prof_tctx_destroy()
654 ckh_remove(tsd, &tdata->bt2tctx, &gctx->bt, NULL, NULL); in prof_tctx_destroy()
655 destroy_tdata = prof_tdata_should_destroy(tsd_tsdn(tsd), tdata, false); in prof_tctx_destroy()
656 malloc_mutex_unlock(tsd_tsdn(tsd), tdata->lock); in prof_tctx_destroy()
658 malloc_mutex_lock(tsd_tsdn(tsd), gctx->lock); in prof_tctx_destroy()
698 malloc_mutex_unlock(tsd_tsdn(tsd), gctx->lock); in prof_tctx_destroy()
700 prof_gctx_try_destroy(tsd, prof_tdata_get(tsd, false), gctx, in prof_tctx_destroy()
704 malloc_mutex_assert_not_owner(tsd_tsdn(tsd), tctx->tdata->lock); in prof_tctx_destroy()
707 prof_tdata_destroy(tsd, tdata, false); in prof_tctx_destroy()
710 idalloctm(tsd_tsdn(tsd), tctx, NULL, true, true); in prof_tctx_destroy()
714 prof_lookup_global(tsd_t *tsd, prof_bt_t *bt, prof_tdata_t *tdata, in prof_lookup_global() argument
727 prof_enter(tsd, tdata); in prof_lookup_global()
730 gctx.p = prof_gctx_create(tsd_tsdn(tsd), bt); in prof_lookup_global()
732 prof_leave(tsd, tdata); in prof_lookup_global()
736 if (ckh_insert(tsd, &bt2gctx, btkey.v, gctx.v)) { in prof_lookup_global()
738 prof_leave(tsd, tdata); in prof_lookup_global()
739 idalloctm(tsd_tsdn(tsd), gctx.v, NULL, true, true); in prof_lookup_global()
748 malloc_mutex_lock(tsd_tsdn(tsd), gctx.p->lock); in prof_lookup_global()
750 malloc_mutex_unlock(tsd_tsdn(tsd), gctx.p->lock); in prof_lookup_global()
753 prof_leave(tsd, tdata); in prof_lookup_global()
762 prof_lookup(tsd_t *tsd, prof_bt_t *bt) in prof_lookup() argument
773 tdata = prof_tdata_get(tsd, false); in prof_lookup()
777 malloc_mutex_lock(tsd_tsdn(tsd), tdata->lock); in prof_lookup()
781 malloc_mutex_unlock(tsd_tsdn(tsd), tdata->lock); in prof_lookup()
791 if (prof_lookup_global(tsd, bt, tdata, &btkey, &gctx, in prof_lookup()
796 ret.v = iallocztm(tsd_tsdn(tsd), sizeof(prof_tctx_t), in prof_lookup()
798 arena_ichoose(tsd, NULL), true); in prof_lookup()
801 prof_gctx_try_destroy(tsd, tdata, gctx, tdata); in prof_lookup()
812 malloc_mutex_lock(tsd_tsdn(tsd), tdata->lock); in prof_lookup()
813 error = ckh_insert(tsd, &tdata->bt2tctx, btkey, ret.v); in prof_lookup()
814 malloc_mutex_unlock(tsd_tsdn(tsd), tdata->lock); in prof_lookup()
817 prof_gctx_try_destroy(tsd, tdata, gctx, tdata); in prof_lookup()
818 idalloctm(tsd_tsdn(tsd), ret.v, NULL, true, true); in prof_lookup()
821 malloc_mutex_lock(tsd_tsdn(tsd), gctx->lock); in prof_lookup()
825 malloc_mutex_unlock(tsd_tsdn(tsd), gctx->lock); in prof_lookup()
917 tsd_t *tsd; in prof_bt_count() local
920 tsd = tsd_fetch(); in prof_bt_count()
921 tdata = prof_tdata_get(tsd, false); in prof_bt_count()
925 malloc_mutex_lock(tsd_tsdn(tsd), &bt2gctx_mtx); in prof_bt_count()
927 malloc_mutex_unlock(tsd_tsdn(tsd), &bt2gctx_mtx); in prof_bt_count()
1212 prof_gctx_finish(tsd_t *tsd, prof_gctx_tree_t *gctxs) in prof_gctx_finish() argument
1214 prof_tdata_t *tdata = prof_tdata_get(tsd, false); in prof_gctx_finish()
1225 malloc_mutex_lock(tsd_tsdn(tsd), gctx->lock); in prof_gctx_finish()
1234 (void *)tsd_tsdn(tsd)); in prof_gctx_finish()
1240 idalloctm(tsd_tsdn(tsd), to_destroy, in prof_gctx_finish()
1249 malloc_mutex_unlock(tsd_tsdn(tsd), gctx->lock); in prof_gctx_finish()
1250 prof_gctx_try_destroy(tsd, tdata, gctx, tdata); in prof_gctx_finish()
1252 malloc_mutex_unlock(tsd_tsdn(tsd), gctx->lock); in prof_gctx_finish()
1545 prof_dump(tsd_t *tsd, bool propagate_err, const char *filename, bool leakcheck) in prof_dump() argument
1560 tdata = prof_tdata_get(tsd, true); in prof_dump()
1564 malloc_mutex_lock(tsd_tsdn(tsd), &prof_dump_mtx); in prof_dump()
1565 prof_enter(tsd, tdata); in prof_dump()
1573 prof_dump_gctx_prep(tsd_tsdn(tsd), gctx.p, &gctxs); in prof_dump()
1579 prof_tdata_merge_iter_arg.tsdn = tsd_tsdn(tsd); in prof_dump()
1581 malloc_mutex_lock(tsd_tsdn(tsd), &tdatas_mtx); in prof_dump()
1584 malloc_mutex_unlock(tsd_tsdn(tsd), &tdatas_mtx); in prof_dump()
1587 prof_gctx_merge_iter_arg.tsdn = tsd_tsdn(tsd); in prof_dump()
1592 prof_leave(tsd, tdata); in prof_dump()
1599 if (prof_dump_header(tsd_tsdn(tsd), propagate_err, in prof_dump()
1604 prof_gctx_dump_iter_arg.tsdn = tsd_tsdn(tsd); in prof_dump()
1617 prof_gctx_finish(tsd, &gctxs); in prof_dump()
1618 malloc_mutex_unlock(tsd_tsdn(tsd), &prof_dump_mtx); in prof_dump()
1628 prof_gctx_finish(tsd, &gctxs); in prof_dump()
1629 malloc_mutex_unlock(tsd_tsdn(tsd), &prof_dump_mtx); in prof_dump()
1658 tsd_t *tsd; in prof_fdump() local
1667 tsd = tsd_fetch(); in prof_fdump()
1669 malloc_mutex_lock(tsd_tsdn(tsd), &prof_dump_seq_mtx); in prof_fdump()
1671 malloc_mutex_unlock(tsd_tsdn(tsd), &prof_dump_seq_mtx); in prof_fdump()
1672 prof_dump(tsd, false, filename, opt_prof_leak); in prof_fdump()
1678 tsd_t *tsd; in prof_idump() local
1685 tsd = tsdn_tsd(tsdn); in prof_idump()
1686 tdata = prof_tdata_get(tsd, false); in prof_idump()
1696 malloc_mutex_lock(tsd_tsdn(tsd), &prof_dump_seq_mtx); in prof_idump()
1699 malloc_mutex_unlock(tsd_tsdn(tsd), &prof_dump_seq_mtx); in prof_idump()
1700 prof_dump(tsd, false, filename, false); in prof_idump()
1705 prof_mdump(tsd_t *tsd, const char *filename) in prof_mdump() argument
1718 malloc_mutex_lock(tsd_tsdn(tsd), &prof_dump_seq_mtx); in prof_mdump()
1721 malloc_mutex_unlock(tsd_tsdn(tsd), &prof_dump_seq_mtx); in prof_mdump()
1724 return (prof_dump(tsd, true, filename, false)); in prof_mdump()
1730 tsd_t *tsd; in prof_gdump() local
1737 tsd = tsdn_tsd(tsdn); in prof_gdump()
1738 tdata = prof_tdata_get(tsd, false); in prof_gdump()
1752 prof_dump(tsd, false, filename, false); in prof_gdump()
1793 prof_tdata_init_impl(tsd_t *tsd, uint64_t thr_uid, uint64_t thr_discrim, in prof_tdata_init_impl() argument
1801 tdata = (prof_tdata_t *)iallocztm(tsd_tsdn(tsd), sizeof(prof_tdata_t), in prof_tdata_init_impl()
1815 if (ckh_new(tsd, &tdata->bt2tctx, PROF_CKH_MINITEMS, prof_bt_hash, in prof_tdata_init_impl()
1817 idalloctm(tsd_tsdn(tsd), tdata, NULL, true, true); in prof_tdata_init_impl()
1831 malloc_mutex_lock(tsd_tsdn(tsd), &tdatas_mtx); in prof_tdata_init_impl()
1833 malloc_mutex_unlock(tsd_tsdn(tsd), &tdatas_mtx); in prof_tdata_init_impl()
1839 prof_tdata_init(tsd_t *tsd) in prof_tdata_init() argument
1842 return (prof_tdata_init_impl(tsd, prof_thr_uid_alloc(tsd_tsdn(tsd)), 0, in prof_tdata_init()
1843 NULL, prof_thread_active_init_get(tsd_tsdn(tsd)))); in prof_tdata_init()
1868 prof_tdata_destroy_locked(tsd_t *tsd, prof_tdata_t *tdata, in prof_tdata_destroy_locked() argument
1872 malloc_mutex_assert_owner(tsd_tsdn(tsd), &tdatas_mtx); in prof_tdata_destroy_locked()
1879 idalloctm(tsd_tsdn(tsd), tdata->thread_name, NULL, true, true); in prof_tdata_destroy_locked()
1880 ckh_delete(tsd, &tdata->bt2tctx); in prof_tdata_destroy_locked()
1881 idalloctm(tsd_tsdn(tsd), tdata, NULL, true, true); in prof_tdata_destroy_locked()
1885 prof_tdata_destroy(tsd_t *tsd, prof_tdata_t *tdata, bool even_if_attached) in prof_tdata_destroy() argument
1888 malloc_mutex_lock(tsd_tsdn(tsd), &tdatas_mtx); in prof_tdata_destroy()
1889 prof_tdata_destroy_locked(tsd, tdata, even_if_attached); in prof_tdata_destroy()
1890 malloc_mutex_unlock(tsd_tsdn(tsd), &tdatas_mtx); in prof_tdata_destroy()
1894 prof_tdata_detach(tsd_t *tsd, prof_tdata_t *tdata) in prof_tdata_detach() argument
1898 malloc_mutex_lock(tsd_tsdn(tsd), tdata->lock); in prof_tdata_detach()
1900 destroy_tdata = prof_tdata_should_destroy(tsd_tsdn(tsd), tdata, in prof_tdata_detach()
1908 tsd_prof_tdata_set(tsd, NULL); in prof_tdata_detach()
1911 malloc_mutex_unlock(tsd_tsdn(tsd), tdata->lock); in prof_tdata_detach()
1913 prof_tdata_destroy(tsd, tdata, true); in prof_tdata_detach()
1917 prof_tdata_reinit(tsd_t *tsd, prof_tdata_t *tdata) in prof_tdata_reinit() argument
1922 prof_thread_name_alloc(tsd_tsdn(tsd), tdata->thread_name) : NULL; in prof_tdata_reinit()
1925 prof_tdata_detach(tsd, tdata); in prof_tdata_reinit()
1926 return (prof_tdata_init_impl(tsd, thr_uid, thr_discrim, thread_name, in prof_tdata_reinit()
1956 prof_reset(tsd_t *tsd, size_t lg_sample) in prof_reset() argument
1962 malloc_mutex_lock(tsd_tsdn(tsd), &prof_dump_mtx); in prof_reset()
1963 malloc_mutex_lock(tsd_tsdn(tsd), &tdatas_mtx); in prof_reset()
1970 prof_tdata_reset_iter, (void *)tsd); in prof_reset()
1973 prof_tdata_destroy_locked(tsd, to_destroy, false); in prof_reset()
1978 malloc_mutex_unlock(tsd_tsdn(tsd), &tdatas_mtx); in prof_reset()
1979 malloc_mutex_unlock(tsd_tsdn(tsd), &prof_dump_mtx); in prof_reset()
1983 prof_tdata_cleanup(tsd_t *tsd) in prof_tdata_cleanup() argument
1990 tdata = tsd_prof_tdata_get(tsd); in prof_tdata_cleanup()
1992 prof_tdata_detach(tsd, tdata); in prof_tdata_cleanup()
2019 prof_thread_name_get(tsd_t *tsd) in prof_thread_name_get() argument
2023 tdata = prof_tdata_get(tsd, true); in prof_thread_name_get()
2051 prof_thread_name_set(tsd_t *tsd, const char *thread_name) in prof_thread_name_set() argument
2057 tdata = prof_tdata_get(tsd, true); in prof_thread_name_set()
2070 s = prof_thread_name_alloc(tsd_tsdn(tsd), thread_name); in prof_thread_name_set()
2075 idalloctm(tsd_tsdn(tsd), tdata->thread_name, NULL, true, true); in prof_thread_name_set()
2084 prof_thread_active_get(tsd_t *tsd) in prof_thread_active_get() argument
2088 tdata = prof_tdata_get(tsd, true); in prof_thread_active_get()
2095 prof_thread_active_set(tsd_t *tsd, bool active) in prof_thread_active_set() argument
2099 tdata = prof_tdata_get(tsd, true); in prof_thread_active_set()
2189 prof_boot2(tsd_t *tsd) in prof_boot2() argument
2215 if (ckh_new(tsd, &bt2gctx, PROF_CKH_MINITEMS, prof_bt_hash, in prof_boot2()
2246 gctx_locks = (malloc_mutex_t *)base_alloc(tsd_tsdn(tsd), in prof_boot2()
2256 tdata_locks = (malloc_mutex_t *)base_alloc(tsd_tsdn(tsd), in prof_boot2()