Add last-N mutex stats

This commit is contained in:
Yinan Zhang 2020-12-28 14:30:43 -08:00
parent 22d62d8cbd
commit 8a56d6b636
2 changed files with 11 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(prof_recent_alloc) \
OP(prof_recent_dump)
typedef enum { typedef enum {
#define OP(mtx) global_prof_mutex_##mtx, #define OP(mtx) global_prof_mutex_##mtx,

View File

@ -1232,6 +1232,12 @@ ctl_refresh(tsdn_t *tsdn) {
global_prof_mutex_prof_thds_data, tdatas_mtx); global_prof_mutex_prof_thds_data, tdatas_mtx);
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);
READ_GLOBAL_MUTEX_PROF_DATA(
global_prof_mutex_prof_recent_alloc,
prof_recent_alloc_mtx);
READ_GLOBAL_MUTEX_PROF_DATA(
global_prof_mutex_prof_recent_dump,
prof_recent_dump_mtx);
} }
if (have_background_thread) { if (have_background_thread) {
READ_GLOBAL_MUTEX_PROF_DATA( READ_GLOBAL_MUTEX_PROF_DATA(
@ -3344,6 +3350,8 @@ stats_mutexes_reset_ctl(tsd_t *tsd, const size_t *mib,
MUTEX_PROF_RESET(bt2gctx_mtx); MUTEX_PROF_RESET(bt2gctx_mtx);
MUTEX_PROF_RESET(tdatas_mtx); MUTEX_PROF_RESET(tdatas_mtx);
MUTEX_PROF_RESET(prof_dump_mtx); MUTEX_PROF_RESET(prof_dump_mtx);
MUTEX_PROF_RESET(prof_recent_alloc_mtx);
MUTEX_PROF_RESET(prof_recent_dump_mtx);
} }
/* Per arena mutexes. */ /* Per arena mutexes. */