Relocate a few prof utilities to the right modules

This commit is contained in:
Yinan Zhang
2020-04-03 10:26:03 -07:00
parent 4736fb4fc9
commit d128efcb6a
9 changed files with 30 additions and 30 deletions

View File

@@ -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"

View File

@@ -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;

View File

@@ -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.

View File

@@ -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);