home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / sys / trace.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  5.3 KB  |  149 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:    trace.h,v $
  29.  * Revision 2.1  92/04/21  17:17:24  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.  *    @(#)trace.h    7.6 (Berkeley) 5/5/91
  68.  */
  69.  
  70. /*
  71.  * File system buffer tracing points; all trace <pack(dev, size), bn>
  72.  */
  73. #define    TR_BREADHIT    0    /* buffer read found in cache */
  74. #define    TR_BREADMISS    1    /* buffer read not in cache */
  75. #define    TR_BWRITE    2    /* buffer written */
  76. #define    TR_BREADHITRA    3    /* buffer read-ahead found in cache */
  77. #define    TR_BREADMISSRA    4    /* buffer read-ahead not in cache */
  78. #define    TR_XFODMISS    5    /* exe fod read */
  79. #define    TR_XFODHIT    6    /* exe fod read */
  80. #define    TR_BRELSE    7    /* brelse */
  81. #define    TR_BREALLOC    8    /* expand/contract a buffer */
  82.  
  83. /*
  84.  * Memory allocator trace points; all trace the amount of memory involved
  85.  */
  86. #define    TR_MALL        10    /* memory allocated */
  87.  
  88. /*
  89.  * Paging trace points: all are <vaddr, pid>
  90.  */
  91. #define    TR_INTRANS    20    /* page intransit block */
  92. #define    TR_EINTRANS    21    /* page intransit wait done */
  93. #define    TR_FRECLAIM    22    /* reclaim from free list */
  94. #define    TR_RECLAIM    23    /* reclaim from loop */
  95. #define    TR_XSFREC    24    /* reclaim from free list instead of drum */
  96. #define    TR_XIFREC    25    /* reclaim from free list instead of fsys */
  97. #define    TR_WAITMEM    26    /* wait for memory in pagein */
  98. #define    TR_EWAITMEM    27    /* end memory wait in pagein */
  99. #define    TR_ZFOD        28    /* zfod page fault */
  100. #define    TR_EXFOD    29    /* exec fod page fault */
  101. #define    TR_VRFOD    30    /* vread fod page fault */
  102. #define    TR_CACHEFOD    31    /* fod in file system cache */
  103. #define    TR_SWAPIN    32    /* drum page fault */
  104. #define    TR_PGINDONE    33    /* page in done */
  105. #define    TR_SWAPIO    34    /* swap i/o request arrives */
  106.  
  107. /*
  108.  * System call trace points.
  109.  */
  110. #define    TR_VADVISE    40    /* vadvise occurred with <arg, pid> */
  111.  
  112. /*
  113.  * Miscellaneous
  114.  */
  115. #define    TR_STAMP    45    /* user said vtrace(VTR_STAMP, value); */
  116.  
  117. /*
  118.  * This defines the size of the trace flags array.
  119.  */
  120. #define    TR_NFLAGS    100    /* generous */
  121.  
  122. #define    TRCSIZ        4096
  123.  
  124. /*
  125.  * Specifications of the vtrace() system call, which takes one argument.
  126.  */
  127. #define    VTRACE        64+51
  128.  
  129. #define    VTR_DISABLE    0        /* set a trace flag to 0 */
  130. #define    VTR_ENABLE    1        /* set a trace flag to 1 */
  131. #define    VTR_VALUE    2        /* return value of a trace flag */
  132. #define    VTR_UALARM    3        /* set alarm to go off (sig 16) */
  133.                     /* in specified number of hz */
  134. #define    VTR_STAMP    4        /* user specified stamp */
  135.  
  136. #ifdef KERNEL
  137. #ifdef TRACE
  138. char    traceflags[TR_NFLAGS];
  139. struct    proc *traceproc;
  140. int    tracebuf[TRCSIZ];
  141. unsigned tracex;
  142. int    tracewhich;
  143. #define    pack(v,b)    (((v)->v_mount->mnt_stat.f_fsid.val[0])<<16)|(b)
  144. #define    trace(a,b,c)    if (traceflags[a]) trace1(a,b,c)
  145. #else
  146. #define    trace(a,b,c)    ;
  147. #endif
  148. #endif
  149.