summaryrefslogtreecommitdiffstats
path: root/src/prof.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-05-04 00:34:40 (GMT)
committerJason Evans <jasone@canonware.com>2016-05-04 00:34:40 (GMT)
commite02b83cc5e3c4d30f93dba945162e3aa58d962d6 (patch)
treedc1cf37bd624061c6351ea3a78f993d2a19310ac /src/prof.c
parentdf900dbfaf4835d3efc06d771535f3e781544913 (diff)
parent2e5eb21184cccabc829265b5f5237f3c13563be6 (diff)
downloadjemalloc-4.1.1.zip
jemalloc-4.1.1.tar.gz
jemalloc-4.1.1.tar.bz2
Merge branch.4.1.1
Diffstat (limited to 'src/prof.c')
-rw-r--r--src/prof.c52
1 files changed, 36 insertions, 16 deletions
diff --git a/src/prof.c b/src/prof.c
index b387227..a92320d 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -2198,20 +2198,32 @@ prof_boot2(void)
}
void
-prof_prefork(void)
+prof_prefork0(void)
{
if (opt_prof) {
unsigned i;
- malloc_mutex_prefork(&tdatas_mtx);
+ malloc_mutex_prefork(&prof_dump_mtx);
malloc_mutex_prefork(&bt2gctx_mtx);
- malloc_mutex_prefork(&next_thr_uid_mtx);
- malloc_mutex_prefork(&prof_dump_seq_mtx);
- for (i = 0; i < PROF_NCTX_LOCKS; i++)
- malloc_mutex_prefork(&gctx_locks[i]);
+ malloc_mutex_prefork(&tdatas_mtx);
for (i = 0; i < PROF_NTDATA_LOCKS; i++)
malloc_mutex_prefork(&tdata_locks[i]);
+ for (i = 0; i < PROF_NCTX_LOCKS; i++)
+ malloc_mutex_prefork(&gctx_locks[i]);
+ }
+}
+
+void
+prof_prefork1(void)
+{
+
+ if (opt_prof) {
+ malloc_mutex_prefork(&prof_active_mtx);
+ malloc_mutex_prefork(&prof_dump_seq_mtx);
+ malloc_mutex_prefork(&prof_gdump_mtx);
+ malloc_mutex_prefork(&next_thr_uid_mtx);
+ malloc_mutex_prefork(&prof_thread_active_init_mtx);
}
}
@@ -2222,14 +2234,18 @@ prof_postfork_parent(void)
if (opt_prof) {
unsigned i;
- for (i = 0; i < PROF_NTDATA_LOCKS; i++)
- malloc_mutex_postfork_parent(&tdata_locks[i]);
+ malloc_mutex_postfork_parent(&prof_thread_active_init_mtx);
+ malloc_mutex_postfork_parent(&next_thr_uid_mtx);
+ malloc_mutex_postfork_parent(&prof_gdump_mtx);
+ malloc_mutex_postfork_parent(&prof_dump_seq_mtx);
+ malloc_mutex_postfork_parent(&prof_active_mtx);
for (i = 0; i < PROF_NCTX_LOCKS; i++)
malloc_mutex_postfork_parent(&gctx_locks[i]);
- malloc_mutex_postfork_parent(&prof_dump_seq_mtx);
- malloc_mutex_postfork_parent(&next_thr_uid_mtx);
- malloc_mutex_postfork_parent(&bt2gctx_mtx);
+ for (i = 0; i < PROF_NTDATA_LOCKS; i++)
+ malloc_mutex_postfork_parent(&tdata_locks[i]);
malloc_mutex_postfork_parent(&tdatas_mtx);
+ malloc_mutex_postfork_parent(&bt2gctx_mtx);
+ malloc_mutex_postfork_parent(&prof_dump_mtx);
}
}
@@ -2240,14 +2256,18 @@ prof_postfork_child(void)
if (opt_prof) {
unsigned i;
- for (i = 0; i < PROF_NTDATA_LOCKS; i++)
- malloc_mutex_postfork_child(&tdata_locks[i]);
+ malloc_mutex_postfork_child(&prof_thread_active_init_mtx);
+ malloc_mutex_postfork_child(&next_thr_uid_mtx);
+ malloc_mutex_postfork_child(&prof_gdump_mtx);
+ malloc_mutex_postfork_child(&prof_dump_seq_mtx);
+ malloc_mutex_postfork_child(&prof_active_mtx);
for (i = 0; i < PROF_NCTX_LOCKS; i++)
malloc_mutex_postfork_child(&gctx_locks[i]);
- malloc_mutex_postfork_child(&prof_dump_seq_mtx);
- malloc_mutex_postfork_child(&next_thr_uid_mtx);
- malloc_mutex_postfork_child(&bt2gctx_mtx);
+ for (i = 0; i < PROF_NTDATA_LOCKS; i++)
+ malloc_mutex_postfork_child(&tdata_locks[i]);
malloc_mutex_postfork_child(&tdatas_mtx);
+ malloc_mutex_postfork_child(&bt2gctx_mtx);
+ malloc_mutex_postfork_child(&prof_dump_mtx);
}
}