diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2006-02-11 18:44:37 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2006-02-11 18:44:37 +0000 |
| commit | 3f374960e665d4f11bc668dd7d6436d00b3f0548 (patch) | |
| tree | b0be671640aff5988772a55a03653d6a640e3d1b /lib/libmemstat | |
| parent | 3aae74ec02e3ec7615a8df1ed76645fdcdf0a47b (diff) | |
Notes
Diffstat (limited to 'lib/libmemstat')
| -rw-r--r-- | lib/libmemstat/memstat_uma.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c index 911c0996f3d3..924b7c252b0f 100644 --- a/lib/libmemstat/memstat_uma.c +++ b/lib/libmemstat/memstat_uma.c @@ -52,6 +52,8 @@ static struct nlist namelist[] = { { .n_name = "_uma_kegs" }, #define X_MP_MAXID 1 { .n_name = "_mp_maxid" }, +#define X_ALL_CPUS 2 + { .n_name = "_all_cpus" }, { .n_name = "" }, }; @@ -309,6 +311,7 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle) struct uma_keg *kzp, kz; int hint_dontsearch, i, mp_maxid, ret; char name[MEMTYPE_MAXNAME]; + __cpumask_t all_cpus; kvm_t *kvm; kvm = (kvm_t *)kvm_handle; @@ -332,6 +335,11 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle) list->mtl_error = ret; return (-1); } + ret = kread_symbol(kvm, X_ALL_CPUS, &all_cpus, sizeof(all_cpus), 0); + if (ret != 0) { + list->mtl_error = ret; + return (-1); + } for (kzp = LIST_FIRST(&uma_kegs); kzp != NULL; kzp = LIST_NEXT(&kz, uk_link)) { ret = kread(kvm, kzp, &kz, sizeof(kz), 0); @@ -378,6 +386,8 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle) if (kz.uk_flags & UMA_ZFLAG_INTERNAL) goto skip_percpu; for (i = 0; i < mp_maxid + 1; i++) { + if ((all_cpus & (1 << i)) == 0) + continue; ucp = &uz.uz_cpu[i]; mtp->mt_numallocs += ucp->uc_allocs; mtp->mt_numfrees += ucp->uc_frees; |
