| 1903 | } |
| 1904 | |
| 1905 | static bool |
| 1906 | prof_dump(tsd_t *tsd, bool propagate_err, const char *filename, |
| 1907 | bool leakcheck) { |
| 1908 | cassert(config_prof); |
| 1909 | assert(tsd_reentrancy_level_get(tsd) == 0); |
| 1910 | |
| 1911 | prof_tdata_t * tdata = prof_tdata_get(tsd, true); |
| 1912 | if (tdata == NULL) { |
| 1913 | return true; |
| 1914 | } |
| 1915 | |
| 1916 | pre_reentrancy(tsd, NULL); |
| 1917 | malloc_mutex_lock(tsd_tsdn(tsd), &prof_dump_mtx); |
| 1918 | |
| 1919 | prof_gctx_tree_t gctxs; |
| 1920 | struct prof_tdata_merge_iter_arg_s prof_tdata_merge_iter_arg; |
| 1921 | struct prof_gctx_merge_iter_arg_s prof_gctx_merge_iter_arg; |
| 1922 | struct prof_gctx_dump_iter_arg_s prof_gctx_dump_iter_arg; |
| 1923 | prof_dump_prep(tsd, tdata, &prof_tdata_merge_iter_arg, |
| 1924 | &prof_gctx_merge_iter_arg, &gctxs); |
| 1925 | bool err = prof_dump_file(tsd, propagate_err, filename, leakcheck, tdata, |
| 1926 | &prof_tdata_merge_iter_arg, &prof_gctx_merge_iter_arg, |
| 1927 | &prof_gctx_dump_iter_arg, &gctxs); |
| 1928 | prof_gctx_finish(tsd, &gctxs); |
| 1929 | |
| 1930 | malloc_mutex_unlock(tsd_tsdn(tsd), &prof_dump_mtx); |
| 1931 | post_reentrancy(tsd); |
| 1932 | |
| 1933 | if (err) { |
| 1934 | return true; |
| 1935 | } |
| 1936 | |
| 1937 | if (leakcheck) { |
| 1938 | prof_leakcheck(&prof_tdata_merge_iter_arg.cnt_all, |
| 1939 | prof_gctx_merge_iter_arg.leak_ngctx, filename); |
| 1940 | } |
| 1941 | return false; |
| 1942 | } |
| 1943 | |
| 1944 | #ifdef JEMALLOC_JET |
| 1945 | void |
no test coverage detected