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.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
@@ -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,
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user