Deleted Added
full compact
vm_meter.c (12286) vm_meter.c (12623)
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.8 1995/07/29 11:44:25 bde Exp $
34 * $Id: vm_meter.c,v 1.9 1995/11/14 09:29:34 phk 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 <vm/vm.h>
42#include <sys/sysctl.h>
43
35 */
36
37#include <sys/param.h>
38#include <sys/proc.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <vm/vm.h>
42#include <sys/sysctl.h>
43
44struct loadavg averunnable; /* load average, of runnable procs */
44struct loadavg averunnable =
45 { {0, 0, 0}, FSCALE }; /* load average, of runnable procs */
46
45struct vmmeter cnt;
46
47int maxslp = MAXSLP;
48
49/*
50 * Constants for averages over 1, 5, and 15 minutes
51 * when sampling at 5 second intervals.
52 */

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

102 CTLFLAG_RW, &cnt.v_inactive_target, 0, "");
103SYSCTL_INT(_vm, VM_V_CACHE_MIN, v_cache_min,
104 CTLFLAG_RW, &cnt.v_cache_min, 0, "");
105SYSCTL_INT(_vm, VM_V_CACHE_MAX, v_cache_max,
106 CTLFLAG_RW, &cnt.v_cache_max, 0, "");
107SYSCTL_INT(_vm, VM_V_PAGEOUT_FREE_MIN, v_pageout_free_min,
108 CTLFLAG_RW, &cnt.v_pageout_free_min, 0, "");
109
47struct vmmeter cnt;
48
49int maxslp = MAXSLP;
50
51/*
52 * Constants for averages over 1, 5, and 15 minutes
53 * when sampling at 5 second intervals.
54 */

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

104 CTLFLAG_RW, &cnt.v_inactive_target, 0, "");
105SYSCTL_INT(_vm, VM_V_CACHE_MIN, v_cache_min,
106 CTLFLAG_RW, &cnt.v_cache_min, 0, "");
107SYSCTL_INT(_vm, VM_V_CACHE_MAX, v_cache_max,
108 CTLFLAG_RW, &cnt.v_cache_max, 0, "");
109SYSCTL_INT(_vm, VM_V_PAGEOUT_FREE_MIN, v_pageout_free_min,
110 CTLFLAG_RW, &cnt.v_pageout_free_min, 0, "");
111
110static int
111vm_loadavg SYSCTL_HANDLER_ARGS
112{
113 averunnable.fscale = FSCALE;
114 return (sysctl_handle_opaque(oidp,
115 oidp->oid_arg1, oidp->oid_arg2, req));
116}
112SYSCTL_STRUCT(_vm, VM_LOADAVG, loadavg, CTLFLAG_RD, &averunnable, loadavg, "");
117
113
118SYSCTL_PROC(_vm, VM_LOADAVG, loadavg, CTLTYPE_OPAQUE|CTLFLAG_RD,
119 &averunnable, sizeof(averunnable), vm_loadavg, "");
120
121static int
122vmtotal SYSCTL_HANDLER_ARGS
123{
124 struct proc *p;
125 struct vmtotal total, *totalp;
126 vm_map_entry_t entry;
127 vm_object_t object;
128 vm_map_t map;

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

207 }
208 }
209 }
210 totalp->t_free = cnt.v_free_count + cnt.v_cache_count;
211 return (sysctl_handle_opaque(oidp, totalp, sizeof total, req));
212}
213
214SYSCTL_PROC(_vm, VM_METER, vmmeter, CTLTYPE_OPAQUE|CTLFLAG_RD,
114static int
115vmtotal SYSCTL_HANDLER_ARGS
116{
117 struct proc *p;
118 struct vmtotal total, *totalp;
119 vm_map_entry_t entry;
120 vm_object_t object;
121 vm_map_t map;

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

200 }
201 }
202 }
203 totalp->t_free = cnt.v_free_count + cnt.v_cache_count;
204 return (sysctl_handle_opaque(oidp, totalp, sizeof total, req));
205}
206
207SYSCTL_PROC(_vm, VM_METER, vmmeter, CTLTYPE_OPAQUE|CTLFLAG_RD,
215 0, sizeof(struct vmtotal), vmtotal, "");
208 0, sizeof(struct vmtotal), vmtotal, "S,vmtotal", "");