2020-04-01 00:02:55 +08:00
|
|
|
#ifndef JEMALLOC_INTERNAL_PROF_SYS_H
|
|
|
|
#define JEMALLOC_INTERNAL_PROF_SYS_H
|
|
|
|
|
2020-04-03 07:20:01 +08:00
|
|
|
extern malloc_mutex_t prof_dump_filename_mtx;
|
|
|
|
extern base_t *prof_base;
|
|
|
|
|
2020-04-04 02:19:51 +08:00
|
|
|
void bt_init(prof_bt_t *bt, void **vec);
|
|
|
|
void prof_backtrace(tsd_t *tsd, prof_bt_t *bt);
|
|
|
|
void prof_unwind_init();
|
2020-04-01 00:02:55 +08:00
|
|
|
void prof_sys_thread_name_fetch(tsd_t *tsd);
|
2020-04-04 01:26:03 +08:00
|
|
|
int prof_getpid(void);
|
2020-04-03 07:20:01 +08:00
|
|
|
void prof_get_default_filename(tsdn_t *tsdn, char *filename, uint64_t ind);
|
2021-08-13 06:48:02 +08:00
|
|
|
bool prof_prefix_set(tsdn_t *tsdn, const char *prefix);
|
2020-04-03 07:20:01 +08:00
|
|
|
void prof_fdump_impl(tsd_t *tsd);
|
|
|
|
void prof_idump_impl(tsd_t *tsd);
|
|
|
|
bool prof_mdump_impl(tsd_t *tsd, const char *filename);
|
|
|
|
void prof_gdump_impl(tsd_t *tsd);
|
|
|
|
|
2020-04-03 07:39:41 +08:00
|
|
|
/* Used in unit tests. */
|
|
|
|
typedef int (prof_sys_thread_name_read_t)(char *buf, size_t limit);
|
|
|
|
extern prof_sys_thread_name_read_t *JET_MUTABLE prof_sys_thread_name_read;
|
|
|
|
typedef int (prof_dump_open_file_t)(const char *, int);
|
|
|
|
extern prof_dump_open_file_t *JET_MUTABLE prof_dump_open_file;
|
|
|
|
typedef ssize_t (prof_dump_write_file_t)(int, const void *, size_t);
|
|
|
|
extern prof_dump_write_file_t *JET_MUTABLE prof_dump_write_file;
|
|
|
|
typedef int (prof_dump_open_maps_t)();
|
|
|
|
extern prof_dump_open_maps_t *JET_MUTABLE prof_dump_open_maps;
|
|
|
|
|
2020-04-01 00:02:55 +08:00
|
|
|
#endif /* JEMALLOC_INTERNAL_PROF_SYS_H */
|