]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/xpr.h
2 * Copyright (c) 2000-2004 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@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
53 * Include file for xpr circular buffer silent tracing.
57 * If the kernel flag XPRDEBUG is set, the XPR macro is enabled. The
58 * macro should be invoked something like the following:
59 * XPR(XPR_SYSCALLS, "syscall: %d, 0x%x\n", syscallno, arg1, 0,0,0);
60 * which will expand into the following code:
61 * if (xprflags & XPR_SYSCALLS)
62 * xpr("syscall: %d, 0x%x\n", syscallno, arg1, 0,0,0);
63 * Xpr will log the pointer to the printf string and up to 5 arguements,
64 * along with a timestamp and cpuinfo (for multi-processor systems), into
65 * a circular buffer. The actual printf processing is delayed until after
66 * the buffer has been collected. It is assumed that the text/data segments
67 * of the kernel can easily be reconstructed in a post-processor which
68 * performs the printf processing.
70 * If the XPRDEBUG compilation switch is not set, the XPR macro expands
78 #include <xpr_debug.h>
79 #else /* MACH_KERNEL */
80 #include <sys/features.h>
81 #endif /* MACH_KERNEL */
83 #include <machine/xpr.h>
87 #define XPR(flags, msg, arg1, arg2, arg3, arg4, arg5) \
89 if (xprflags & (flags)) { \
90 xpr((msg), (long)(arg1), (long)(arg2), \
91 (long)(arg3), (long)(arg4), (long)(arg5)); \
98 * flags for message types.
100 #define XPR_TRAPS (1 << 1)
101 #define XPR_SCHED (1 << 2)
102 #define XPR_LOCK (1 << 3)
103 #define XPR_SLOCK (1 << 4)
104 #define XPR_PMAP (1 << 6)
105 #define XPR_VM_MAP (1 << 7)
106 #define XPR_VM_OBJECT (1 << 8)
107 #define XPR_VM_OBJECT_CACHE (1 << 9)
108 #define XPR_VM_PAGE (1 << 10)
109 #define XPR_VM_PAGEOUT (1 << 11)
110 #define XPR_MEMORY_OBJECT (1 << 12)
111 #define XPR_VM_FAULT (1 << 13)
112 #define XPR_VM_OBJECT_REP (1 << 14)
113 #define XPR_DEFAULT_PAGER (1 << 15)
114 #define XPR_INODE_PAGER (1 << 16)
115 #define XPR_INODE_PAGER_DATA (1 << 17)
116 #define XPR_XMM (1 << 18)
118 #else /* XPR_DEBUG */
119 #define XPR(flags, msg, arg1, arg2, arg3, arg4, arg5)
120 #endif /* XPR_DEBUG */
124 long arg1
,arg2
,arg3
,arg4
,arg5
;
129 /* Bootstrap XPR facility */
130 extern void xprbootstrap(void);
132 /* Enable XPR facility */
133 extern void xprinit(void);
135 /* Log an XPR message */
144 #endif /* _KERN_XPR_H_ */