1 | #ifndef JEMALLOC_INTERNAL_PROF_DATA_H |
2 | #define JEMALLOC_INTERNAL_PROF_DATA_H |
3 | |
4 | #include "jemalloc/internal/mutex.h" |
5 | |
6 | extern malloc_mutex_t bt2gctx_mtx; |
7 | extern malloc_mutex_t tdatas_mtx; |
8 | extern malloc_mutex_t prof_dump_mtx; |
9 | |
10 | extern malloc_mutex_t *gctx_locks; |
11 | extern malloc_mutex_t *tdata_locks; |
12 | |
13 | extern size_t prof_unbiased_sz[PROF_SC_NSIZES]; |
14 | extern size_t prof_shifted_unbiased_cnt[PROF_SC_NSIZES]; |
15 | |
16 | void prof_bt_hash(const void *key, size_t r_hash[2]); |
17 | bool prof_bt_keycomp(const void *k1, const void *k2); |
18 | |
19 | bool prof_data_init(tsd_t *tsd); |
20 | prof_tctx_t *prof_lookup(tsd_t *tsd, prof_bt_t *bt); |
21 | char *prof_thread_name_alloc(tsd_t *tsd, const char *thread_name); |
22 | int prof_thread_name_set_impl(tsd_t *tsd, const char *thread_name); |
23 | void prof_unbias_map_init(); |
24 | void prof_dump_impl(tsd_t *tsd, write_cb_t *prof_dump_write, void *cbopaque, |
25 | prof_tdata_t *tdata, bool leakcheck); |
26 | prof_tdata_t * prof_tdata_init_impl(tsd_t *tsd, uint64_t thr_uid, |
27 | uint64_t thr_discrim, char *thread_name, bool active); |
28 | void prof_tdata_detach(tsd_t *tsd, prof_tdata_t *tdata); |
29 | void prof_reset(tsd_t *tsd, size_t lg_sample); |
30 | void prof_tctx_try_destroy(tsd_t *tsd, prof_tctx_t *tctx); |
31 | |
32 | /* Used in unit tests. */ |
33 | size_t prof_tdata_count(void); |
34 | size_t prof_bt_count(void); |
35 | void prof_cnt_all(prof_cnt_t *cnt_all); |
36 | |
37 | #endif /* JEMALLOC_INTERNAL_PROF_DATA_H */ |
38 | |