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,
130 static char *prof_thread_name_alloc(tsd_t *tsd, const char *thread_name);
190 prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated) in rb_gen()
203 tdata = prof_tdata_get(tsd, true); in rb_gen()
212 prof_tctx_destroy(tsd, tctx); in rb_gen()
236 prof_free_sampled_object(tsd_t *tsd, size_t usize, prof_tctx_t *tctx) in prof_free_sampled_object() argument
246 prof_tctx_destroy(tsd, tctx); in prof_free_sampled_object()
262 prof_enter(tsd_t *tsd, prof_tdata_t *tdata) in prof_enter() argument
266 assert(tdata == prof_tdata_get(tsd, false)); in prof_enter()
277 prof_leave(tsd_t *tsd, prof_tdata_t *tdata) in prof_leave() argument
281 assert(tdata == prof_tdata_get(tsd, false)); in prof_leave()
542 prof_gctx_create(tsd_t *tsd, prof_bt_t *bt) in prof_gctx_create() argument
547 prof_gctx_t *gctx = (prof_gctx_t *)iallocztm(tsd, offsetof(prof_gctx_t, in prof_gctx_create()
548 vec) + (bt->len * sizeof(void *)), false, tcache_get(tsd, true), in prof_gctx_create()
567 prof_gctx_try_destroy(tsd_t *tsd, prof_tdata_t *tdata_self, prof_gctx_t *gctx, in prof_gctx_try_destroy() argument
580 prof_enter(tsd, tdata_self); in prof_gctx_try_destroy()
585 if (ckh_remove(tsd, &bt2gctx, &gctx->bt, NULL, NULL)) in prof_gctx_try_destroy()
587 prof_leave(tsd, tdata_self); in prof_gctx_try_destroy()
590 idalloctm(tsd, gctx, tcache_get(tsd, false), true); in prof_gctx_try_destroy()
598 prof_leave(tsd, tdata_self); in prof_gctx_try_destroy()
631 prof_tctx_destroy(tsd_t *tsd, prof_tctx_t *tctx) in prof_tctx_destroy() argument
643 ckh_remove(tsd, &tdata->bt2tctx, &gctx->bt, NULL, NULL); in prof_tctx_destroy()
689 prof_gctx_try_destroy(tsd, prof_tdata_get(tsd, false), gctx, in prof_tctx_destroy()
694 prof_tdata_destroy(tsd, tdata, false); in prof_tctx_destroy()
697 idalloctm(tsd, tctx, tcache_get(tsd, false), true); in prof_tctx_destroy()
701 prof_lookup_global(tsd_t *tsd, prof_bt_t *bt, prof_tdata_t *tdata, in prof_lookup_global() argument
714 prof_enter(tsd, tdata); in prof_lookup_global()
717 gctx.p = prof_gctx_create(tsd, bt); in prof_lookup_global()
719 prof_leave(tsd, tdata); in prof_lookup_global()
723 if (ckh_insert(tsd, &bt2gctx, btkey.v, gctx.v)) { in prof_lookup_global()
725 prof_leave(tsd, tdata); in prof_lookup_global()
726 idalloctm(tsd, gctx.v, tcache_get(tsd, false), true); in prof_lookup_global()
740 prof_leave(tsd, tdata); in prof_lookup_global()
749 prof_lookup(tsd_t *tsd, prof_bt_t *bt) in prof_lookup() argument
760 tdata = prof_tdata_get(tsd, false); in prof_lookup()
779 if (prof_lookup_global(tsd, bt, tdata, &btkey, &gctx, in prof_lookup()
784 tcache = tcache_get(tsd, true); in prof_lookup()
785 ret.v = iallocztm(tsd, sizeof(prof_tctx_t), false, tcache, true, in prof_lookup()
789 prof_gctx_try_destroy(tsd, tdata, gctx, tdata); in prof_lookup()
800 error = ckh_insert(tsd, &tdata->bt2tctx, btkey, ret.v); in prof_lookup()
804 prof_gctx_try_destroy(tsd, tdata, gctx, tdata); in prof_lookup()
805 idalloctm(tsd, ret.v, tcache, true); in prof_lookup()
903 tsd_t *tsd; in prof_bt_count() local
906 tsd = tsd_fetch(); in prof_bt_count()
907 tdata = prof_tdata_get(tsd, false); in prof_bt_count()
1166 prof_gctx_finish(tsd_t *tsd, prof_gctx_tree_t *gctxs) in prof_gctx_finish() argument
1168 prof_tdata_t *tdata = prof_tdata_get(tsd, false); in prof_gctx_finish()
1193 idalloctm(tsd, to_destroy, in prof_gctx_finish()
1194 tcache_get(tsd, false), true); in prof_gctx_finish()
1203 prof_gctx_try_destroy(tsd, tdata, gctx, tdata); in prof_gctx_finish()
1446 prof_dump(tsd_t *tsd, bool propagate_err, const char *filename, bool leakcheck) in prof_dump() argument
1460 tdata = prof_tdata_get(tsd, true); in prof_dump()
1465 prof_enter(tsd, tdata); in prof_dump()
1488 prof_leave(tsd, tdata); in prof_dump()
1510 prof_gctx_finish(tsd, &gctxs); in prof_dump()
1520 prof_gctx_finish(tsd, &gctxs); in prof_dump()
1550 tsd_t *tsd; in prof_fdump() local
1559 tsd = tsd_fetch(); in prof_fdump()
1564 prof_dump(tsd, false, filename, opt_prof_leak); in prof_fdump()
1570 tsd_t *tsd; in prof_idump() local
1578 tsd = tsd_fetch(); in prof_idump()
1579 tdata = prof_tdata_get(tsd, false); in prof_idump()
1592 prof_dump(tsd, false, filename, false); in prof_idump()
1599 tsd_t *tsd; in prof_mdump() local
1606 tsd = tsd_fetch(); in prof_mdump()
1618 return (prof_dump(tsd, true, filename, false)); in prof_mdump()
1624 tsd_t *tsd; in prof_gdump() local
1632 tsd = tsd_fetch(); in prof_gdump()
1633 tdata = prof_tdata_get(tsd, false); in prof_gdump()
1646 prof_dump(tsd, false, filename, false); in prof_gdump()
1687 prof_tdata_init_impl(tsd_t *tsd, uint64_t thr_uid, uint64_t thr_discrim, in prof_tdata_init_impl() argument
1696 tcache = tcache_get(tsd, true); in prof_tdata_init_impl()
1697 tdata = (prof_tdata_t *)iallocztm(tsd, sizeof(prof_tdata_t), false, in prof_tdata_init_impl()
1710 if (ckh_new(tsd, &tdata->bt2tctx, PROF_CKH_MINITEMS, in prof_tdata_init_impl()
1712 idalloctm(tsd, tdata, tcache, true); in prof_tdata_init_impl()
1734 prof_tdata_init(tsd_t *tsd) in prof_tdata_init() argument
1737 return (prof_tdata_init_impl(tsd, prof_thr_uid_alloc(), 0, NULL, in prof_tdata_init()
1755 prof_tdata_destroy_locked(tsd_t *tsd, prof_tdata_t *tdata, in prof_tdata_destroy_locked() argument
1761 assert(tsd_prof_tdata_get(tsd) != tdata); in prof_tdata_destroy_locked()
1765 tcache = tcache_get(tsd, false); in prof_tdata_destroy_locked()
1767 idalloctm(tsd, tdata->thread_name, tcache, true); in prof_tdata_destroy_locked()
1768 ckh_delete(tsd, &tdata->bt2tctx); in prof_tdata_destroy_locked()
1769 idalloctm(tsd, tdata, tcache, true); in prof_tdata_destroy_locked()
1773 prof_tdata_destroy(tsd_t *tsd, prof_tdata_t *tdata, bool even_if_attached) in prof_tdata_destroy() argument
1777 prof_tdata_destroy_locked(tsd, tdata, even_if_attached); in prof_tdata_destroy()
1782 prof_tdata_detach(tsd_t *tsd, prof_tdata_t *tdata) in prof_tdata_detach() argument
1795 tsd_prof_tdata_set(tsd, NULL); in prof_tdata_detach()
1800 prof_tdata_destroy(tsd, tdata, true); in prof_tdata_detach()
1804 prof_tdata_reinit(tsd_t *tsd, prof_tdata_t *tdata) in prof_tdata_reinit() argument
1809 prof_thread_name_alloc(tsd, tdata->thread_name) : NULL; in prof_tdata_reinit()
1812 prof_tdata_detach(tsd, tdata); in prof_tdata_reinit()
1813 return (prof_tdata_init_impl(tsd, thr_uid, thr_discrim, thread_name, in prof_tdata_reinit()
1842 prof_reset(tsd_t *tsd, size_t lg_sample) in prof_reset() argument
1859 prof_tdata_destroy_locked(tsd, to_destroy, false); in prof_reset()
1869 prof_tdata_cleanup(tsd_t *tsd) in prof_tdata_cleanup() argument
1876 tdata = tsd_prof_tdata_get(tsd); in prof_tdata_cleanup()
1878 prof_tdata_detach(tsd, tdata); in prof_tdata_cleanup()
1907 tsd_t *tsd; in prof_thread_name_get() local
1910 tsd = tsd_fetch(); in prof_thread_name_get()
1911 tdata = prof_tdata_get(tsd, true); in prof_thread_name_get()
1918 prof_thread_name_alloc(tsd_t *tsd, const char *thread_name) in prof_thread_name_alloc() argument
1930 ret = iallocztm(tsd, size, false, tcache_get(tsd, true), true, NULL); in prof_thread_name_alloc()
1938 prof_thread_name_set(tsd_t *tsd, const char *thread_name) in prof_thread_name_set() argument
1944 tdata = prof_tdata_get(tsd, true); in prof_thread_name_set()
1957 s = prof_thread_name_alloc(tsd, thread_name); in prof_thread_name_set()
1962 idalloctm(tsd, tdata->thread_name, tcache_get(tsd, false), in prof_thread_name_set()
1974 tsd_t *tsd; in prof_thread_active_get() local
1977 tsd = tsd_fetch(); in prof_thread_active_get()
1978 tdata = prof_tdata_get(tsd, true); in prof_thread_active_get()
1987 tsd_t *tsd; in prof_thread_active_set() local
1990 tsd = tsd_fetch(); in prof_thread_active_set()
1991 tdata = prof_tdata_get(tsd, true); in prof_thread_active_set()
2087 tsd_t *tsd; in prof_boot2() local
2104 tsd = tsd_fetch(); in prof_boot2()
2105 if (ckh_new(tsd, &bt2gctx, PROF_CKH_MINITEMS, prof_bt_hash, in prof_boot2()