summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libmemstat/libmemstat.32
-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.c3
5 files changed, 14 insertions, 1 deletions
diff --git a/lib/libmemstat/libmemstat.3 b/lib/libmemstat/libmemstat.3
index cfe4a2b..a97d7ba 100644
--- a/lib/libmemstat/libmemstat.3
+++ b/lib/libmemstat/libmemstat.3
@@ -93,6 +93,8 @@
.Ft uint64_t
.Fn memstat_get_zonefree "const struct memory_type *mtp"
.Ft uint64_t
+.Fn memstat_get_kegfree "const struct memory_type *mtp"
+.Ft uint64_t
.Fn memstat_get_percpu_memalloced "const struct memory_type *mtp" "int cpu"
.Ft uint64_t
.Fn memstat_get_percpu_memfreed "const struct memory_type *mtp" "int cpu"
diff --git a/lib/libmemstat/memstat.c b/lib/libmemstat/memstat.c
index f2764ff..cbab40a 100644
--- a/lib/libmemstat/memstat.c
+++ b/lib/libmemstat/memstat.c
@@ -143,6 +143,7 @@ memstat_mt_reset_stats(struct memory_type *mtp)
mtp->mt_failures = 0;
mtp->mt_zonefree = 0;
+ mtp->mt_kegfree = 0;
for (i = 0; i < MEMSTAT_MAXCPU; i++) {
mtp->mt_percpu_alloc[i].mtp_memalloced = 0;
@@ -292,6 +293,13 @@ memstat_get_zonefree(const struct memory_type *mtp)
}
uint64_t
+memstat_get_kegfree(const struct memory_type *mtp)
+{
+
+ return (mtp->mt_kegfree);
+}
+
+uint64_t
memstat_get_percpu_memalloced(const struct memory_type *mtp, int cpu)
{
diff --git a/lib/libmemstat/memstat.h b/lib/libmemstat/memstat.h
index 262c4df..823338b 100644
--- a/lib/libmemstat/memstat.h
+++ b/lib/libmemstat/memstat.h
@@ -119,6 +119,7 @@ uint64_t memstat_get_caller_uint64(const struct memory_type *mtp,
void memstat_set_caller_uint64(struct memory_type *mtp, int index,
uint64_t value);
uint64_t memstat_get_zonefree(const struct memory_type *mtp);
+uint64_t memstat_get_kegfree(const struct memory_type *mtp);
uint64_t memstat_get_percpu_memalloced(const struct memory_type *mtp,
int cpu);
uint64_t memstat_get_percpu_memfreed(const struct memory_type *mtp,
diff --git a/lib/libmemstat/memstat_internal.h b/lib/libmemstat/memstat_internal.h
index 1e974df..61eb795 100644
--- a/lib/libmemstat/memstat_internal.h
+++ b/lib/libmemstat/memstat_internal.h
@@ -85,6 +85,7 @@ struct memory_type {
* global stats above.
*/
uint64_t mt_zonefree; /* Free items in zone. */
+ uint64_t mt_kegfree; /* Free items in keg. */
/*
* Per-CPU measurements fall into two categories: per-CPU allocation,
diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c
index 2025931..740fe23 100644
--- a/lib/libmemstat/memstat_uma.c
+++ b/lib/libmemstat/memstat_uma.c
@@ -222,7 +222,8 @@ retry:
mtp->mt_byteslimit = uthp->uth_limit * uthp->uth_size;
mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees;
- mtp->mt_zonefree = uthp->uth_zone_free + uthp->uth_keg_free;
+ mtp->mt_zonefree = uthp->uth_zone_free;
+ mtp->mt_kegfree = uthp->uth_keg_free;
mtp->mt_free += mtp->mt_zonefree;
}
OpenPOWER on IntegriCloud