|
|
1.1 root 1: /*
2: * Mach Operating System
3: * Copyright (c) 1991,1990,1989,1988,1987 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 [email protected]
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: * Include file for xpr circular buffer silent tracing.
28: *
29: */
30: /*
31: * If the kernel flag XPRDEBUG is set, the XPR macro is enabled. The
32: * macro should be invoked something like the following:
33: * XPR(XPR_SYSCALLS, ("syscall: %d, 0x%x\n", syscallno, arg1);
34: * which will expand into the following code:
35: * if (xprflags & XPR_SYSCALLS)
36: * xpr("syscall: %d, 0x%x\n", syscallno, arg1);
37: * Xpr will log the pointer to the printf string and up to 6 arguements,
38: * along with a timestamp and cpuinfo (for multi-processor systems), into
39: * a circular buffer. The actual printf processing is delayed until after
40: * the buffer has been collected. It is assumed that the text/data segments
41: * of the kernel can easily be reconstructed in a post-processor which
42: * performs the printf processing.
43: *
44: * If the XPRDEBUG compilation switch is not set, the XPR macro expands
45: * to nothing.
46: */
47:
48: #ifndef _KERN_XPR_H_
49: #define _KERN_XPR_H_
50:
51: #ifdef KERNEL
52: #include <xpr_debug.h>
53: #else KERNEL
54: #include <sys/features.h>
55: #endif KERNEL
56:
57: #include <machine/xpr.h>
58:
59: #if XPR_DEBUG
60:
61: #define XPR(flags,xprargs) if(xprflags&flags) xpr xprargs
62:
63: extern int xprflags;
64: /*
65: * flags for message types.
66: */
67: #define XPR_SYSCALLS 0x00000001
68: #define XPR_TRAPS 0x00000002
69: #define XPR_SCHED 0x00000004
70: #define XPR_NPTCP 0x00000008
71: #define XPR_NP 0x00000010
72: #define XPR_TCP 0x00000020
73:
74: #define XPR_VM_OBJECT (1 << 8)
75: #define XPR_VM_OBJECT_CACHE (1 << 9)
76: #define XPR_VM_PAGE (1 << 10)
77: #define XPR_VM_PAGEOUT (1 << 11)
78: #define XPR_MEMORY_OBJECT (1 << 12)
79: #define XPR_VM_FAULT (1 << 13)
80: #define XPR_INODE_PAGER (1 << 14)
81: #define XPR_INODE_PAGER_DATA (1 << 15)
82:
83: #else XPR_DEBUG
84: #define XPR(flags,xprargs)
85: #endif XPR_DEBUG
86:
87: struct xprbuf {
88: char *msg;
89: int arg1,arg2,arg3,arg4,arg5;
90: int timestamp;
91: int cpuinfo;
92: };
93:
94: #ifndef WANT_PROTOTYPES
95: extern void xpr();
96: #endif
97: extern void xpr_dump();
98: extern void xprinit();
99: extern void xprbootstrap();
100:
101: #endif _KERN_XPR_H_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.