summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2012-04-17 23:39:33 (GMT)
committerJason Evans <je@fb.com>2012-04-17 23:39:33 (GMT)
commit0b25fe79aaf8840a5acda7e3160a053d42349872 (patch)
tree05a4dc169e62517bff86393644e1e05fc501acf7 /src
parent25a000e89649d9ce5aacc1089408b8b3bafeb5e4 (diff)
downloadjemalloc-0b25fe79aaf8840a5acda7e3160a053d42349872.zip
jemalloc-0b25fe79aaf8840a5acda7e3160a053d42349872.tar.gz
jemalloc-0b25fe79aaf8840a5acda7e3160a053d42349872.tar.bz2
Update prof defaults to match common usage.
Change the "opt.lg_prof_sample" default from 0 to 19 (1 B to 512 KiB). Change the "opt.prof_accum" default from true to false. Add the "opt.prof_final" mallctl, so that "opt.prof_prefix" need not be abused to disable final profile dumping.
Diffstat (limited to 'src')
-rw-r--r--src/ctl.c3
-rw-r--r--src/jemalloc.c1
-rw-r--r--src/prof.c5
-rw-r--r--src/stats.c1
4 files changed, 8 insertions, 2 deletions
diff --git a/src/ctl.c b/src/ctl.c
index a6a02cc..98ea3d1 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -80,6 +80,7 @@ CTL_PROTO(opt_prof_active)
CTL_PROTO(opt_lg_prof_sample)
CTL_PROTO(opt_lg_prof_interval)
CTL_PROTO(opt_prof_gdump)
+CTL_PROTO(opt_prof_final)
CTL_PROTO(opt_prof_leak)
CTL_PROTO(opt_prof_accum)
CTL_PROTO(arenas_bin_i_size)
@@ -210,6 +211,7 @@ static const ctl_node_t opt_node[] = {
{NAME("lg_prof_sample"), CTL(opt_lg_prof_sample)},
{NAME("lg_prof_interval"), CTL(opt_lg_prof_interval)},
{NAME("prof_gdump"), CTL(opt_prof_gdump)},
+ {NAME("prof_final"), CTL(opt_prof_final)},
{NAME("prof_leak"), CTL(opt_prof_leak)},
{NAME("prof_accum"), CTL(opt_prof_accum)}
};
@@ -1122,6 +1124,7 @@ CTL_RO_CGEN(config_prof, opt_prof_active, opt_prof_active, bool) /* Mutable. */
CTL_RO_NL_CGEN(config_prof, opt_lg_prof_sample, opt_lg_prof_sample, size_t)
CTL_RO_NL_CGEN(config_prof, opt_lg_prof_interval, opt_lg_prof_interval, ssize_t)
CTL_RO_NL_CGEN(config_prof, opt_prof_gdump, opt_prof_gdump, bool)
+CTL_RO_NL_CGEN(config_prof, opt_prof_final, opt_prof_final, bool)
CTL_RO_NL_CGEN(config_prof, opt_prof_leak, opt_prof_leak, bool)
CTL_RO_NL_CGEN(config_prof, opt_prof_accum, opt_prof_accum, bool)
diff --git a/src/jemalloc.c b/src/jemalloc.c
index 0decd8a..d4b681b 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -561,6 +561,7 @@ malloc_conf_init(void)
lg_prof_interval, -1,
(sizeof(uint64_t) << 3) - 1)
CONF_HANDLE_BOOL(opt_prof_gdump, prof_gdump)
+ CONF_HANDLE_BOOL(opt_prof_final, prof_final)
CONF_HANDLE_BOOL(opt_prof_leak, prof_leak)
}
malloc_conf_error("Invalid conf pair", k, klen, v,
diff --git a/src/prof.c b/src/prof.c
index b509aae..227560b 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -21,8 +21,9 @@ bool opt_prof_active = true;
size_t opt_lg_prof_sample = LG_PROF_SAMPLE_DEFAULT;
ssize_t opt_lg_prof_interval = LG_PROF_INTERVAL_DEFAULT;
bool opt_prof_gdump = false;
+bool opt_prof_final = true;
bool opt_prof_leak = false;
-bool opt_prof_accum = true;
+bool opt_prof_accum = false;
char opt_prof_prefix[PATH_MAX + 1];
uint64_t prof_interval;
@@ -944,7 +945,7 @@ prof_fdump(void)
if (prof_booted == false)
return;
- if (opt_prof_prefix[0] != '\0') {
+ if (opt_prof_final && opt_prof_prefix[0] != '\0') {
malloc_mutex_lock(&prof_dump_seq_mtx);
prof_dump_filename(filename, 'f', UINT64_C(0xffffffffffffffff));
malloc_mutex_unlock(&prof_dump_seq_mtx);
diff --git a/src/stats.c b/src/stats.c
index 4cad214..08f7098 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -397,6 +397,7 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque,
OPT_WRITE_BOOL(prof_accum)
OPT_WRITE_SSIZE_T(lg_prof_interval)
OPT_WRITE_BOOL(prof_gdump)
+ OPT_WRITE_BOOL(prof_final)
OPT_WRITE_BOOL(prof_leak)
#undef OPT_WRITE_BOOL