| 2289 | } |
| 2290 | |
| 2291 | bool |
| 2292 | prof_boot2(tsd_t *tsd) { |
| 2293 | cassert(config_prof); |
| 2294 | |
| 2295 | if (opt_prof) { |
| 2296 | unsigned i; |
| 2297 | |
| 2298 | lg_prof_sample = opt_lg_prof_sample; |
| 2299 | |
| 2300 | prof_active = opt_prof_active; |
| 2301 | if (malloc_mutex_init(&prof_active_mtx, "prof_active", |
| 2302 | WITNESS_RANK_PROF_ACTIVE, malloc_mutex_rank_exclusive)) { |
| 2303 | return true; |
| 2304 | } |
| 2305 | |
| 2306 | prof_gdump_val = opt_prof_gdump; |
| 2307 | if (malloc_mutex_init(&prof_gdump_mtx, "prof_gdump", |
| 2308 | WITNESS_RANK_PROF_GDUMP, malloc_mutex_rank_exclusive)) { |
| 2309 | return true; |
| 2310 | } |
| 2311 | |
| 2312 | prof_thread_active_init = opt_prof_thread_active_init; |
| 2313 | if (malloc_mutex_init(&prof_thread_active_init_mtx, |
| 2314 | "prof_thread_active_init", |
| 2315 | WITNESS_RANK_PROF_THREAD_ACTIVE_INIT, |
| 2316 | malloc_mutex_rank_exclusive)) { |
| 2317 | return true; |
| 2318 | } |
| 2319 | |
| 2320 | if (ckh_new(tsd, &bt2gctx, PROF_CKH_MINITEMS, prof_bt_hash, |
| 2321 | prof_bt_keycomp)) { |
| 2322 | return true; |
| 2323 | } |
| 2324 | if (malloc_mutex_init(&bt2gctx_mtx, "prof_bt2gctx", |
| 2325 | WITNESS_RANK_PROF_BT2GCTX, malloc_mutex_rank_exclusive)) { |
| 2326 | return true; |
| 2327 | } |
| 2328 | |
| 2329 | tdata_tree_new(&tdatas); |
| 2330 | if (malloc_mutex_init(&tdatas_mtx, "prof_tdatas", |
| 2331 | WITNESS_RANK_PROF_TDATAS, malloc_mutex_rank_exclusive)) { |
| 2332 | return true; |
| 2333 | } |
| 2334 | |
| 2335 | next_thr_uid = 0; |
| 2336 | if (malloc_mutex_init(&next_thr_uid_mtx, "prof_next_thr_uid", |
| 2337 | WITNESS_RANK_PROF_NEXT_THR_UID, malloc_mutex_rank_exclusive)) { |
| 2338 | return true; |
| 2339 | } |
| 2340 | |
| 2341 | if (malloc_mutex_init(&prof_dump_seq_mtx, "prof_dump_seq", |
| 2342 | WITNESS_RANK_PROF_DUMP_SEQ, malloc_mutex_rank_exclusive)) { |
| 2343 | return true; |
| 2344 | } |
| 2345 | if (malloc_mutex_init(&prof_dump_mtx, "prof_dump", |
| 2346 | WITNESS_RANK_PROF_DUMP, malloc_mutex_rank_exclusive)) { |
| 2347 | return true; |
| 2348 | } |
no test coverage detected