diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libmemstat/memstat.c | 8 | ||||
-rw-r--r-- | lib/libmemstat/memstat.h | 1 | ||||
-rw-r--r-- | lib/libmemstat/memstat_internal.h | 1 | ||||
-rw-r--r-- | lib/libmemstat/memstat_uma.c | 2 |
4 files changed, 12 insertions, 0 deletions
diff --git a/lib/libmemstat/memstat.c b/lib/libmemstat/memstat.c index 28e4813..1a08d3f 100644 --- a/lib/libmemstat/memstat.c +++ b/lib/libmemstat/memstat.c @@ -188,6 +188,7 @@ _memstat_mt_reset_stats(struct memory_type *mtp) mtp->mt_count = 0; mtp->mt_free = 0; mtp->mt_failures = 0; + mtp->mt_sleeps = 0; mtp->mt_zonefree = 0; mtp->mt_kegfree = 0; @@ -304,6 +305,13 @@ memstat_get_failures(const struct memory_type *mtp) return (mtp->mt_failures); } +uint64_t +memstat_get_sleeps(const struct memory_type *mtp) +{ + + return (mtp->mt_sleeps); +} + void * memstat_get_caller_pointer(const struct memory_type *mtp, int index) { diff --git a/lib/libmemstat/memstat.h b/lib/libmemstat/memstat.h index aaa85702..e973f1a 100644 --- a/lib/libmemstat/memstat.h +++ b/lib/libmemstat/memstat.h @@ -139,6 +139,7 @@ uint64_t memstat_get_bytes(const struct memory_type *mtp); uint64_t memstat_get_count(const struct memory_type *mtp); uint64_t memstat_get_free(const struct memory_type *mtp); uint64_t memstat_get_failures(const struct memory_type *mtp); +uint64_t memstat_get_sleeps(const struct memory_type *mtp); void *memstat_get_caller_pointer(const struct memory_type *mtp, int index); void memstat_set_caller_pointer(struct memory_type *mtp, diff --git a/lib/libmemstat/memstat_internal.h b/lib/libmemstat/memstat_internal.h index 7123518..b7fdd71 100644 --- a/lib/libmemstat/memstat_internal.h +++ b/lib/libmemstat/memstat_internal.h @@ -65,6 +65,7 @@ struct memory_type { uint64_t mt_count; /* Number of current allocations. */ uint64_t mt_free; /* Number of cached free items. */ uint64_t mt_failures; /* Number of allocation failures. */ + uint64_t mt_sleeps; /* Number of allocation sleeps. */ /* * Caller-owned memory. diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c index b24721f..4aae61a 100644 --- a/lib/libmemstat/memstat_uma.c +++ b/lib/libmemstat/memstat_uma.c @@ -208,6 +208,7 @@ retry: mtp->mt_numallocs = uthp->uth_allocs; mtp->mt_numfrees = uthp->uth_frees; mtp->mt_failures = uthp->uth_fails; + mtp->mt_sleeps = uthp->uth_sleeps; for (j = 0; j < maxcpus; j++) { upsp = (struct uma_percpu_stat *)p; @@ -402,6 +403,7 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle) mtp->mt_numallocs = uz.uz_allocs; mtp->mt_numfrees = uz.uz_frees; mtp->mt_failures = uz.uz_fails; + mtp->mt_sleeps = uz.uz_sleeps; if (kz.uk_flags & UMA_ZFLAG_INTERNAL) goto skip_percpu; for (i = 0; i < mp_maxid + 1; i++) { |