| 5496 | |
| 5497 | #ifdef DDB |
| 5498 | static int64_t |
| 5499 | get_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 | |
| 5524 | DB_SHOW_COMMAND(uma, db_show_uma) |
| 5525 | { |
no test coverage detected