| 2103 | } |
| 2104 | |
| 2105 | void |
| 2106 | prof_gdump(tsdn_t *tsdn) { |
| 2107 | tsd_t *tsd; |
| 2108 | prof_tdata_t *tdata; |
| 2109 | |
| 2110 | cassert(config_prof); |
| 2111 | |
| 2112 | if (!prof_booted || tsdn_null(tsdn) || !prof_active_get_unlocked()) { |
| 2113 | return; |
| 2114 | } |
| 2115 | tsd = tsdn_tsd(tsdn); |
| 2116 | if (tsd_reentrancy_level_get(tsd) > 0) { |
| 2117 | return; |
| 2118 | } |
| 2119 | |
| 2120 | tdata = prof_tdata_get(tsd, false); |
| 2121 | if (tdata == NULL) { |
| 2122 | return; |
| 2123 | } |
| 2124 | if (tdata->enq) { |
| 2125 | tdata->enq_gdump = true; |
| 2126 | return; |
| 2127 | } |
| 2128 | |
| 2129 | if (opt_prof_prefix[0] != '\0') { |
| 2130 | char filename[DUMP_FILENAME_BUFSIZE]; |
| 2131 | malloc_mutex_lock(tsdn, &prof_dump_seq_mtx); |
| 2132 | prof_dump_filename(filename, 'u', prof_dump_useq); |
| 2133 | prof_dump_useq++; |
| 2134 | malloc_mutex_unlock(tsdn, &prof_dump_seq_mtx); |
| 2135 | prof_dump(tsd, false, filename, false); |
| 2136 | } |
| 2137 | } |
| 2138 | |
| 2139 | static void |
| 2140 | prof_bt_hash(const void *key, size_t r_hash[2]) { |
no test coverage detected