memstat_uma.c (148357) | memstat_uma.c (148381) |
---|---|
1/*- 2 * Copyright (c) 2005 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2005 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/lib/libmemstat/memstat_uma.c 148357 2005-07-24 01:28:54Z rwatson $ | 26 * $FreeBSD: head/lib/libmemstat/memstat_uma.c 148381 2005-07-25 09:52:59Z rwatson $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/sysctl.h> 31 32#include <vm/uma.h> 33 34#include <err.h> --- 171 unchanged lines hidden (view full) --- 206 mtp->mt_memalloced = mtp->mt_numallocs * uthp->uth_size; 207 mtp->mt_memfreed = mtp->mt_numfrees * uthp->uth_size; 208 mtp->mt_bytes = mtp->mt_memalloced - mtp->mt_memfreed; 209 mtp->mt_countlimit = uthp->uth_limit; 210 mtp->mt_byteslimit = uthp->uth_limit * uthp->uth_size; 211 212 mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees; 213 mtp->mt_zonefree = uthp->uth_zone_free; | 27 */ 28 29#include <sys/param.h> 30#include <sys/sysctl.h> 31 32#include <vm/uma.h> 33 34#include <err.h> --- 171 unchanged lines hidden (view full) --- 206 mtp->mt_memalloced = mtp->mt_numallocs * uthp->uth_size; 207 mtp->mt_memfreed = mtp->mt_numfrees * uthp->uth_size; 208 mtp->mt_bytes = mtp->mt_memalloced - mtp->mt_memfreed; 209 mtp->mt_countlimit = uthp->uth_limit; 210 mtp->mt_byteslimit = uthp->uth_limit * uthp->uth_size; 211 212 mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees; 213 mtp->mt_zonefree = uthp->uth_zone_free; |
214 mtp->mt_kegfree = uthp->uth_keg_free; | 214 215 /* 216 * UMA secondary zones share a keg with the primary zone. To 217 * avoid double-reporting of free items, report keg free 218 * items only in the primary zone. 219 */ 220 if (!(uthp->uth_zone_flags & UTH_ZONE_SECONDARY)) { 221 mtp->mt_free += mtp->mt_kegfree; 222 mtp->mt_kegfree = uthp->uth_keg_free; 223 } |
215 mtp->mt_free += mtp->mt_zonefree; 216 } 217 218 free(buffer); 219 220 return (0); 221} | 224 mtp->mt_free += mtp->mt_zonefree; 225 } 226 227 free(buffer); 228 229 return (0); 230} |