From 4d4250da00e8f202ebcf4523fa25568d04b116ad Mon Sep 17 00:00:00 2001 From: dg Date: Sat, 27 Aug 1994 16:14:39 +0000 Subject: 1) Changed ddb into a option rather than a pseudo-device (use options DDB in your kernel config now). 2) Added ps ddb function from 1.1.5. Cleaned it up a bit and moved into its own file. 3) Added \r handing in db_printf. 4) Added missing memory usage stats to statclock(). 5) Added dummy function to pseudo_set so it will be emitted if there are no other pseudo declarations. --- sys/kern/kern_tc.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'sys/kern/kern_tc.c') diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 5b365f5..788e279 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.3 1994/08/02 07:41:54 davidg Exp $ + * $Id: kern_clock.c,v 1.4 1994/08/18 22:34:58 wollman Exp $ */ #include @@ -46,6 +46,7 @@ #include #include #include +#include #include @@ -431,11 +432,28 @@ statclock(frame) #ifdef GPROF register struct gmonparam *g; #endif - register struct proc *p; + register struct proc *p = curproc; register int i; + if (p) { + struct pstats *pstats; + struct rusage *ru; + struct vmspace *vm; + + /* bump the resource usage of integral space use */ + if ((pstats = p->p_stats) && (ru = &pstats->p_ru) && (vm = p->p_vmspace)) { + ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024; + ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024; + ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024; + if ((vm->vm_pmap.pm_stats.resident_count * PAGE_SIZE / 1024) > + ru->ru_maxrss) { + ru->ru_maxrss = + vm->vm_pmap.pm_stats.resident_count * PAGE_SIZE / 1024; + } + } + } + if (CLKF_USERMODE(frame)) { - p = curproc; if (p->p_flag & P_PROFIL) addupc_intr(p, CLKF_PC(frame), 1); if (--pscnt > 0) @@ -477,7 +495,6 @@ statclock(frame) * so that we know how much of its real time was spent * in ``non-process'' (i.e., interrupt) work. */ - p = curproc; if (CLKF_INTR(frame)) { if (p != NULL) p->p_iticks++; -- cgit v1.1