Add lock to protect prof last-N dumping

This commit is contained in:
Yinan Zhang
2020-04-13 12:05:51 -07:00
parent a835d9cf85
commit 3e19ebd2ea
4 changed files with 33 additions and 17 deletions

View File

@@ -1,6 +1,8 @@
#ifndef JEMALLOC_INTERNAL_PROF_RECENT_EXTERNS_H
#define JEMALLOC_INTERNAL_PROF_RECENT_EXTERNS_H
extern malloc_mutex_t prof_recent_dump_mtx;
bool prof_recent_alloc_prepare(tsd_t *tsd, prof_tctx_t *tctx);
void prof_recent_alloc(tsd_t *tsd, edata_t *edata, size_t size);
void prof_recent_alloc_reset(tsd_t *tsd, edata_t *edata);

View File

@@ -29,7 +29,8 @@
#define WITNESS_RANK_PROF_TDATA 8U
#define WITNESS_RANK_PROF_LOG 9U
#define WITNESS_RANK_PROF_GCTX 10U
#define WITNESS_RANK_BACKGROUND_THREAD 11U
#define WITNESS_RANK_PROF_RECENT_DUMP 11U
#define WITNESS_RANK_BACKGROUND_THREAD 12U
/*
* Used as an argument to witness_assert_depth_to_rank() in order to validate
@@ -37,19 +38,19 @@
* witness_assert_depth_to_rank() is inclusive rather than exclusive, this
* definition can have the same value as the minimally ranked core lock.
*/
#define WITNESS_RANK_CORE 12U
#define WITNESS_RANK_CORE 13U
#define WITNESS_RANK_DECAY 12U
#define WITNESS_RANK_TCACHE_QL 13U
#define WITNESS_RANK_EXTENT_GROW 14U
#define WITNESS_RANK_EXTENTS 15U
#define WITNESS_RANK_EDATA_CACHE 16U
#define WITNESS_RANK_DECAY 13U
#define WITNESS_RANK_TCACHE_QL 14U
#define WITNESS_RANK_EXTENT_GROW 15U
#define WITNESS_RANK_EXTENTS 16U
#define WITNESS_RANK_EDATA_CACHE 17U
#define WITNESS_RANK_EMAP 17U
#define WITNESS_RANK_RTREE 18U
#define WITNESS_RANK_BASE 19U
#define WITNESS_RANK_ARENA_LARGE 20U
#define WITNESS_RANK_HOOK 21U
#define WITNESS_RANK_EMAP 18U
#define WITNESS_RANK_RTREE 19U
#define WITNESS_RANK_BASE 20U
#define WITNESS_RANK_ARENA_LARGE 21U
#define WITNESS_RANK_HOOK 22U
#define WITNESS_RANK_LEAF 0xffffffffU
#define WITNESS_RANK_BIN WITNESS_RANK_LEAF
@@ -60,8 +61,8 @@
#define WITNESS_RANK_PROF_DUMP_FILENAME WITNESS_RANK_LEAF
#define WITNESS_RANK_PROF_GDUMP WITNESS_RANK_LEAF
#define WITNESS_RANK_PROF_NEXT_THR_UID WITNESS_RANK_LEAF
#define WITNESS_RANK_PROF_THREAD_ACTIVE_INIT WITNESS_RANK_LEAF
#define WITNESS_RANK_PROF_RECENT_ALLOC WITNESS_RANK_LEAF
#define WITNESS_RANK_PROF_THREAD_ACTIVE_INIT WITNESS_RANK_LEAF
/******************************************************************************/
/* PER-WITNESS DATA */