>>>>> On Mon, 15 Jan 2001 21:07:08 +0100 (CET)
>>>>> Paul Herman <[EMAIL PROTECTED]> said:

pherman> Yes, that's my read from the source.  What I also like about it is
pherman> that it counts [vr]forks to boot, plus vmpages affected by the fork.

pherman> After I first saw this in OBSD I was really motivated to do just what
pherman> you've done for FreeBSD, but never got around to it.

I just moved nforks into vm_meter.c  Here is a patch:

Index: sys/kern/kern_fork.c
diff -u sys/kern/kern_fork.c.orig sys/kern/kern_fork.c
--- sys/kern/kern_fork.c.orig   Fri Jan 12 02:46:53 2001
+++ sys/kern/kern_fork.c        Tue Jan 16 04:53:18 2001
@@ -145,6 +145,7 @@
 
 int    nprocs = 1;                             /* process 0 */
 static int nextpid = 0;
+extern unsigned int nforks;
 
 /*
  * Random component to nextpid generation.  We mix in a random factor to make
@@ -277,6 +278,8 @@
        }
 
        newproc->p_vmspace = NULL;
+
+       nforks++;
 
        /*
         * Find an unused process ID.  We remember a range of unused IDs
Index: sys/vm/vm_meter.c
diff -u sys/vm/vm_meter.c.orig sys/vm/vm_meter.c
--- sys/vm/vm_meter.c.orig      Fri Jan 12 02:48:48 2001
+++ sys/vm/vm_meter.c   Tue Jan 16 04:51:49 2001
@@ -126,6 +126,10 @@
 SYSCTL_UINT(_vm, OID_AUTO, v_free_severe,
        CTLFLAG_RW, &cnt.v_free_severe, 0, "");
 
+unsigned int nforks = 0;
+SYSCTL_UINT(_vm, OID_AUTO, nforks, CTLFLAG_RD, &nforks, 0,
+       "number of fork()s since boot");
+
 SYSCTL_STRUCT(_vm, VM_LOADAVG, loadavg, CTLFLAG_RD, 
     &averunnable, loadavg, "Machine loadaverage history");
 

pherman> If you like, I'll see if I can't come up with something
pherman> similar.  Shouldn't be too hard.  I'll try that tonight.

Please do it.

pherman> The hardest part would be finding a spot on the systat(1) display to
pherman> put it. :-)

Exactly.

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
[EMAIL PROTECTED]  [EMAIL PROTECTED]  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to