Annotation of 43BSDReno/sys/kern/vm_mon.c, revision 1.1

1.1     ! root        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.3 (Berkeley) 4/2/90
        !             7:  */
        !             8: 
        !             9: #include "param.h"
        !            10: #include "systm.h"
        !            11: #include "user.h"
        !            12: #include "vmmeter.h"
        !            13: #include "trace.h"
        !            14: #include "kernel.h"
        !            15: 
        !            16: #ifdef PGINPROF
        !            17: 
        !            18: int pmonmin = PMONMIN;
        !            19: int pres = PRES;
        !            20: int rmonmin = RMONMIN;
        !            21: int rres = RRES;
        !            22: 
        !            23: vmsizmon()
        !            24: {
        !            25:        register int i;
        !            26:        register proc *p = u.u_procp;
        !            27: 
        !            28:        i = (u.u_dsize / DRES) < NDMON ? (u.u_dsize / DRES):NDMON;
        !            29:        dmon[i] += p->p_utime.tv_sec - u.u_outime;
        !            30: 
        !            31:        i = (u.u_ssize / SRES) < NSMON ? (u.u_ssize / SRES):NSMON;
        !            32:        smon[i] += p->p_utime.tv_sec - u.u_outime;
        !            33:        u.u_outime = p->p_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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.