aboutsummaryrefslogtreecommitdiff
path: root/lib/libmemstat
diff options
context:
space:
mode:
authorSean Bruno <sbruno@FreeBSD.org>2010-06-15 19:28:37 +0000
committerSean Bruno <sbruno@FreeBSD.org>2010-06-15 19:28:37 +0000
commitbf9659591505fa132580ae8ffb7cabfae6875bda (patch)
treec365e722a1674a60a8186f54209e8934369f70a5 /lib/libmemstat
parentce304e082094370f5f96ed05cec89af443f623a7 (diff)
Notes
Diffstat (limited to 'lib/libmemstat')
-rw-r--r--lib/libmemstat/memstat.c8
-rw-r--r--lib/libmemstat/memstat.h1
-rw-r--r--lib/libmemstat/memstat_internal.h1
-rw-r--r--lib/libmemstat/memstat_uma.c2
4 files changed, 12 insertions, 0 deletions
diff --git a/lib/libmemstat/memstat.c b/lib/libmemstat/memstat.c
index 28e48138642b..1a08d3f4d462 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 aaa85702e0c5..e973f1a52db4 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 7123518e283a..b7fdd7197cfe 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 b24721fae5d9..4aae61a9bb05 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++) {