HPA: Add central mutex contention stats.

This commit is contained in:
David Goldblatt 2020-09-04 15:35:10 -07:00 committed by David Goldblatt
parent bf025d2ec8
commit 484f04733e
2 changed files with 15 additions and 1 deletions

View File

@ -11,7 +11,9 @@
OP(ctl) \ OP(ctl) \
OP(prof) \ OP(prof) \
OP(prof_thds_data) \ OP(prof_thds_data) \
OP(prof_dump) OP(prof_dump) \
OP(hpa_central) \
OP(hpa_central_grow)
typedef enum { typedef enum {
#define OP(mtx) global_prof_mutex_##mtx, #define OP(mtx) global_prof_mutex_##mtx,

View File

@ -1142,6 +1142,14 @@ ctl_refresh(tsdn_t *tsdn) {
READ_GLOBAL_MUTEX_PROF_DATA( READ_GLOBAL_MUTEX_PROF_DATA(
global_prof_mutex_prof_dump, prof_dump_mtx); global_prof_mutex_prof_dump, prof_dump_mtx);
} }
if (opt_hpa) {
READ_GLOBAL_MUTEX_PROF_DATA(
global_prof_mutex_hpa_central,
arena_hpa_global.mtx);
READ_GLOBAL_MUTEX_PROF_DATA(
global_prof_mutex_hpa_central_grow,
arena_hpa_global.grow_mtx);
}
if (have_background_thread) { if (have_background_thread) {
READ_GLOBAL_MUTEX_PROF_DATA( READ_GLOBAL_MUTEX_PROF_DATA(
global_prof_mutex_background_thread, global_prof_mutex_background_thread,
@ -3134,6 +3142,10 @@ stats_mutexes_reset_ctl(tsd_t *tsd, const size_t *mib,
MUTEX_PROF_RESET(tdatas_mtx); MUTEX_PROF_RESET(tdatas_mtx);
MUTEX_PROF_RESET(prof_dump_mtx); MUTEX_PROF_RESET(prof_dump_mtx);
} }
if (opt_hpa) {
MUTEX_PROF_RESET(arena_hpa_global.mtx);
MUTEX_PROF_RESET(arena_hpa_global.grow_mtx);
}
/* Per arena mutexes. */ /* Per arena mutexes. */