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: * @(#)trace.h 7.1 (Berkeley) 6/4/86
7: */
8:
9: /*
10: * File system buffer tracing points; all trace <pack(dev, size), bn>
11: *
12: * Slipped into 2.10 in about 15 minutes. Bears only a casual
13: * relationship to the 4.X code, we just used the same names so
14: * someone could do it right if they felt like it. Note that
15: * the #defines aren't even sequentially numbered.
16: */
17: #define TR_BREADHIT 0 /* buffer read found in cache */
18: #define TR_BREADMISS 1 /* buffer read not in cache */
19: #define TR_BWRITE 2 /* buffer written */
20: #define TR_BREADHITRA 3 /* buffer read-ahead found in cache */
21: #define TR_BREADMISSRA 4 /* buffer read-ahead not in cache */
22: #define TR_BRELSE 5 /* brelse */
23: #define TR_SWAPIO 6 /* swap i/o request arrives */
24: #define TR_NUM_210 7 /* size of array for 2.10BSD
25:
26: #define TR_XFODMISS 5 /* exe fod read */
27: #define TR_XFODHIT 6 /* exe fod read */
28: #define TR_BREALLOC 8 /* expand/contract a buffer */
29:
30: /*
31: * Memory allocator trace points; all trace the amount of memory involved
32: */
33: #define TR_MALL 10 /* memory allocated */
34:
35: /*
36: * Paging trace points: all are <vaddr, pid>
37: */
38: #define TR_INTRANS 20 /* page intransit block */
39: #define TR_EINTRANS 21 /* page intransit wait done */
40: #define TR_FRECLAIM 22 /* reclaim from free list */
41: #define TR_RECLAIM 23 /* reclaim from loop */
42: #define TR_XSFREC 24 /* reclaim from free list instead of drum */
43: #define TR_XIFREC 25 /* reclaim from free list instead of fsys */
44: #define TR_WAITMEM 26 /* wait for memory in pagein */
45: #define TR_EWAITMEM 27 /* end memory wait in pagein */
46: #define TR_ZFOD 28 /* zfod page fault */
47: #define TR_EXFOD 29 /* exec fod page fault */
48: #define TR_VRFOD 30 /* vread fod page fault */
49: #define TR_CACHEFOD 31 /* fod in file system cache */
50: #define TR_SWAPIN 32 /* drum page fault */
51: #define TR_PGINDONE 33 /* page in done */
52:
53: /*
54: * System call trace points.
55: */
56: #define TR_VADVISE 40 /* vadvise occurred with <arg, pid> */
57:
58: /*
59: * Miscellaneous
60: */
61: #define TR_STAMP 45 /* user said vtrace(VTR_STAMP, value); */
62:
63: /*
64: * This defines the size of the trace flags array.
65: */
66: #define TR_NFLAGS 100 /* generous */
67:
68: #define TRCSIZ 4096
69:
70: /*
71: * Specifications of the vtrace() system call, which takes one argument.
72: */
73: #define VTRACE 64+51
74:
75: #define VTR_DISABLE 0 /* set a trace flag to 0 */
76: #define VTR_ENABLE 1 /* set a trace flag to 1 */
77: #define VTR_VALUE 2 /* return value of a trace flag */
78: #define VTR_UALARM 3 /* set alarm to go off (sig 16) */
79: /* in specified number of hz */
80: #define VTR_STAMP 4 /* user specified stamp */
81:
82: #if defined(KERNEL) && defined(UCB_METER) && !defined(SUPERVISOR)
83: u_long tracebuf[TR_NUM_210];
84: #define trace(a) tracebuf[a]++;
85: #else
86: #define trace(a) ;
87: #endif
Defined macros
trace
defined in line
86; used 11 times
Usage of this include