Deleted Added
full compact
vm_meter.c (14531) vm_meter.c (15809)
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. 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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)vm_meter.c 8.4 (Berkeley) 1/4/94
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. 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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)vm_meter.c 8.4 (Berkeley) 1/4/94
34 * $Id: vm_meter.c,v 1.13 1995/12/14 09:55:02 phk Exp $
34 * $Id: vm_meter.c,v 1.14 1996/03/11 06:11:40 hsu Exp $
35 */
36
37#include <sys/param.h>
38#include <sys/proc.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/vmmeter.h>
42#include <sys/queue.h>

--- 88 unchanged lines hidden (view full) ---

131 vm_map_t map;
132 int paging;
133
134 totalp = &total;
135 bzero(totalp, sizeof *totalp);
136 /*
137 * Mark all objects as inactive.
138 */
35 */
36
37#include <sys/param.h>
38#include <sys/proc.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/vmmeter.h>
42#include <sys/queue.h>

--- 88 unchanged lines hidden (view full) ---

131 vm_map_t map;
132 int paging;
133
134 totalp = &total;
135 bzero(totalp, sizeof *totalp);
136 /*
137 * Mark all objects as inactive.
138 */
139 for (object = vm_object_list.tqh_first;
139 for (object = TAILQ_FIRST(&vm_object_list);
140 object != NULL;
140 object != NULL;
141 object = object->object_list.tqe_next)
141 object = TAILQ_NEXT(object,object_list))
142 object->flags &= ~OBJ_ACTIVE;
143 /*
144 * Calculate process statistics.
145 */
146 for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
147 if (p->p_flag & P_SYSTEM)
148 continue;
149 switch (p->p_stat) {

--- 36 unchanged lines hidden (view full) ---

186 paging |= entry->object.vm_object->paging_in_progress;
187 }
188 if (paging)
189 totalp->t_pw++;
190 }
191 /*
192 * Calculate object memory usage statistics.
193 */
142 object->flags &= ~OBJ_ACTIVE;
143 /*
144 * Calculate process statistics.
145 */
146 for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
147 if (p->p_flag & P_SYSTEM)
148 continue;
149 switch (p->p_stat) {

--- 36 unchanged lines hidden (view full) ---

186 paging |= entry->object.vm_object->paging_in_progress;
187 }
188 if (paging)
189 totalp->t_pw++;
190 }
191 /*
192 * Calculate object memory usage statistics.
193 */
194 for (object = vm_object_list.tqh_first;
194 for (object = TAILQ_FIRST(&vm_object_list);
195 object != NULL;
195 object != NULL;
196 object = object->object_list.tqe_next) {
196 object = TAILQ_NEXT(object, object_list)) {
197 totalp->t_vm += num_pages(object->size);
198 totalp->t_rm += object->resident_page_count;
199 if (object->flags & OBJ_ACTIVE) {
200 totalp->t_avm += num_pages(object->size);
201 totalp->t_arm += object->resident_page_count;
202 }
203 if (object->ref_count > 1) {
204 /* shared object */

--- 14 unchanged lines hidden ---
197 totalp->t_vm += num_pages(object->size);
198 totalp->t_rm += object->resident_page_count;
199 if (object->flags & OBJ_ACTIVE) {
200 totalp->t_avm += num_pages(object->size);
201 totalp->t_arm += object->resident_page_count;
202 }
203 if (object->ref_count > 1) {
204 /* shared object */

--- 14 unchanged lines hidden ---