diff --git a/include/jemalloc/internal/prof_data.h b/include/jemalloc/internal/prof_data.h index 09a40994..c1dc3ec4 100644 --- a/include/jemalloc/internal/prof_data.h +++ b/include/jemalloc/internal/prof_data.h @@ -19,4 +19,12 @@ void bt_init(prof_bt_t *bt, void **vec); void prof_backtrace(tsd_t *tsd, prof_bt_t *bt); void prof_tctx_try_destroy(tsd_t *tsd, prof_tctx_t *tctx); +/* Used in unit tests. */ +size_t prof_tdata_count(void); +size_t prof_bt_count(void); +typedef void (prof_dump_header_t)(tsdn_t *, const prof_cnt_t *); +extern prof_dump_header_t *JET_MUTABLE prof_dump_header; +void prof_cnt_all(uint64_t *curobjs, uint64_t *curbytes, uint64_t *accumobjs, + uint64_t *accumbytes); + #endif /* JEMALLOC_INTERNAL_PROF_DATA_H */ diff --git a/include/jemalloc/internal/prof_externs.h b/include/jemalloc/internal/prof_externs.h index 9a2b1224..a1baaff1 100644 --- a/include/jemalloc/internal/prof_externs.h +++ b/include/jemalloc/internal/prof_externs.h @@ -92,18 +92,12 @@ void prof_sample_event_handler(tsd_t *tsd, uint64_t elapsed); /* Used by 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; -size_t prof_tdata_count(void); -size_t prof_bt_count(void); 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 void (prof_dump_header_t)(tsdn_t *, const prof_cnt_t *); -extern prof_dump_header_t *JET_MUTABLE prof_dump_header; typedef int (prof_dump_open_maps_t)(); extern prof_dump_open_maps_t *JET_MUTABLE prof_dump_open_maps; -void prof_cnt_all(uint64_t *curobjs, uint64_t *curbytes, uint64_t *accumobjs, - uint64_t *accumbytes); bool prof_log_start(tsdn_t *tsdn, const char *filename); bool prof_log_stop(tsdn_t *tsdn); diff --git a/test/unit/prof_accum.c b/test/unit/prof_accum.c index 8fc58813..5b8085e1 100644 --- a/test/unit/prof_accum.c +++ b/test/unit/prof_accum.c @@ -1,5 +1,7 @@ #include "test/jemalloc_test.h" +#include "jemalloc/internal/prof_data.h" + #define NTHREADS 4 #define NALLOCS_PER_THREAD 50 #define DUMP_INTERVAL 1 diff --git a/test/unit/prof_active.c b/test/unit/prof_active.c index 41c0512d..af29e7ad 100644 --- a/test/unit/prof_active.c +++ b/test/unit/prof_active.c @@ -1,5 +1,7 @@ #include "test/jemalloc_test.h" +#include "jemalloc/internal/prof_data.h" + static void mallctl_bool_get(const char *name, bool expected, const char *func, int line) { bool old; diff --git a/test/unit/prof_reset.c b/test/unit/prof_reset.c index dc64a04c..22bf7963 100644 --- a/test/unit/prof_reset.c +++ b/test/unit/prof_reset.c @@ -1,5 +1,7 @@ #include "test/jemalloc_test.h" +#include "jemalloc/internal/prof_data.h" + static int prof_dump_open_file_intercept(const char *filename, int mode) { int fd; diff --git a/test/unit/prof_tctx.c b/test/unit/prof_tctx.c index 4bc597b6..801e5f79 100644 --- a/test/unit/prof_tctx.c +++ b/test/unit/prof_tctx.c @@ -1,5 +1,7 @@ #include "test/jemalloc_test.h" +#include "jemalloc/internal/prof_data.h" + TEST_BEGIN(test_prof_realloc) { tsd_t *tsd; int flags;