]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/xpr.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
31 * Revision 1.1.1.1 1998/09/22 21:05:32 wsanchez
32 * Import of Mac OS X kernel (~semeria)
34 * Revision 1.1.1.1 1998/03/07 02:25:57 wsanchez
35 * Import of OSF Mach kernel (~mburg)
37 * Revision 1.1.12.5 1995/02/24 15:22:46 alanl
38 * Add XPR definition to trace generic XMM activities.
41 * Revision 1.1.14.3 1994/11/02 18:37:35 dwm
42 * mk6 CR668 - 1.3b26 merge
43 * Add MOR token, update XPR names for locks, vm_maps.
44 * now only a single XPR(...) macro, 5 args always.
45 * [1994/11/02 18:17:33 dwm]
47 * Revision 1.1.12.3 1994/09/23 02:32:50 ezf
48 * change marker to not FREE
49 * [1994/09/22 21:38:33 ezf]
51 * Revision 1.1.12.2 1994/09/10 21:46:57 bolinger
53 * [1994/09/08 19:57:50 bolinger]
55 * Revision 1.1.12.1 1994/06/14 17:13:10 bolinger
56 * Merge up to NMK17.2.
57 * [1994/06/14 16:55:44 bolinger]
59 * Revision 1.1.7.2 1994/05/30 07:37:07 bernadat
60 * Added missing ')' to XPR5.
63 * Revision 1.1.7.1 1994/03/24 15:29:18 paire
64 * Set up correct XPR and XPR[1-5] macros.
65 * Added XPR_SIMPLE_LOCK define.
68 * Revision 1.1.2.5 1993/08/03 18:29:24 gm
69 * CR9596: Change KERNEL to MACH_KERNEL.
70 * [1993/08/02 17:41:44 gm]
72 * Revision 1.1.2.4 1993/07/27 18:09:08 rod
73 * Add ANSI prototypes. CR #9523.
74 * [1993/07/27 10:42:04 rod]
76 * Revision 1.1.2.3 1993/06/07 22:15:39 jeffc
77 * CR9176 - ANSI C violations: trailing tokens on CPP
78 * directives, extra semicolons after decl_ ..., asm keywords
79 * [1993/06/07 19:07:55 jeffc]
81 * Revision 1.1.2.2 1993/06/02 23:42:14 jeffc
82 * Added to OSF/1 R1.3 from NMK15.0.
83 * [1993/06/02 21:15:17 jeffc]
85 * Revision 1.1 1992/09/30 02:30:28 robert
92 * Revision 2.3 91/05/14 16:50:21 mrt
93 * Correcting copyright
95 * Revision 2.2 91/02/05 17:31:18 mrt
96 * MACH_KERNEL: removed conditionals.
99 * Revision 2.1 89/08/03 15:57:39 rwd
102 * Revision 2.5 88/12/19 02:51:59 mwyoung
103 * Added VM system tags.
106 * Revision 2.4 88/08/24 02:55:54 mwyoung
107 * Adjusted include file references.
108 * [88/08/17 02:29:56 mwyoung]
111 * 9-Apr-88 Daniel Julin (dpj) at Carnegie-Mellon University
112 * Added flags for TCP and MACH_NP debugging.
114 * 6-Jan-88 Michael Young (mwyoung) at Carnegie-Mellon University
115 * Make the event structure smaller to make it easier to read from
118 * 16-Mar-87 Mike Accetta (mja) at Carnegie-Mellon University
119 * MACH: made XPR_DEBUG definition conditional on MACH
120 * since the routines invoked under it won't link without MACH.
125 * Mach Operating System
126 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
127 * All Rights Reserved.
129 * Permission to use, copy, modify and distribute this software and its
130 * documentation is hereby granted, provided that both the copyright
131 * notice and this permission notice appear in all copies of the
132 * software, derivative works or modified versions, and any portions
133 * thereof, and that both notices appear in supporting documentation.
135 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
136 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
137 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
139 * Carnegie Mellon requests users of this software to return to
141 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
142 * School of Computer Science
143 * Carnegie Mellon University
144 * Pittsburgh PA 15213-3890
146 * any improvements or extensions that they make and grant Carnegie Mellon
147 * the rights to redistribute these changes.
152 * Include file for xpr circular buffer silent tracing.
156 * If the kernel flag XPRDEBUG is set, the XPR macro is enabled. The
157 * macro should be invoked something like the following:
158 * XPR(XPR_SYSCALLS, "syscall: %d, 0x%x\n", syscallno, arg1, 0,0,0);
159 * which will expand into the following code:
160 * if (xprflags & XPR_SYSCALLS)
161 * xpr("syscall: %d, 0x%x\n", syscallno, arg1, 0,0,0);
162 * Xpr will log the pointer to the printf string and up to 5 arguements,
163 * along with a timestamp and cpuinfo (for multi-processor systems), into
164 * a circular buffer. The actual printf processing is delayed until after
165 * the buffer has been collected. It is assumed that the text/data segments
166 * of the kernel can easily be reconstructed in a post-processor which
167 * performs the printf processing.
169 * If the XPRDEBUG compilation switch is not set, the XPR macro expands
177 #include <xpr_debug.h>
178 #else /* MACH_KERNEL */
179 #include <sys/features.h>
180 #endif /* MACH_KERNEL */
182 #include <machine/xpr.h>
186 #define XPR(flags, msg, arg1, arg2, arg3, arg4, arg5) \
188 if (xprflags & (flags)) { \
189 xpr((msg), (long)(arg1), (long)(arg2), \
190 (long)(arg3), (long)(arg4), (long)(arg5)); \
197 * flags for message types.
199 #define XPR_TRAPS (1 << 1)
200 #define XPR_SCHED (1 << 2)
201 #define XPR_LOCK (1 << 3)
202 #define XPR_SLOCK (1 << 4)
203 #define XPR_PMAP (1 << 6)
204 #define XPR_VM_MAP (1 << 7)
205 #define XPR_VM_OBJECT (1 << 8)
206 #define XPR_VM_OBJECT_CACHE (1 << 9)
207 #define XPR_VM_PAGE (1 << 10)
208 #define XPR_VM_PAGEOUT (1 << 11)
209 #define XPR_MEMORY_OBJECT (1 << 12)
210 #define XPR_VM_FAULT (1 << 13)
211 #define XPR_VM_OBJECT_REP (1 << 14)
212 #define XPR_DEFAULT_PAGER (1 << 15)
213 #define XPR_INODE_PAGER (1 << 16)
214 #define XPR_INODE_PAGER_DATA (1 << 17)
215 #define XPR_XMM (1 << 18)
217 #else /* XPR_DEBUG */
218 #define XPR(flags, msg, arg1, arg2, arg3, arg4, arg5)
219 #endif /* XPR_DEBUG */
223 long arg1
,arg2
,arg3
,arg4
,arg5
;
228 /* Bootstrap XPR facility */
229 extern void xprbootstrap(void);
231 /* Enable XPR facility */
232 extern void xprinit(void);
234 /* Log an XPR message */
243 #endif /* _KERN_XPR_H_ */