Relocate a few prof utilities to the right modules
This commit is contained in:
@@ -9,6 +9,9 @@
|
||||
#include "jemalloc/internal/mutex.h"
|
||||
#include "jemalloc/internal/nstime.h"
|
||||
#include "jemalloc/internal/peak_event.h"
|
||||
#include "jemalloc/internal/prof_data.h"
|
||||
#include "jemalloc/internal/prof_log.h"
|
||||
#include "jemalloc/internal/prof_recent.h"
|
||||
#include "jemalloc/internal/prof_sys.h"
|
||||
#include "jemalloc/internal/sc.h"
|
||||
#include "jemalloc/internal/util.h"
|
||||
|
16
src/prof.c
16
src/prof.c
@@ -78,16 +78,9 @@ uint64_t prof_interval = 0;
|
||||
|
||||
size_t lg_prof_sample;
|
||||
|
||||
/* Non static to enable profiling. */
|
||||
malloc_mutex_t bt2gctx_mtx;
|
||||
|
||||
malloc_mutex_t tdatas_mtx;
|
||||
|
||||
static uint64_t next_thr_uid;
|
||||
static malloc_mutex_t next_thr_uid_mtx;
|
||||
|
||||
malloc_mutex_t prof_dump_mtx;
|
||||
|
||||
/* Do not dump any profiles until bootstrapping is complete. */
|
||||
bool prof_booted = false;
|
||||
|
||||
@@ -473,15 +466,6 @@ prof_sample_event_handler(tsd_t *tsd, uint64_t elapsed) {
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
prof_getpid(void) {
|
||||
#ifdef _WIN32
|
||||
return GetCurrentProcessId();
|
||||
#else
|
||||
return getpid();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
prof_fdump(void) {
|
||||
tsd_t *tsd;
|
||||
|
@@ -25,6 +25,10 @@
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
malloc_mutex_t bt2gctx_mtx;
|
||||
malloc_mutex_t tdatas_mtx;
|
||||
malloc_mutex_t prof_dump_mtx;
|
||||
|
||||
/*
|
||||
* Table of mutexes that are shared among gctx's. These are leaf locks, so
|
||||
* there is no problem with using them for more than one gctx at the same time.
|
||||
|
@@ -61,6 +61,15 @@ prof_sys_thread_name_fetch(tsd_t *tsd) {
|
||||
#undef THREAD_NAME_MAX_LEN
|
||||
}
|
||||
|
||||
int
|
||||
prof_getpid(void) {
|
||||
#ifdef _WIN32
|
||||
return GetCurrentProcessId();
|
||||
#else
|
||||
return getpid();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
prof_dump_check_possible_error(bool err_cond, const char *format, ...) {
|
||||
assert(!prof_dump_error);
|
||||
|
Reference in New Issue
Block a user