Prof: Add prof_unbias.

This gives more accurate attribution of bytes and counts to stack traces,
without introducing backwards incompatibilities in heap-profile parsing tools.
We track the ideal reported (to the end user) number of bytes more carefully
inside core jemalloc.  When dumping heap profiles, insteading of outputting our
counts directly, we output counts that will cause parsing tools to give a result
close to the value we want.

We retain the old version as an opt setting, to let users who are tracking
values on a per-component basis to keep their metrics stable until they decide
to switch.
This commit is contained in:
David Goldblatt 2020-08-03 13:05:34 -07:00 committed by David Goldblatt
parent 81c2f841e5
commit 60993697d8
5 changed files with 241 additions and 2 deletions

View file

@ -1517,6 +1517,16 @@ malloc_conf_init_helper(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS],
}
CONF_CONTINUE;
}
/*
* Undocumented. When set to false, don't
* correct for an unbiasing bug in jeprof
* attribution. This can be handy if you want
* to get consistent numbers from your binary
* across different jemalloc versions, even if
* those numbers are incorrect. The default is
* true.
*/
CONF_HANDLE_BOOL(opt_prof_unbias, "prof_unbias")
}
if (config_log) {
if (CONF_MATCH("log")) {