Commit | Line | Data |
---|---|---|
33365d4c | 1 | /* trace.h 6.2 84/01/03 */ |
5ab036bb | 2 | |
5abfd3e9 | 3 | /* |
33365d4c | 4 | * File system buffer tracing points; all trace <pack(dev, size), bn> |
5abfd3e9 | 5 | */ |
811f48bb BJ |
6 | #define TR_BREADHIT 0 /* buffer read found in cache */ |
7 | #define TR_BREADMISS 1 /* buffer read not in cache */ | |
8 | #define TR_BWRITE 2 /* buffer written */ | |
9 | #define TR_BREADHITRA 3 /* buffer read-ahead found in cache */ | |
10 | #define TR_BREADMISSRA 4 /* buffer read-ahead not in cache */ | |
3cdd113c BJ |
11 | #define TR_XFODMISS 5 /* exe fod read */ |
12 | #define TR_XFODHIT 6 /* exe fod read */ | |
13 | #define TR_BRELSE 7 /* brelse */ | |
33365d4c | 14 | #define TR_BREALLOC 8 /* expand/contract a buffer */ |
dd6379ab | 15 | |
5abfd3e9 BJ |
16 | /* |
17 | * Memory allocator trace points; all trace the amount of memory involved | |
18 | */ | |
19 | #define TR_MALL 10 /* memory allocated */ | |
20 | ||
21 | /* | |
22 | * Paging trace points: all are <vaddr, pid> | |
23 | */ | |
24 | #define TR_INTRANS 20 /* page intransit block */ | |
25 | #define TR_EINTRANS 21 /* page intransit wait done */ | |
26 | #define TR_FRECLAIM 22 /* reclaim from free list */ | |
27 | #define TR_RECLAIM 23 /* reclaim from loop */ | |
28 | #define TR_XSFREC 24 /* reclaim from free list instead of drum */ | |
29 | #define TR_XIFREC 25 /* reclaim from free list instead of fsys */ | |
30 | #define TR_WAITMEM 26 /* wait for memory in pagein */ | |
31 | #define TR_EWAITMEM 27 /* end memory wait in pagein */ | |
32 | #define TR_ZFOD 28 /* zfod page fault */ | |
33 | #define TR_EXFOD 29 /* exec fod page fault */ | |
34 | #define TR_VRFOD 30 /* vread fod page fault */ | |
35 | #define TR_CACHEFOD 31 /* fod in file system cache */ | |
36 | #define TR_SWAPIN 32 /* drum page fault */ | |
37 | #define TR_PGINDONE 33 /* page in done */ | |
775777e0 | 38 | #define TR_SWAPIO 34 /* swap i/o request arrives */ |
5abfd3e9 BJ |
39 | |
40 | /* | |
41 | * System call trace points. | |
42 | */ | |
43 | #define TR_VADVISE 40 /* vadvise occurred with <arg, pid> */ | |
44 | ||
6b7a6dc7 BJ |
45 | /* |
46 | * Miscellaneous | |
47 | */ | |
33365d4c | 48 | #define TR_STAMP 45 /* user said vtrace(VTR_STAMP, value); */ |
6b7a6dc7 | 49 | |
5abfd3e9 BJ |
50 | /* |
51 | * This defines the size of the trace flags array. | |
52 | */ | |
53 | #define TR_NFLAGS 100 /* generous */ | |
dd6379ab BJ |
54 | |
55 | #define TRCSIZ 4096 | |
56 | ||
b634e997 BJ |
57 | /* |
58 | * Specifications of the vtrace() system call, which takes one argument. | |
59 | */ | |
60 | #define VTRACE 64+51 | |
61 | ||
62 | #define VTR_DISABLE 0 /* set a trace flag to 0 */ | |
63 | #define VTR_ENABLE 1 /* set a trace flag to 1 */ | |
64 | #define VTR_VALUE 2 /* return value of a trace flag */ | |
65 | #define VTR_UALARM 3 /* set alarm to go off (sig 16) */ | |
66 | /* in specified number of hz */ | |
6b7a6dc7 | 67 | #define VTR_STAMP 4 /* user specified stamp */ |
5abfd3e9 BJ |
68 | #ifdef KERNEL |
69 | #ifdef TRACE | |
70 | char traceflags[TR_NFLAGS]; | |
71 | struct proc *traceproc; | |
dd6379ab BJ |
72 | int tracebuf[TRCSIZ]; |
73 | unsigned tracex; | |
74 | int tracewhich; | |
33365d4c | 75 | #define pack(a,b) ((a)<<16)|(b) |
5abfd3e9 | 76 | #define trace(a,b,c) if (traceflags[a]) trace1(a,b,c) |
315db0d5 KM |
77 | #else |
78 | #define trace(a,b,b) ; | |
5abfd3e9 | 79 | #endif |
dd6379ab | 80 | #endif |