home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / bsd / sys / trace.h < prev    next >
C/C++ Source or Header  |  1993-10-19  |  5KB  |  154 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1989 Carnegie-Mellon University
  4.  * Copyright (c) 1988 Carnegie-Mellon University
  5.  * Copyright (c) 1987 Carnegie-Mellon University
  6.  * All rights reserved.  The CMU software License Agreement specifies
  7.  * the terms and conditions for use and redistribution.
  8.  */
  9. /*
  10.  * HISTORY
  11.  * $Log:    trace.h,v $
  12.  * Revision 2.5  89/03/09  22:08:54  rpd
  13.  *     More cleanup.
  14.  * 
  15.  * Revision 2.4  89/02/25  17:57:17  gm0w
  16.  *     Made all CMUCS conditional stuff always true. Changed
  17.  *     romp to ibmrt.
  18.  *     [89/02/14            mrt]
  19.  * 
  20.  * Revision 2.3  88/11/23  16:36:57  rpd
  21.  *     Added fd driver trace points from Acis.
  22.  *     [88/11/04  17:56:32  rpd]
  23.  * 
  24.  * Revision 2.2  88/08/24  02:49:44  mwyoung
  25.  *     Adjusted include file references.
  26.  *     [88/08/17  02:26:00  mwyoung]
  27.  *
  28.  * 24-Aug-87  Richard Sanzi (sanzi) at Carnegie-Mellon University
  29.  *    Added several trace values for the romp from the 4.3 ACIS code.
  30.  *
  31.  * 14-Oct-86  Avadis Tevanian (avie) at Carnegie-Mellon University
  32.  *    Conditionalize the previous bug fix on CS_BUGFIX.
  33.  *
  34.  *  7-Oct-86  David L. Black (dlb) at Carnegie-Mellon University
  35.  *    trace(a,b,b) -> trace(a,b,c) bug fix.
  36.  *
  37.  */
  38. /*
  39.  * Copyright (c) 1982, 1986 Regents of the University of California.
  40.  * All rights reserved.  The Berkeley software License Agreement
  41.  * specifies the terms and conditions for redistribution.
  42.  *
  43.  *    @(#)trace.h    7.1 (Berkeley) 6/4/86
  44.  */
  45.  
  46. #ifndef    _SYS_TRACE_H_
  47. #define _SYS_TRACE_H_
  48.  
  49. /*
  50.  * File system buffer tracing points; all trace <pack(dev, size), bn>
  51.  */
  52. #define TR_BREADHIT    0    /* buffer read found in cache */
  53. #define TR_BREADMISS    1    /* buffer read not in cache */
  54. #define TR_BWRITE    2    /* buffer written */
  55. #define TR_BREADHITRA    3    /* buffer read-ahead found in cache */
  56. #define TR_BREADMISSRA    4    /* buffer read-ahead not in cache */
  57. #define TR_XFODMISS    5    /* exe fod read */
  58. #define TR_XFODHIT    6    /* exe fod read */
  59. #define TR_BRELSE    7    /* brelse */
  60. #define TR_BREALLOC    8    /* expand/contract a buffer */
  61.  
  62. /*
  63.  * Memory allocator trace points; all trace the amount of memory involved
  64.  */
  65. #define TR_MALL        10    /* memory allocated */
  66.  
  67. /*
  68.  * Paging trace points: all are <vaddr, pid>
  69.  */
  70. #define TR_INTRANS    20    /* page intransit block */
  71. #define TR_EINTRANS    21    /* page intransit wait done */
  72. #define TR_FRECLAIM    22    /* reclaim from free list */
  73. #define TR_RECLAIM    23    /* reclaim from loop */
  74. #define TR_XSFREC    24    /* reclaim from free list instead of drum */
  75. #define TR_XIFREC    25    /* reclaim from free list instead of fsys */
  76. #define TR_WAITMEM    26    /* wait for memory in pagein */
  77. #define TR_EWAITMEM    27    /* end memory wait in pagein */
  78. #define TR_ZFOD        28    /* zfod page fault */
  79. #define TR_EXFOD    29    /* exec fod page fault */
  80. #define TR_VRFOD    30    /* vread fod page fault */
  81. #define TR_CACHEFOD    31    /* fod in file system cache */
  82. #define TR_SWAPIN    32    /* drum page fault */
  83. #define TR_PGINDONE    33    /* page in done */
  84. #define TR_SWAPIO    34    /* swap i/o request arrives */
  85.  
  86. /*
  87.  * System call trace points.
  88.  */
  89. #define TR_VADVISE    40    /* vadvise occurred with <arg, pid> */
  90.  
  91. /*
  92.  * Miscellaneous
  93.  */
  94. #define TR_STAMP    45    /* user said vtrace(VTR_STAMP, value); */
  95. #ifdef    ibmrt
  96. #define TR_RWIP        49    /* rwip() */
  97.  
  98. /*
  99.  * Disk device driver (EESDI only at present) trace points
  100.  */
  101. #define TR_D_ENQ    50    /* enqueue - strategy called */
  102. #define TR_D_GO        51    /* go - cmd given to adapter */
  103. #define TR_D_INT    52    /* interrupt - from adapter */
  104. /*
  105.  * Floppy device driver trace points
  106.  */
  107. #define TR_F_STR    60    /* enqueue - fdstrategy called */
  108. #define TR_F_STA    61    /* fdstart called */
  109. #define TR_F_DGO    62    /* fddgo called */
  110. #define TR_F_INT    63    /* interrupt from adapter - fdint() */
  111. #define TR_F_AUT    64    /* fdautodensity - top of loop */
  112. #define TR_F_REL    65    /* releasing a buffer */
  113. #define TR_F_OPE    66    /* fdopen */
  114. #define TR_F_CLO    67    /* fdclose */
  115. #define TR_F_WAI    68    /* waiting for i/o complete on a buffer */
  116. #define TR_F_FOR    69    /* fdformat */
  117. #endif    ibmrt
  118.  
  119. /*
  120.  * This defines the size of the trace flags array.
  121.  */
  122. #define TR_NFLAGS    100    /* generous */
  123.  
  124. #define TRCSIZ        4096
  125.  
  126. /*
  127.  * Specifications of the vtrace() system call, which takes one argument.
  128.  */
  129. #define VTRACE        64+51
  130.  
  131. #define VTR_DISABLE    0        /* set a trace flag to 0 */
  132. #define VTR_ENABLE    1        /* set a trace flag to 1 */
  133. #define VTR_VALUE    2        /* return value of a trace flag */
  134. #define VTR_UALARM    3        /* set alarm to go off (sig 16) */
  135.                     /* in specified number of hz */
  136. #define VTR_STAMP    4        /* user specified stamp */
  137.  
  138. #ifdef    KERNEL
  139. #ifdef    TRACE
  140. extern char    traceflags[TR_NFLAGS];
  141. extern struct    proc *traceproc;
  142. extern int    tracebuf[TRCSIZ];
  143. extern unsigned tracex;
  144. extern int    tracewhich;
  145.  
  146. #define pack(a,b)    ((a)<<16)|(b)
  147. #define trace(a,b,c)    if (traceflags[a]) trace1(a,b,c)
  148. #else    TRACE
  149. #define trace(a,b,c)
  150. #endif    TRACE
  151.  
  152. #endif    KERNEL
  153. #endif    _SYS_TRACE_H_
  154.