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

Function get_uma_stats

freebsd/vm/uma_core.c:5498–5522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5496
5497#ifdef DDB
5498static int64_t
5499get_uma_stats(uma_keg_t kz, uma_zone_t z, uint64_t *allocs, uint64_t *used,
5500 uint64_t *sleeps, long *cachefree, uint64_t *xdomain)
5501{
5502 uint64_t frees;
5503 int i;
5504
5505 if (kz->uk_flags & UMA_ZFLAG_INTERNAL) {
5506 *allocs = counter_u64_fetch(z->uz_allocs);
5507 frees = counter_u64_fetch(z->uz_frees);
5508 *sleeps = z->uz_sleeps;
5509 *cachefree = 0;
5510 *xdomain = 0;
5511 } else
5512 uma_zone_sumstat(z, cachefree, allocs, &frees, sleeps,
5513 xdomain);
5514 for (i = 0; i < vm_ndomains; i++) {
5515 *cachefree += ZDOM_GET(z, i)->uzd_nitems;
5516 if (!((z->uz_flags & UMA_ZONE_SECONDARY) &&
5517 (LIST_FIRST(&kz->uk_zones) != z)))
5518 *cachefree += kz->uk_domain[i].ud_free_items;
5519 }
5520 *used = *allocs - frees;
5521 return (((int64_t)*used + *cachefree) * kz->uk_size);
5522}
5523
5524DB_SHOW_COMMAND(uma, db_show_uma)
5525{

Callers 1

uma_core.cFile · 0.85

Calls 2

counter_u64_fetchFunction · 0.85
uma_zone_sumstatFunction · 0.85

Tested by

no test coverage detected