2020-04-01 00:42:11 +08:00
|
|
|
#ifndef JEMALLOC_INTERNAL_PROF_DATA_H
|
|
|
|
#define JEMALLOC_INTERNAL_PROF_DATA_H
|
2019-12-19 07:15:31 +08:00
|
|
|
|
|
|
|
#include "jemalloc/internal/mutex.h"
|
|
|
|
|
2020-04-04 01:26:03 +08:00
|
|
|
extern malloc_mutex_t bt2gctx_mtx;
|
|
|
|
extern malloc_mutex_t tdatas_mtx;
|
|
|
|
extern malloc_mutex_t prof_dump_mtx;
|
|
|
|
|
2019-12-19 07:15:31 +08:00
|
|
|
extern malloc_mutex_t *gctx_locks;
|
|
|
|
extern malloc_mutex_t *tdata_locks;
|
|
|
|
|
2020-08-22 06:33:50 +08:00
|
|
|
extern size_t prof_unbiased_sz[PROF_SC_NSIZES];
|
|
|
|
extern size_t prof_shifted_unbiased_cnt[PROF_SC_NSIZES];
|
2020-08-22 01:23:23 +08:00
|
|
|
|
2019-12-19 07:15:31 +08:00
|
|
|
void prof_bt_hash(const void *key, size_t r_hash[2]);
|
|
|
|
bool prof_bt_keycomp(const void *k1, const void *k2);
|
|
|
|
|
|
|
|
bool prof_data_init(tsd_t *tsd);
|
2020-04-04 02:19:51 +08:00
|
|
|
prof_tctx_t *prof_lookup(tsd_t *tsd, prof_bt_t *bt);
|
2020-04-01 01:39:40 +08:00
|
|
|
int prof_thread_name_set_impl(tsd_t *tsd, const char *thread_name);
|
2023-07-06 04:33:34 +08:00
|
|
|
void prof_unbias_map_init(void);
|
2020-04-21 05:09:08 +08:00
|
|
|
void prof_dump_impl(tsd_t *tsd, write_cb_t *prof_dump_write, void *cbopaque,
|
|
|
|
prof_tdata_t *tdata, bool leakcheck);
|
2019-12-19 07:15:31 +08:00
|
|
|
prof_tdata_t * prof_tdata_init_impl(tsd_t *tsd, uint64_t thr_uid,
|
2020-03-24 05:58:33 +08:00
|
|
|
uint64_t thr_discrim, char *thread_name, bool active);
|
2019-12-19 07:15:31 +08:00
|
|
|
void prof_tdata_detach(tsd_t *tsd, prof_tdata_t *tdata);
|
2020-04-04 01:26:03 +08:00
|
|
|
void prof_reset(tsd_t *tsd, size_t lg_sample);
|
2019-12-19 07:15:31 +08:00
|
|
|
void prof_tctx_try_destroy(tsd_t *tsd, prof_tctx_t *tctx);
|
|
|
|
|
2020-04-01 01:13:55 +08:00
|
|
|
/* Used in unit tests. */
|
|
|
|
size_t prof_tdata_count(void);
|
|
|
|
size_t prof_bt_count(void);
|
2020-06-27 05:56:17 +08:00
|
|
|
void prof_cnt_all(prof_cnt_t *cnt_all);
|
2020-04-01 01:13:55 +08:00
|
|
|
|
2020-04-01 00:42:11 +08:00
|
|
|
#endif /* JEMALLOC_INTERNAL_PROF_DATA_H */
|