FreeBSD/Linux Kernel Cross Reference
sys/kern/xpr.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1992,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 Software.Distribution@CS.CMU.EDU
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 * HISTORY
28 * $Log: xpr.h,v $
29 * Revision 2.5 93/11/17 17:33:37 dbg
30 * ANSI-fied (except for varargs functions)
31 * [93/10/12 dbg]
32 *
33 * Revision 2.4 92/05/21 17:17:17 jfriedl
34 * Added 'extern void xpr()', etc.
35 * [92/05/16 jfriedl]
36 *
37 * Revision 2.3 91/05/14 16:50:21 mrt
38 * Correcting copyright
39 *
40 * Revision 2.2 91/02/05 17:31:18 mrt
41 * MACH_KERNEL: removed conditionals.
42 * [88/12/19 dbg]
43 *
44 * Revision 2.1 89/08/03 15:57:39 rwd
45 * Created.
46 *
47 * Revision 2.5 88/12/19 02:51:59 mwyoung
48 * Added VM system tags.
49 * [88/11/22 mwyoung]
50 *
51 * Revision 2.4 88/08/24 02:55:54 mwyoung
52 * Adjusted include file references.
53 * [88/08/17 02:29:56 mwyoung]
54 *
55 *
56 * 9-Apr-88 Daniel Julin (dpj) at Carnegie-Mellon University
57 * Added flags for TCP and MACH_NP debugging.
58 *
59 * 6-Jan-88 Michael Young (mwyoung) at Carnegie-Mellon University
60 * Make the event structure smaller to make it easier to read from
61 * kernel debuggers.
62 *
63 * 16-Mar-87 Mike Accetta (mja) at Carnegie-Mellon University
64 * MACH: made XPR_DEBUG definition conditional on MACH
65 * since the routines invoked under it won't link without MACH.
66 * [ V5.1(F7) ]
67 */
68 /*
69 * Include file for xpr circular buffer silent tracing.
70 *
71 */
72 /*
73 * If the kernel flag XPRDEBUG is set, the XPR macro is enabled. The
74 * macro should be invoked something like the following:
75 * XPR(XPR_SYSCALLS, ("syscall: %d, 0x%x\n", syscallno, arg1);
76 * which will expand into the following code:
77 * if (xprflags & XPR_SYSCALLS)
78 * xpr("syscall: %d, 0x%x\n", syscallno, arg1);
79 * Xpr will log the pointer to the printf string and up to 6 arguments,
80 * along with a timestamp and cpuinfo (for multi-processor systems), into
81 * a circular buffer. The actual printf processing is delayed until after
82 * the buffer has been collected. It is assumed that the text/data segments
83 * of the kernel can easily be reconstructed in a post-processor which
84 * performs the printf processing.
85 *
86 * If the XPRDEBUG compilation switch is not set, the XPR macro expands
87 * to nothing.
88 */
89
90 #ifndef _KERN_XPR_H_
91 #define _KERN_XPR_H_
92
93 #include <xpr_debug.h>
94
95 #include <machine/xpr.h>
96
97 #if XPR_DEBUG
98
99 #define XPR(flags,xprargs) if(xprflags&flags) xpr xprargs
100
101 extern int xprflags;
102 /*
103 * flags for message types.
104 */
105 #define XPR_SYSCALLS 0x00000001
106 #define XPR_TRAPS 0x00000002
107 #define XPR_SCHED 0x00000004
108 #define XPR_NPTCP 0x00000008
109 #define XPR_NP 0x00000010
110 #define XPR_TCP 0x00000020
111
112 #define XPR_VM_OBJECT (1 << 8)
113 #define XPR_VM_OBJECT_CACHE (1 << 9)
114 #define XPR_VM_PAGE (1 << 10)
115 #define XPR_VM_PAGEOUT (1 << 11)
116 #define XPR_MEMORY_OBJECT (1 << 12)
117 #define XPR_VM_FAULT (1 << 13)
118 #define XPR_INODE_PAGER (1 << 14)
119 #define XPR_INODE_PAGER_DATA (1 << 15)
120
121 #else /* XPR_DEBUG */
122 #define XPR(flags,xprargs)
123 #endif /* XPR_DEBUG */
124
125 struct xprbuf {
126 char *msg;
127 int arg1,arg2,arg3,arg4,arg5;
128 int timestamp;
129 int cpuinfo;
130 };
131
132 #ifndef WANT_PROTOTYPES
133 extern void xpr();
134 #endif
135 extern void xpr_dump(
136 struct xprbuf *base,
137 int nbufs);
138 extern void xprinit(void);
139 extern void xprbootstrap(void);
140
141 #endif /* _KERN_XPR_H_ */
Cache object: 58a6536358d5d54bda2f41cd19d3dc40
|