home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / sys / vmmeter.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  6.0 KB  |  176 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    vmmeter.h,v $
  29.  * Revision 2.1  92/04/21  17:15:37  rwd
  30.  * BSDSS
  31.  * 
  32.  *
  33.  */
  34.  
  35. /*-
  36.  * Copyright (c) 1982, 1986 The Regents of the University of California.
  37.  * All rights reserved.
  38.  *
  39.  * Redistribution and use in source and binary forms, with or without
  40.  * modification, are permitted provided that the following conditions
  41.  * are met:
  42.  * 1. Redistributions of source code must retain the above copyright
  43.  *    notice, this list of conditions and the following disclaimer.
  44.  * 2. Redistributions in binary form must reproduce the above copyright
  45.  *    notice, this list of conditions and the following disclaimer in the
  46.  *    documentation and/or other materials provided with the distribution.
  47.  * 3. All advertising materials mentioning features or use of this software
  48.  *    must display the following acknowledgement:
  49.  *    This product includes software developed by the University of
  50.  *    California, Berkeley and its contributors.
  51.  * 4. Neither the name of the University nor the names of its contributors
  52.  *    may be used to endorse or promote products derived from this software
  53.  *    without specific prior written permission.
  54.  *
  55.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  56.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  57.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  58.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  59.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  60.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  61.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  62.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  63.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  64.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  65.  * SUCH DAMAGE.
  66.  *
  67.  *    @(#)vmmeter.h    7.3 (Berkeley) 5/5/91
  68.  */
  69.  
  70. /*
  71.  * Virtual memory related instrumentation
  72.  */
  73. struct vmmeter
  74. {
  75. #define    v_first    v_swtch
  76.     unsigned v_swtch;    /* context switches */
  77.     unsigned v_trap;    /* calls to trap */
  78.     unsigned v_syscall;    /* calls to syscall() */
  79.     unsigned v_intr;    /* device interrupts */
  80.     unsigned v_soft;    /* software interrupts */
  81.     unsigned v_pdma;    /* pseudo-dma interrupts */
  82.     unsigned v_pswpin;    /* pages swapped in */
  83.     unsigned v_pswpout;    /* pages swapped out */
  84.     unsigned v_pgin;    /* pageins */
  85.     unsigned v_pgout;    /* pageouts */
  86.     unsigned v_pgpgin;    /* pages paged in */
  87.     unsigned v_pgpgout;    /* pages paged out */
  88.     unsigned v_intrans;    /* intransit blocking page faults */
  89.     unsigned v_pgrec;    /* total page reclaims */
  90.     unsigned v_xsfrec;    /* found in free list rather than on swapdev */
  91.     unsigned v_xifrec;    /* found in free list rather than in filsys */
  92.     unsigned v_exfod;    /* pages filled on demand from executables */
  93.     unsigned v_zfod;    /* pages zero filled on demand */
  94.     unsigned v_vrfod;    /* fills of pages mapped by vread() */
  95.     unsigned v_nexfod;    /* number of exfod's created */
  96.     unsigned v_nzfod;    /* number of zfod's created */
  97.     unsigned v_nvrfod;    /* number of vrfod's created */
  98.     unsigned v_pgfrec;    /* page reclaims from free list */
  99.     unsigned v_faults;    /* total faults taken */
  100.     unsigned v_scan;    /* scans in page out daemon */
  101.     unsigned v_rev;        /* revolutions of the hand */
  102.     unsigned v_seqfree;    /* pages taken from sequential programs */
  103.     unsigned v_dfree;    /* pages freed by daemon */
  104.     unsigned v_fastpgrec;    /* fast reclaims in locore */
  105. #ifdef tahoe
  106.     unsigned v_fpe;        /* floating point emulation traps */
  107.     unsigned v_align;    /* alignment emulation traps */
  108. #endif
  109. #define    v_last v_fastpgrec
  110.     unsigned v_swpin;    /* swapins */
  111.     unsigned v_swpout;    /* swapouts */
  112. };
  113. #ifdef KERNEL
  114. struct    vmmeter cnt, rate, sum;
  115. #endif
  116.  
  117. /* systemwide totals computed every five seconds */
  118. struct vmtotal
  119. {
  120.     short    t_rq;        /* length of the run queue */
  121.     short    t_dw;        /* jobs in ``disk wait'' (neg priority) */
  122.     short    t_pw;        /* jobs in page wait */
  123.     short    t_sl;        /* jobs sleeping in core */
  124.     short    t_sw;        /* swapped out runnable/short block jobs */
  125.     long    t_vm;        /* total virtual memory */
  126.     long    t_avm;        /* active virtual memory */
  127.     long    t_rm;        /* total real memory in use */
  128.     long    t_arm;        /* active real memory */
  129.     long    t_vmtxt;    /* virtual memory used by text */
  130.     long    t_avmtxt;    /* active virtual memory used by text */
  131.     long    t_rmtxt;    /* real memory used by text */
  132.     long    t_armtxt;    /* active real memory used by text */
  133.     long    t_free;        /* free memory pages */
  134. };
  135. #ifdef KERNEL
  136. struct    vmtotal total;
  137. #endif
  138.  
  139. /*
  140.  * Optional instrumentation.
  141.  */
  142. #ifdef PGINPROF
  143.  
  144. #define    NDMON    128
  145. #define    NSMON    128
  146.  
  147. #define    DRES    20
  148. #define    SRES    5
  149.  
  150. #define    PMONMIN    20
  151. #define    PRES    50
  152. #define    NPMON    64
  153.  
  154. #define    RMONMIN    130
  155. #define    RRES    5
  156. #define    NRMON    64
  157.  
  158. /* data and stack size distribution counters */
  159. unsigned int    dmon[NDMON+1];
  160. unsigned int    smon[NSMON+1];
  161.  
  162. /* page in time distribution counters */
  163. unsigned int    pmon[NPMON+2];
  164.  
  165. /* reclaim time distribution counters */
  166. unsigned int    rmon[NRMON+2];
  167.  
  168. int    pmonmin;
  169. int    pres;
  170. int    rmonmin;
  171. int    rres;
  172.  
  173. unsigned rectime;        /* accumulator for reclaim times */
  174. unsigned pgintime;        /* accumulator for page in times */
  175. #endif
  176.