|
|
1.1 root 1: /*-
2: * Copyright (c) 1982, 1986 The Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms, with or without
6: * modification, are permitted provided that the following conditions
7: * are met:
8: * 1. Redistributions of source code must retain the above copyright
9: * notice, this list of conditions and the following disclaimer.
10: * 2. Redistributions in binary form must reproduce the above copyright
11: * notice, this list of conditions and the following disclaimer in the
12: * documentation and/or other materials provided with the distribution.
13: * 3. All advertising materials mentioning features or use of this software
14: * must display the following acknowledgement:
15: * This product includes software developed by the University of
16: * California, Berkeley and its contributors.
17: * 4. Neither the name of the University nor the names of its contributors
18: * may be used to endorse or promote products derived from this software
19: * without specific prior written permission.
20: *
21: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31: * SUCH DAMAGE.
32: *
1.1.1.2 ! root 33: * from: @(#)trace.h 7.6 (Berkeley) 5/5/91
! 34: * trace.h,v 1.3 1993/05/20 16:23:28 cgd Exp
1.1 root 35: */
36:
1.1.1.2 ! root 37: #ifndef _SYS_TRACE_H_
! 38: #define _SYS_TRACE_H_
! 39:
1.1 root 40: /*
41: * File system buffer tracing points; all trace <pack(dev, size), bn>
42: */
43: #define TR_BREADHIT 0 /* buffer read found in cache */
44: #define TR_BREADMISS 1 /* buffer read not in cache */
45: #define TR_BWRITE 2 /* buffer written */
46: #define TR_BREADHITRA 3 /* buffer read-ahead found in cache */
47: #define TR_BREADMISSRA 4 /* buffer read-ahead not in cache */
48: #define TR_XFODMISS 5 /* exe fod read */
49: #define TR_XFODHIT 6 /* exe fod read */
50: #define TR_BRELSE 7 /* brelse */
51: #define TR_BREALLOC 8 /* expand/contract a buffer */
52:
53: /*
54: * Memory allocator trace points; all trace the amount of memory involved
55: */
56: #define TR_MALL 10 /* memory allocated */
57:
58: /*
59: * Paging trace points: all are <vaddr, pid>
60: */
61: #define TR_INTRANS 20 /* page intransit block */
62: #define TR_EINTRANS 21 /* page intransit wait done */
63: #define TR_FRECLAIM 22 /* reclaim from free list */
64: #define TR_RECLAIM 23 /* reclaim from loop */
65: #define TR_XSFREC 24 /* reclaim from free list instead of drum */
66: #define TR_XIFREC 25 /* reclaim from free list instead of fsys */
67: #define TR_WAITMEM 26 /* wait for memory in pagein */
68: #define TR_EWAITMEM 27 /* end memory wait in pagein */
69: #define TR_ZFOD 28 /* zfod page fault */
70: #define TR_EXFOD 29 /* exec fod page fault */
71: #define TR_VRFOD 30 /* vread fod page fault */
72: #define TR_CACHEFOD 31 /* fod in file system cache */
73: #define TR_SWAPIN 32 /* drum page fault */
74: #define TR_PGINDONE 33 /* page in done */
75: #define TR_SWAPIO 34 /* swap i/o request arrives */
76:
77: /*
78: * System call trace points.
79: */
80: #define TR_VADVISE 40 /* vadvise occurred with <arg, pid> */
81:
82: /*
83: * Miscellaneous
84: */
85: #define TR_STAMP 45 /* user said vtrace(VTR_STAMP, value); */
86:
87: /*
88: * This defines the size of the trace flags array.
89: */
90: #define TR_NFLAGS 100 /* generous */
91:
92: #define TRCSIZ 4096
93:
94: /*
95: * Specifications of the vtrace() system call, which takes one argument.
96: */
97: #define VTRACE 64+51
98:
99: #define VTR_DISABLE 0 /* set a trace flag to 0 */
100: #define VTR_ENABLE 1 /* set a trace flag to 1 */
101: #define VTR_VALUE 2 /* return value of a trace flag */
102: #define VTR_UALARM 3 /* set alarm to go off (sig 16) */
103: /* in specified number of hz */
104: #define VTR_STAMP 4 /* user specified stamp */
105:
106: #ifdef KERNEL
107: #ifdef TRACE
108: char traceflags[TR_NFLAGS];
109: struct proc *traceproc;
110: int tracebuf[TRCSIZ];
111: unsigned tracex;
112: int tracewhich;
113: #define pack(v,b) (((v)->v_mount->mnt_stat.f_fsid.val[0])<<16)|(b)
114: #define trace(a,b,c) if (traceflags[a]) trace1(a,b,c)
115: #else
116: #define trace(a,b,c) ;
117: #endif
118: #endif
1.1.1.2 ! root 119:
! 120: #endif /* !_SYS_TRACE_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.