| 1623 | } |
| 1624 | |
| 1625 | static bool |
| 1626 | prof_dump(tsd_t *tsd, bool propagate_err, const char *filename, |
| 1627 | bool leakcheck) { |
| 1628 | cassert(config_prof); |
| 1629 | assert(tsd_reentrancy_level_get(tsd) == 0); |
| 1630 | |
| 1631 | prof_tdata_t * tdata = prof_tdata_get(tsd, true); |
| 1632 | if (tdata == NULL) { |
| 1633 | return true; |
| 1634 | } |
| 1635 | |
| 1636 | pre_reentrancy(tsd); |
| 1637 | malloc_mutex_lock(tsd_tsdn(tsd), &prof_dump_mtx); |
| 1638 | |
| 1639 | prof_gctx_tree_t gctxs; |
| 1640 | struct prof_tdata_merge_iter_arg_s prof_tdata_merge_iter_arg; |
| 1641 | struct prof_gctx_merge_iter_arg_s prof_gctx_merge_iter_arg; |
| 1642 | struct prof_gctx_dump_iter_arg_s prof_gctx_dump_iter_arg; |
| 1643 | prof_dump_prep(tsd, tdata, &prof_tdata_merge_iter_arg, |
| 1644 | &prof_gctx_merge_iter_arg, &gctxs); |
| 1645 | bool err = prof_dump_file(tsd, propagate_err, filename, leakcheck, tdata, |
| 1646 | &prof_tdata_merge_iter_arg, &prof_gctx_merge_iter_arg, |
| 1647 | &prof_gctx_dump_iter_arg, &gctxs); |
| 1648 | prof_gctx_finish(tsd, &gctxs); |
| 1649 | |
| 1650 | malloc_mutex_unlock(tsd_tsdn(tsd), &prof_dump_mtx); |
| 1651 | post_reentrancy(tsd); |
| 1652 | |
| 1653 | if (err) { |
| 1654 | return true; |
| 1655 | } |
| 1656 | |
| 1657 | if (leakcheck) { |
| 1658 | prof_leakcheck(&prof_tdata_merge_iter_arg.cnt_all, |
| 1659 | prof_gctx_merge_iter_arg.leak_ngctx, filename); |
| 1660 | } |
| 1661 | return false; |
| 1662 | } |
| 1663 | |
| 1664 | #ifdef JEMALLOC_JET |
| 1665 | void |
no test coverage detected