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