From 68f91893bdc19d009497810c8b945991e1489e71 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Thu, 8 Apr 2010 19:14:51 -0700 Subject: [PATCH] Fix P/p reporting in stats_print(). Now that JEMALLOC_OPTIONS=P isn't the only way to cause stats_print() to be called, opt_stats_print must actually be checked when reporting the state of the P/p option. --- jemalloc/src/stats.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jemalloc/src/stats.c b/jemalloc/src/stats.c index 0c3b8f26..9dc75293 100644 --- a/jemalloc/src/stats.c +++ b/jemalloc/src/stats.c @@ -466,7 +466,9 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque, if ((err = JEMALLOC_P(mallctl)("opt.overcommit", &bv, &bsz, NULL, 0)) == 0) write_cb(cbopaque, bv ? "O" : "o"); - write_cb(cbopaque, "P"); + if ((err = JEMALLOC_P(mallctl)("opt.stats_print", &bv, &bsz, + NULL, 0)) == 0) + write_cb(cbopaque, bv ? "P" : "p"); if ((err = JEMALLOC_P(mallctl)("opt.prof_udump", &bv, &bsz, NULL, 0)) == 0) write_cb(cbopaque, bv ? "U" : "u");