diff --git a/ChangeLog b/ChangeLog index 58e4462b..c6bd5562 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,12 @@ brevity. Much more detail can be found in the git revision history: https://github.com/jemalloc/jemalloc +* 4.0.3 (XXX) + + Bug fixes: + - Fix prof_tctx_dump_iter() to filter out nodes that were created after heap + profile dumping started. + * 4.0.2 (September 21, 2015) This bugfix release addresses a few bugs specific to heap profiling. diff --git a/src/prof.c b/src/prof.c index 0a08062c..5d2b9598 100644 --- a/src/prof.c +++ b/src/prof.c @@ -1102,11 +1102,23 @@ prof_tctx_dump_iter(prof_tctx_tree_t *tctxs, prof_tctx_t *tctx, void *arg) { bool propagate_err = *(bool *)arg; - if (prof_dump_printf(propagate_err, - " t%"FMTu64": %"FMTu64": %"FMTu64" [%"FMTu64": %"FMTu64"]\n", - tctx->thr_uid, tctx->dump_cnts.curobjs, tctx->dump_cnts.curbytes, - tctx->dump_cnts.accumobjs, tctx->dump_cnts.accumbytes)) - return (tctx); + switch (tctx->state) { + case prof_tctx_state_initializing: + case prof_tctx_state_nominal: + /* Not captured by this dump. */ + break; + case prof_tctx_state_dumping: + case prof_tctx_state_purgatory: + if (prof_dump_printf(propagate_err, + " t%"FMTu64": %"FMTu64": %"FMTu64" [%"FMTu64": " + "%"FMTu64"]\n", tctx->thr_uid, tctx->dump_cnts.curobjs, + tctx->dump_cnts.curbytes, tctx->dump_cnts.accumobjs, + tctx->dump_cnts.accumbytes)) + return (tctx); + break; + default: + not_reached(); + } return (NULL); }