diff options
author | phk <phk@FreeBSD.org> | 1995-12-04 16:48:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1995-12-04 16:48:58 +0000 |
commit | 6b7609f9092e6573753d281b9aba2b72653ea42c (patch) | |
tree | b9250271aedd3aef5c0e964555606b5cc6e48d0e /sys/vm/vm_meter.c | |
parent | 67e9cc4ace9f1884414dbd0309ecdef08c596c38 (diff) | |
download | FreeBSD-src-6b7609f9092e6573753d281b9aba2b72653ea42c.zip FreeBSD-src-6b7609f9092e6573753d281b9aba2b72653ea42c.tar.gz |
A major sweep over the sysctl stuff.
Move a lot of variables home to their own code (In good time before xmas :-)
Introduce the string descrition of format.
Add a couple more functions to poke into these marvels, while I try to
decide what the correct interface should look like.
Next is adding vars on the fly, and sysctl looking at them too.
Removed a tine bit of defunct and #ifdefed notused code in swapgeneric.
Diffstat (limited to 'sys/vm/vm_meter.c')
-rw-r--r-- | sys/vm/vm_meter.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 887b1ce..e262ce9 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vm_meter.c 8.4 (Berkeley) 1/4/94 - * $Id: vm_meter.c,v 1.8 1995/07/29 11:44:25 bde Exp $ + * $Id: vm_meter.c,v 1.9 1995/11/14 09:29:34 phk Exp $ */ #include <sys/param.h> @@ -41,7 +41,9 @@ #include <vm/vm.h> #include <sys/sysctl.h> -struct loadavg averunnable; /* load average, of runnable procs */ +struct loadavg averunnable = + { {0, 0, 0}, FSCALE }; /* load average, of runnable procs */ + struct vmmeter cnt; int maxslp = MAXSLP; @@ -107,16 +109,7 @@ SYSCTL_INT(_vm, VM_V_CACHE_MAX, v_cache_max, SYSCTL_INT(_vm, VM_V_PAGEOUT_FREE_MIN, v_pageout_free_min, CTLFLAG_RW, &cnt.v_pageout_free_min, 0, ""); -static int -vm_loadavg SYSCTL_HANDLER_ARGS -{ - averunnable.fscale = FSCALE; - return (sysctl_handle_opaque(oidp, - oidp->oid_arg1, oidp->oid_arg2, req)); -} - -SYSCTL_PROC(_vm, VM_LOADAVG, loadavg, CTLTYPE_OPAQUE|CTLFLAG_RD, - &averunnable, sizeof(averunnable), vm_loadavg, ""); +SYSCTL_STRUCT(_vm, VM_LOADAVG, loadavg, CTLFLAG_RD, &averunnable, loadavg, ""); static int vmtotal SYSCTL_HANDLER_ARGS @@ -212,4 +205,4 @@ vmtotal SYSCTL_HANDLER_ARGS } SYSCTL_PROC(_vm, VM_METER, vmmeter, CTLTYPE_OPAQUE|CTLFLAG_RD, - 0, sizeof(struct vmtotal), vmtotal, ""); + 0, sizeof(struct vmtotal), vmtotal, "S,vmtotal", ""); |