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