summaryrefslogtreecommitdiffstats
path: root/lib/libmemstat/memstat.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-08-01 19:07:39 +0000
committerrwatson <rwatson@FreeBSD.org>2005-08-01 19:07:39 +0000
commitf5e7c145fc0e6d604adea539ccb9fbec7802f9a2 (patch)
tree114f0eee6842ca4f71539f0be9d6d57137832be8 /lib/libmemstat/memstat.h
parentef7c6d9a808a36b9b16699fca1db857a58d8b449 (diff)
downloadFreeBSD-src-f5e7c145fc0e6d604adea539ccb9fbec7802f9a2.zip
FreeBSD-src-f5e7c145fc0e6d604adea539ccb9fbec7802f9a2.tar.gz
Add memstat_kvm_uma(), an implementation of a libmemstat(3) query routine
that knows how to extract UMA(9) allocator statistics from a core dump or live memory image using kvm(3). The caller is expected to provide the necessary kvm_t handle, which is then used by libmemstat(3). With these changes, it is trivially straight forward to re-introduce vmstat -z support on core dumps, which was lost when UMA was introduced. In the short term, this requires including vm/ include files that are not intended for extra-kernel use, requiring in turn some ugliness.
Diffstat (limited to 'lib/libmemstat/memstat.h')
-rw-r--r--lib/libmemstat/memstat.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libmemstat/memstat.h b/lib/libmemstat/memstat.h
index f466408..561f6ee 100644
--- a/lib/libmemstat/memstat.h
+++ b/lib/libmemstat/memstat.h
@@ -72,6 +72,9 @@
#define MEMSTAT_ERROR_PERMISSION 3 /* Permission denied. */
#define MEMSTAT_ERROR_TOOMANYCPUS 4 /* Too many CPUs. */
#define MEMSTAT_ERROR_DATAERROR 5 /* Error in stat data. */
+#define MEMSTAT_ERROR_KVM 6 /* See kvm_geterr() for err. */
+#define MEMSTAT_ERROR_KVM_NOSYMBOL 7 /* Symbol not available. */
+#define MEMSTAT_ERROR_KVM_SHORTREAD 8 /* Short kvm_read return. */
/*
* Forward declare struct memory_type, which holds per-type properties and
@@ -113,6 +116,12 @@ int memstat_sysctl_malloc(struct memory_type_list *list, int flags);
int memstat_sysctl_uma(struct memory_type_list *list, int flags);
/*
+ * Functions to retrieve data from a kernel core (or /dev/kmem).
+ */
+int memstat_kvm_all(struct memory_type_list *list, void *kvm_handle);
+int memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle);
+
+/*
* Accessor methods for struct memory_type.
*/
const char *memstat_get_name(const struct memory_type *mtp);
OpenPOWER on IntegriCloud