memstat.c (147997) | memstat.c (148170) |
---|---|
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.c 147997 2005-07-14 17:40:02Z rwatson $ | 26 * $FreeBSD: head/lib/libmemstat/memstat.c 148170 2005-07-20 09:17:40Z rwatson $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/sysctl.h> 31 32#include <err.h> 33#include <errno.h> 34#include <stdio.h> --- 103 unchanged lines hidden (view full) --- 138 mtp->mt_numallocs = 0; 139 mtp->mt_numfrees = 0; 140 mtp->mt_bytes = 0; 141 mtp->mt_count = 0; 142 mtp->mt_free = 0; 143 mtp->mt_failures = 0; 144 145 mtp->mt_zonefree = 0; | 27 */ 28 29#include <sys/param.h> 30#include <sys/sysctl.h> 31 32#include <err.h> 33#include <errno.h> 34#include <stdio.h> --- 103 unchanged lines hidden (view full) --- 138 mtp->mt_numallocs = 0; 139 mtp->mt_numfrees = 0; 140 mtp->mt_bytes = 0; 141 mtp->mt_count = 0; 142 mtp->mt_free = 0; 143 mtp->mt_failures = 0; 144 145 mtp->mt_zonefree = 0; |
146 mtp->mt_kegfree = 0; |
|
146 147 for (i = 0; i < MEMSTAT_MAXCPU; i++) { 148 mtp->mt_percpu_alloc[i].mtp_memalloced = 0; 149 mtp->mt_percpu_alloc[i].mtp_memfreed = 0; 150 mtp->mt_percpu_alloc[i].mtp_numallocs = 0; 151 mtp->mt_percpu_alloc[i].mtp_numfrees = 0; 152 mtp->mt_percpu_alloc[i].mtp_sizemask = 0; 153 mtp->mt_percpu_cache[i].mtp_free = 0; --- 133 unchanged lines hidden (view full) --- 287uint64_t 288memstat_get_zonefree(const struct memory_type *mtp) 289{ 290 291 return (mtp->mt_zonefree); 292} 293 294uint64_t | 147 148 for (i = 0; i < MEMSTAT_MAXCPU; i++) { 149 mtp->mt_percpu_alloc[i].mtp_memalloced = 0; 150 mtp->mt_percpu_alloc[i].mtp_memfreed = 0; 151 mtp->mt_percpu_alloc[i].mtp_numallocs = 0; 152 mtp->mt_percpu_alloc[i].mtp_numfrees = 0; 153 mtp->mt_percpu_alloc[i].mtp_sizemask = 0; 154 mtp->mt_percpu_cache[i].mtp_free = 0; --- 133 unchanged lines hidden (view full) --- 288uint64_t 289memstat_get_zonefree(const struct memory_type *mtp) 290{ 291 292 return (mtp->mt_zonefree); 293} 294 295uint64_t |
296memstat_get_kegfree(const struct memory_type *mtp) 297{ 298 299 return (mtp->mt_kegfree); 300} 301 302uint64_t |
|
295memstat_get_percpu_memalloced(const struct memory_type *mtp, int cpu) 296{ 297 298 return (mtp->mt_percpu_alloc[cpu].mtp_memalloced); 299} 300 301uint64_t 302memstat_get_percpu_memfreed(const struct memory_type *mtp, int cpu) --- 64 unchanged lines hidden --- | 303memstat_get_percpu_memalloced(const struct memory_type *mtp, int cpu) 304{ 305 306 return (mtp->mt_percpu_alloc[cpu].mtp_memalloced); 307} 308 309uint64_t 310memstat_get_percpu_memfreed(const struct memory_type *mtp, int cpu) --- 64 unchanged lines hidden --- |