MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / prof_boot2

Function prof_boot2

deps/jemalloc/src/prof.c:2951–3085  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2949}
2950
2951bool
2952prof_boot2(tsd_t *tsd) {
2953 cassert(config_prof);
2954
2955 if (opt_prof) {
2956 unsigned i;
2957
2958 lg_prof_sample = opt_lg_prof_sample;
2959
2960 prof_active = opt_prof_active;
2961 if (malloc_mutex_init(&prof_active_mtx, "prof_active",
2962 WITNESS_RANK_PROF_ACTIVE, malloc_mutex_rank_exclusive)) {
2963 return true;
2964 }
2965
2966 prof_gdump_val = opt_prof_gdump;
2967 if (malloc_mutex_init(&prof_gdump_mtx, "prof_gdump",
2968 WITNESS_RANK_PROF_GDUMP, malloc_mutex_rank_exclusive)) {
2969 return true;
2970 }
2971
2972 prof_thread_active_init = opt_prof_thread_active_init;
2973 if (malloc_mutex_init(&prof_thread_active_init_mtx,
2974 "prof_thread_active_init",
2975 WITNESS_RANK_PROF_THREAD_ACTIVE_INIT,
2976 malloc_mutex_rank_exclusive)) {
2977 return true;
2978 }
2979
2980 if (ckh_new(tsd, &bt2gctx, PROF_CKH_MINITEMS, prof_bt_hash,
2981 prof_bt_keycomp)) {
2982 return true;
2983 }
2984 if (malloc_mutex_init(&bt2gctx_mtx, "prof_bt2gctx",
2985 WITNESS_RANK_PROF_BT2GCTX, malloc_mutex_rank_exclusive)) {
2986 return true;
2987 }
2988
2989 tdata_tree_new(&tdatas);
2990 if (malloc_mutex_init(&tdatas_mtx, "prof_tdatas",
2991 WITNESS_RANK_PROF_TDATAS, malloc_mutex_rank_exclusive)) {
2992 return true;
2993 }
2994
2995 next_thr_uid = 0;
2996 if (malloc_mutex_init(&next_thr_uid_mtx, "prof_next_thr_uid",
2997 WITNESS_RANK_PROF_NEXT_THR_UID, malloc_mutex_rank_exclusive)) {
2998 return true;
2999 }
3000
3001 if (malloc_mutex_init(&prof_dump_seq_mtx, "prof_dump_seq",
3002 WITNESS_RANK_PROF_DUMP_SEQ, malloc_mutex_rank_exclusive)) {
3003 return true;
3004 }
3005 if (malloc_mutex_init(&prof_dump_mtx, "prof_dump",
3006 WITNESS_RANK_PROF_DUMP, malloc_mutex_rank_exclusive)) {
3007 return true;
3008 }

Callers 1

malloc_init_hardFunction · 0.70

Calls 7

prof_log_startFunction · 0.85
malloc_mutex_initFunction · 0.70
ckh_newFunction · 0.70
malloc_writeFunction · 0.70
base_allocFunction · 0.70
b0getFunction · 0.70
tsd_tsdnFunction · 0.50

Tested by

no test coverage detected