]> git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/counters.h
xnu-201.tar.gz
[apple/xnu.git] / osfmk / kern / counters.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * @OSF_COPYRIGHT@
24 */
25 /*
26 * HISTORY
27 *
28 * Revision 1.1.1.1 1998/09/22 21:05:35 wsanchez
29 * Import of Mac OS X kernel (~semeria)
30 *
31 * Revision 1.1.1.1 1998/03/07 02:25:54 wsanchez
32 * Import of OSF Mach kernel (~mburg)
33 *
34 * Revision 1.1.13.7 1995/02/24 15:19:14 alanl
35 * Merge with DIPC2_SHARED.
36 * [1995/02/22 20:19:55 alanl]
37 *
38 * Revision 1.1.19.4 1994/11/04 10:16:23 dwm
39 * mk6 CR668 - 1.3b26 merge
40 * add counters, then remove unused items
41 * [1994/11/04 09:45:39 dwm]
42 *
43 * Revision 1.1.13.5 1994/09/23 02:16:08 ezf
44 * change marker to not FREE
45 * [1994/09/22 21:32:13 ezf]
46 *
47 * Revision 1.1.13.4 1994/09/16 06:29:25 dwm
48 * mk6 CR551 - remove unused SAFE_VM_FAULT pseudo-continuation,
49 * remove unused args from vm_page_wait, vm_fault(_page).
50 * Fix vm_page_wait counters, and rm thread_handoff counter.
51 * [1994/09/16 06:23:26 dwm]
52 *
53 * Revision 1.1.13.3 1994/09/10 21:45:55 bolinger
54 * Merge up to NMK17.3
55 * [1994/09/08 19:57:29 bolinger]
56 *
57 * Revision 1.1.13.2 1994/06/21 17:28:43 dlb
58 * Add two vm_fault counters from NMK17.
59 * [94/06/17 dlb]
60 *
61 * Revision 1.1.10.3 1994/06/15 09:12:05 paire
62 * Corrected spelling of c_vm_fault_wait_on_unlock variable.
63 * [94/06/15 paire]
64 *
65 * Revision 1.1.13.1 1994/06/14 17:00:01 bolinger
66 * Merge up to NMK17.2.
67 * [1994/06/14 16:53:41 bolinger]
68 *
69 * Revision 1.1.10.2 1994/05/30 07:37:03 bernadat
70 * Added new c_vm_fault_retry_on_unlock and c_vm_fault_retry_on_w_prot.
71 * Sorted the whole list of counters.
72 * [paire@gr.osf.org]
73 * [94/05/26 bernadat]
74 *
75 * Revision 1.1.10.1 1994/02/11 14:25:21 paire
76 * Added missing c_exception_raise_state_block and
77 * c_exception_raise_state_identity_block counters.
78 * Change from NMK16.1 [93/08/09 paire]
79 * [94/02/04 paire]
80 *
81 * Revision 1.1.2.3 1993/06/07 22:12:36 jeffc
82 * CR9176 - ANSI C violations: trailing tokens on CPP
83 * directives, extra semicolons after decl_ ..., asm keywords
84 * [1993/06/07 19:04:11 jeffc]
85 *
86 * Revision 1.1.2.2 1993/06/02 23:35:54 jeffc
87 * Added to OSF/1 R1.3 from NMK15.0.
88 * [1993/06/02 21:12:09 jeffc]
89 *
90 * Revision 1.1 1992/09/30 02:29:32 robert
91 * Initial revision
92 *
93 * $EndLog$
94 */
95 /* CMU_HIST */
96 /*
97 * Revision 2.3 91/05/14 16:40:30 mrt
98 * Correcting copyright
99 *
100 * Revision 2.2 91/03/16 15:16:06 rpd
101 * Created.
102 * [91/03/13 rpd]
103 *
104 */
105 /* CMU_ENDHIST */
106 /*
107 * Mach Operating System
108 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
109 * All Rights Reserved.
110 *
111 * Permission to use, copy, modify and distribute this software and its
112 * documentation is hereby granted, provided that both the copyright
113 * notice and this permission notice appear in all copies of the
114 * software, derivative works or modified versions, and any portions
115 * thereof, and that both notices appear in supporting documentation.
116 *
117 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
118 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
119 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
120 *
121 * Carnegie Mellon requests users of this software to return to
122 *
123 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
124 * School of Computer Science
125 * Carnegie Mellon University
126 * Pittsburgh PA 15213-3890
127 *
128 * any improvements or extensions that they make and grant Carnegie Mellon
129 * the rights to redistribute these changes.
130 */
131 /*
132 */
133
134 #ifndef _KERN_COUNTERS_
135 #define _KERN_COUNTERS_
136
137 #include <mach_counters.h>
138
139 /*
140 * We can count various interesting events and paths.
141 *
142 * Use counter() to change the counters, eg:
143 * counter(c_idle_thread_block++);
144 * Use counter_always() for non-conditional counters.
145 */
146
147 #define counter_always(code) code
148
149 #if MACH_COUNTERS
150
151 #define counter(code) counter_always(code)
152
153 #else /* MACH_COUNTERS */
154
155 #define counter(code)
156
157 #endif /* MACH_COUNTERS */
158
159 /*
160 * We define the counters with individual integers,
161 * instead of a big structure, so that ddb
162 * will know the addresses of the counters.
163 */
164
165 typedef unsigned int mach_counter_t;
166
167 extern mach_counter_t c_thread_invoke_csw;
168 extern mach_counter_t c_thread_invoke_same;
169 extern mach_counter_t c_thread_invoke_same_cont;
170 extern mach_counter_t c_thread_invoke_misses;
171 extern mach_counter_t c_thread_invoke_hits;
172 extern mach_counter_t c_incoming_interrupts;
173 extern mach_counter_t c_syscalls_unix;
174 extern mach_counter_t c_syscalls_mach;
175
176 #if MACH_COUNTERS
177 extern mach_counter_t c_action_thread_block;
178 extern mach_counter_t c_ast_taken_block;
179 extern mach_counter_t c_clock_ticks;
180 extern mach_counter_t c_dev_io_blocks;
181 extern mach_counter_t c_dev_io_tries;
182 extern mach_counter_t c_idle_thread_block;
183 extern mach_counter_t c_idle_thread_handoff;
184 extern mach_counter_t c_io_done_thread_block;
185 extern mach_counter_t c_ipc_mqueue_receive_block_kernel;
186 extern mach_counter_t c_ipc_mqueue_receive_block_user;
187 extern mach_counter_t c_ipc_mqueue_send_block;
188 extern mach_counter_t c_net_thread_block;
189 extern mach_counter_t c_reaper_thread_block;
190 extern mach_counter_t c_sched_thread_block;
191 extern mach_counter_t c_stacks_current;
192 extern mach_counter_t c_stacks_max;
193 extern mach_counter_t c_stacks_min;
194 extern mach_counter_t c_swtch_block;
195 extern mach_counter_t c_swtch_pri_block;
196 extern mach_counter_t c_thread_switch_block;
197 extern mach_counter_t c_thread_switch_handoff;
198 extern mach_counter_t c_vm_fault_page_block_backoff_kernel;
199 extern mach_counter_t c_vm_fault_page_block_busy_kernel;
200 extern mach_counter_t c_vm_fault_retry_on_w_prot;
201 extern mach_counter_t c_vm_fault_wait_on_unlock;
202 extern mach_counter_t c_vm_map_simplified_lower;
203 extern mach_counter_t c_vm_map_simplified_upper;
204 extern mach_counter_t c_vm_map_simplify_called;
205 extern mach_counter_t c_vm_page_wait_block;
206 extern mach_counter_t c_vm_pageout_block;
207 extern mach_counter_t c_vm_pageout_scan_block;
208 extern mach_counter_t c_vm_fault_retry_on_w_prot;
209 extern mach_counter_t c_vm_fault_wait_on_unlock;
210 #endif /* MACH_COUNTERS */
211
212 #endif /* _KERN_COUNTERS_ */
213