MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tcache_stats_merge

Function tcache_stats_merge

app/redis-6.2.6/deps/jemalloc/src/tcache.c:528–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528void
529tcache_stats_merge(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena) {
530 unsigned i;
531
532 cassert(config_stats);
533
534 /* Merge and reset tcache stats. */
535 for (i = 0; i < NBINS; i++) {
536 bin_t *bin = &arena->bins[i];
537 cache_bin_t *tbin = tcache_small_bin_get(tcache, i);
538 malloc_mutex_lock(tsdn, &bin->lock);
539 bin->stats.nrequests += tbin->tstats.nrequests;
540 malloc_mutex_unlock(tsdn, &bin->lock);
541 tbin->tstats.nrequests = 0;
542 }
543
544 for (; i < nhbins; i++) {
545 cache_bin_t *tbin = tcache_large_bin_get(tcache, i);
546 arena_stats_large_nrequests_add(tsdn, &arena->stats, i,
547 tbin->tstats.nrequests);
548 tbin->tstats.nrequests = 0;
549 }
550}
551
552static bool
553tcaches_create_prep(tsd_t *tsd) {

Callers 2

stats_print_atexitFunction · 0.85
tcache_arena_dissociateFunction · 0.85

Calls 3

malloc_mutex_lockFunction · 0.85
malloc_mutex_unlockFunction · 0.85

Tested by

no test coverage detected