]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
91447636 | 2 | * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. |
1c79356b A |
3 | * |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
e5568f75 A |
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. | |
1c79356b | 11 | * |
e5568f75 A |
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 | |
1c79356b A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
e5568f75 A |
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. | |
1c79356b A |
19 | * |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | /* | |
23 | * @OSF_COPYRIGHT@ | |
24 | */ | |
1c79356b A |
25 | /* |
26 | * Mach Operating System | |
27 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | |
28 | * All Rights Reserved. | |
29 | * | |
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. | |
35 | * | |
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. | |
39 | * | |
40 | * Carnegie Mellon requests users of this software to return to | |
41 | * | |
42 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
43 | * School of Computer Science | |
44 | * Carnegie Mellon University | |
45 | * Pittsburgh PA 15213-3890 | |
46 | * | |
47 | * any improvements or extensions that they make and grant Carnegie Mellon | |
48 | * the rights to redistribute these changes. | |
49 | */ | |
50 | /* | |
51 | */ | |
52 | ||
53 | #ifndef _KERN_COUNTERS_ | |
54 | #define _KERN_COUNTERS_ | |
55 | ||
56 | #include <mach_counters.h> | |
57 | ||
58 | /* | |
59 | * We can count various interesting events and paths. | |
60 | * | |
61 | * Use counter() to change the counters, eg: | |
62 | * counter(c_idle_thread_block++); | |
63 | * Use counter_always() for non-conditional counters. | |
64 | */ | |
65 | ||
66 | #define counter_always(code) code | |
67 | ||
68 | #if MACH_COUNTERS | |
69 | ||
70 | #define counter(code) counter_always(code) | |
71 | ||
72 | #else /* MACH_COUNTERS */ | |
73 | ||
74 | #define counter(code) | |
75 | ||
76 | #endif /* MACH_COUNTERS */ | |
77 | ||
78 | /* | |
79 | * We define the counters with individual integers, | |
80 | * instead of a big structure, so that ddb | |
81 | * will know the addresses of the counters. | |
82 | */ | |
83 | ||
84 | typedef unsigned int mach_counter_t; | |
85 | ||
86 | extern mach_counter_t c_thread_invoke_csw; | |
87 | extern mach_counter_t c_thread_invoke_same; | |
88 | extern mach_counter_t c_thread_invoke_same_cont; | |
89 | extern mach_counter_t c_thread_invoke_misses; | |
90 | extern mach_counter_t c_thread_invoke_hits; | |
91 | extern mach_counter_t c_incoming_interrupts; | |
92 | extern mach_counter_t c_syscalls_unix; | |
93 | extern mach_counter_t c_syscalls_mach; | |
94 | ||
95 | #if MACH_COUNTERS | |
96 | extern mach_counter_t c_action_thread_block; | |
97 | extern mach_counter_t c_ast_taken_block; | |
98 | extern mach_counter_t c_clock_ticks; | |
99 | extern mach_counter_t c_dev_io_blocks; | |
100 | extern mach_counter_t c_dev_io_tries; | |
101 | extern mach_counter_t c_idle_thread_block; | |
102 | extern mach_counter_t c_idle_thread_handoff; | |
103 | extern mach_counter_t c_io_done_thread_block; | |
104 | extern mach_counter_t c_ipc_mqueue_receive_block_kernel; | |
105 | extern mach_counter_t c_ipc_mqueue_receive_block_user; | |
106 | extern mach_counter_t c_ipc_mqueue_send_block; | |
107 | extern mach_counter_t c_net_thread_block; | |
108 | extern mach_counter_t c_reaper_thread_block; | |
109 | extern mach_counter_t c_sched_thread_block; | |
110 | extern mach_counter_t c_stacks_current; | |
111 | extern mach_counter_t c_stacks_max; | |
112 | extern mach_counter_t c_stacks_min; | |
113 | extern mach_counter_t c_swtch_block; | |
114 | extern mach_counter_t c_swtch_pri_block; | |
115 | extern mach_counter_t c_thread_switch_block; | |
116 | extern mach_counter_t c_thread_switch_handoff; | |
117 | extern mach_counter_t c_vm_fault_page_block_backoff_kernel; | |
118 | extern mach_counter_t c_vm_fault_page_block_busy_kernel; | |
119 | extern mach_counter_t c_vm_fault_retry_on_w_prot; | |
120 | extern mach_counter_t c_vm_fault_wait_on_unlock; | |
5353443c | 121 | extern mach_counter_t c_vm_map_simplified; |
1c79356b | 122 | extern mach_counter_t c_vm_map_simplify_called; |
5353443c | 123 | extern mach_counter_t c_vm_map_simplify_entry_called; |
1c79356b A |
124 | extern mach_counter_t c_vm_page_wait_block; |
125 | extern mach_counter_t c_vm_pageout_block; | |
126 | extern mach_counter_t c_vm_pageout_scan_block; | |
1c79356b A |
127 | #endif /* MACH_COUNTERS */ |
128 | ||
129 | #endif /* _KERN_COUNTERS_ */ | |
130 |