aboutsummaryrefslogtreecommitdiffstats
path: root/src/stats.c
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2016-04-22 18:37:44 -0700
committerQi Wang <interwq@gmail.com>2017-01-18 10:55:21 -0800
commit58424e679d7c1095c0ac2f148ee558d6a067f577 (patch)
treec389083dcb396eb4d4f5631397252a71579d752c /src/stats.c
parent12ab4383e9ea743e8e6b9115be73f2c6dfde5e24 (diff)
downloadplatform_external_jemalloc_new-58424e679d7c1095c0ac2f148ee558d6a067f577.tar.gz
platform_external_jemalloc_new-58424e679d7c1095c0ac2f148ee558d6a067f577.tar.bz2
platform_external_jemalloc_new-58424e679d7c1095c0ac2f148ee558d6a067f577.zip
Added stats about number of bytes cached in tcache currently.
Diffstat (limited to 'src/stats.c')
-rw-r--r--src/stats.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/stats.c b/src/stats.c
index ef349a50..f20fd4ce 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -261,6 +261,7 @@ stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque,
uint64_t small_nmalloc, small_ndalloc, small_nrequests;
size_t large_allocated;
uint64_t large_nmalloc, large_ndalloc, large_nrequests;
+ size_t tcache_bytes;
CTL_GET("arenas.page", &page, size_t);
@@ -423,6 +424,18 @@ stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque,
"internal: %12zu\n", internal);
}
+ if (config_tcache) {
+ CTL_M2_GET("stats.arenas.0.tcache_bytes", i, &tcache_bytes,
+ size_t);
+ if (json) {
+ malloc_cprintf(write_cb, cbopaque,
+ "\t\t\t\t\"tcache\": %zu,\n", tcache_bytes);
+ } else {
+ malloc_cprintf(write_cb, cbopaque,
+ "tcache: %12zu\n", tcache_bytes);
+ }
+ }
+
CTL_M2_GET("stats.arenas.0.resident", i, &resident, size_t);
if (json) {
malloc_cprintf(write_cb, cbopaque,