diff options
author | Jason Evans <je@fb.com> | 2012-03-13 15:46:12 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2012-03-13 15:46:12 (GMT) |
commit | eb2398106fd1b43989c12796eb706aea79b11859 (patch) | |
tree | d1005965fff7d3782465ef411142f9827da6615f /src | |
parent | 025d86118673f153b6ccd68e49054e58493b57f4 (diff) | |
download | jemalloc-eb2398106fd1b43989c12796eb706aea79b11859.zip jemalloc-eb2398106fd1b43989c12796eb706aea79b11859.tar.gz jemalloc-eb2398106fd1b43989c12796eb706aea79b11859.tar.bz2 |
Fix malloc_stats_print() option support.
Fix malloc_stats_print() to honor 'b' and 'l' in the opts parameter.
Diffstat (limited to 'src')
-rw-r--r-- | src/stats.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/stats.c b/src/stats.c index 38c8bb3..f494974 100644 --- a/src/stats.c +++ b/src/stats.c @@ -49,7 +49,7 @@ static void stats_arena_bins_print(void (*write_cb)(void *, const char *), static void stats_arena_lruns_print(void (*write_cb)(void *, const char *), void *cbopaque, unsigned i); static void stats_arena_print(void (*write_cb)(void *, const char *), - void *cbopaque, unsigned i); + void *cbopaque, unsigned i, bool bins, bool large); /******************************************************************************/ @@ -203,7 +203,7 @@ stats_arena_lruns_print(void (*write_cb)(void *, const char *), void *cbopaque, static void stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque, - unsigned i) + unsigned i, bool bins, bool large) { unsigned nthreads; size_t pagesize, pactive, pdirty, mapped; @@ -256,8 +256,10 @@ stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque, CTL_I_GET("stats.arenas.0.mapped", &mapped, size_t); malloc_cprintf(write_cb, cbopaque, "mapped: %12zu\n", mapped); - stats_arena_bins_print(write_cb, cbopaque, i); - stats_arena_lruns_print(write_cb, cbopaque, i); + if (bins) + stats_arena_bins_print(write_cb, cbopaque, i); + if (large) + stats_arena_lruns_print(write_cb, cbopaque, i); } void @@ -506,7 +508,7 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque, malloc_cprintf(write_cb, cbopaque, "\nMerged arenas stats:\n"); stats_arena_print(write_cb, cbopaque, - narenas); + narenas, bins, large); } } } @@ -532,7 +534,7 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque, cbopaque, "\narenas[%u]:\n", i); stats_arena_print(write_cb, - cbopaque, i); + cbopaque, i, bins, large); } } } |