mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-07 12:17:28 +03:00
Fix prof_tctx_dump_iter() to filter.
Fix prof_tctx_dump_iter() to filter out nodes that were created after heap profile dumping started. Prior to this fix, spurious entries with arbitrary object/byte counts could appear in heap profiles, which resulted in jeprof inaccuracies or failures.
This commit is contained in:
parent
486d249fb4
commit
fb64ec29ec
2 changed files with 23 additions and 5 deletions
22
src/prof.c
22
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue