mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-03 12:27:17 +03:00
Added stats about number of bytes cached in tcache currently.
This commit is contained in:
parent
12ab4383e9
commit
58424e679d
4 changed files with 40 additions and 0 deletions
13
src/stats.c
13
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue