diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-08-01 19:07:39 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-08-01 19:07:39 +0000 |
commit | f5e7c145fc0e6d604adea539ccb9fbec7802f9a2 (patch) | |
tree | 114f0eee6842ca4f71539f0be9d6d57137832be8 /lib/libmemstat/memstat_all.c | |
parent | ef7c6d9a808a36b9b16699fca1db857a58d8b449 (diff) | |
download | FreeBSD-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_all.c')
-rw-r--r-- | lib/libmemstat/memstat_all.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/libmemstat/memstat_all.c b/lib/libmemstat/memstat_all.c index e32047c..b363ab9 100644 --- a/lib/libmemstat/memstat_all.c +++ b/lib/libmemstat/memstat_all.c @@ -45,3 +45,16 @@ memstat_sysctl_all(struct memory_type_list *mtlp, int flags) return (-1); return (0); } + +int +memstat_kvm_all(struct memory_type_list *mtlp, void *kvm_handle) +{ + +#if NOTYET + if (memstat_kvm_malloc(mtlp, kvm_handle) < 0) + return (-1); +#endif + if (memstat_kvm_uma(mtlp, kvm_handle) < 0) + return (-1); + return (0); +} |