diff options
author | kstailey <kstailey@cvs.openbsd.org> | 1997-07-07 17:52:11 +0000 |
---|---|---|
committer | kstailey <kstailey@cvs.openbsd.org> | 1997-07-07 17:52:11 +0000 |
commit | 2c9f33922f8470ef09f585ffed047875a1fef35d (patch) | |
tree | b6659b46286caf3e04c6c2d59a583e25b9c3732d | |
parent | 74c86b2a6777916582c8f73f0285cec095ebc16d (diff) |
count pages in forkstat, see "vmstat -f"
-rw-r--r-- | sys/kern/kern_fork.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 9871a9fc0bd..9c4cd342abf 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.8 1997/06/05 10:15:26 deraadt Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.9 1997/07/07 17:52:10 kstailey Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -113,6 +113,7 @@ fork1(p1, forktype, rforkflags, retval) register struct proc *p2; register uid_t uid; struct proc *newproc; + struct vmspace *vm; int count; static int pidchecked = 0; int dupfd = 1, cleanfd = 0; @@ -319,16 +320,20 @@ again: */ vm_fork(p1, p2); #endif + vm = p2->p_vmspace; switch (forktype) { case ISFORK: forkstat.cntfork++; + forkstat.sizfork += vm->vm_dsize + vm->vm_ssize; break; case ISVFORK: forkstat.cntvfork++; + forkstat.sizvfork += vm->vm_dsize + vm->vm_ssize; break; case ISRFORK: forkstat.cntrfork++; + forkstat.sizrfork += vm->vm_dsize + vm->vm_ssize; break; } |