1: /*
   2:  * Copyright (c) 1982, 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)vm_mon.c	7.1 (Berkeley) 6/5/86
   7:  */
   8: 
   9: #include "param.h"
  10: #include "systm.h"
  11: #include "dir.h"
  12: #include "user.h"
  13: #include "vmmeter.h"
  14: #include "trace.h"
  15: #include "kernel.h"
  16: 
  17: #ifdef PGINPROF
  18: 
  19: int pmonmin = PMONMIN;
  20: int pres = PRES;
  21: int rmonmin = RMONMIN;
  22: int rres = RRES;
  23: 
  24: vmsizmon()
  25: {
  26:     register int i;
  27: 
  28:     i = (u.u_dsize / DRES) < NDMON ? (u.u_dsize / DRES):NDMON;
  29:     dmon[i] += u.u_ru.ru_utime.tv_sec - u.u_outime;
  30: 
  31:     i = (u.u_ssize / SRES) < NSMON ? (u.u_ssize / SRES):NSMON;
  32:     smon[i] += u.u_ru.ru_utime.tv_sec - u.u_outime;
  33:     u.u_outime = u.u_ru.ru_utime.tv_sec;
  34: }
  35: 
  36: vmfltmon(hist, atime, amin, res, nmax)
  37:     register unsigned int *hist;
  38:     register int atime, amin, res, nmax;
  39: {
  40:     register int i;
  41: 
  42:     i = (atime - amin) / res;
  43:     if (i>=0 && i<nmax)
  44:         hist[i+1]++;
  45:     else
  46:         i<0 ? hist[0]++ : hist[nmax+1]++;
  47: }
  48: #endif
  49: 
  50: #ifdef TRACE
  51: /*VARARGS*/
  52: trace1(args)
  53:     int args;
  54: {
  55:     register int nargs;
  56:     register int x;
  57:     register int *argp, *tracep;
  58: 
  59:     nargs = 4;
  60:     x = tracex % TRCSIZ;
  61:     if (x + nargs >= TRCSIZ) {
  62:         tracex += (TRCSIZ - x);
  63:         x = 0;
  64:     }
  65:     argp = &args;
  66:     tracep = &tracebuf[x];
  67:     tracex += nargs;
  68:     *tracep++ = (time.tv_sec%1000)*1000 + (time.tv_usec/1000);
  69:     nargs--;
  70:     do
  71:         *tracep++ = *argp++;
  72:     while (--nargs > 0);
  73: }
  74: #endif

Defined functions

trace1 defined in line 52; used 1 times
vmfltmon defined in line 36; used 2 times
vmsizmon defined in line 24; used 2 times

Defined variables

pmonmin defined in line 19; never used
pres defined in line 20; never used
rmonmin defined in line 21; never used
rres defined in line 22; never used
Last modified: 1986-06-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 505
Valid CSS Valid XHTML 1.0 Strict