|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 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 [email protected] ! 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: #ifndef _KERN_COUNTERS_ ! 52: #define _KERN_COUNTERS_ ! 53: ! 54: #import <mach/features.h> ! 55: ! 56: /* ! 57: * We can count various interesting events and paths. ! 58: * ! 59: * Use counter() to change the counters, eg: ! 60: * counter(c_idle_thread_block++); ! 61: * Use counter_always() for non-conditional counters. ! 62: */ ! 63: ! 64: #define counter_always(code) code ! 65: ! 66: #if MACH_COUNTERS ! 67: ! 68: #define counter(code) counter_always(code) ! 69: ! 70: #else /* MACH_COUNTERS */ ! 71: ! 72: #define counter(code) ! 73: ! 74: #endif /* MACH_COUNTERS */ ! 75: ! 76: /* ! 77: * We define the counters with individual integers, ! 78: * instead of a big structure, so that ddb ! 79: * will know the addresses of the counters. ! 80: */ ! 81: ! 82: typedef unsigned int mach_counter_t; ! 83: ! 84: extern mach_counter_t c_thread_invoke_hits; ! 85: extern mach_counter_t c_thread_invoke_misses; ! 86: extern mach_counter_t c_thread_invoke_csw; ! 87: extern mach_counter_t c_thread_handoff_hits; ! 88: extern mach_counter_t c_thread_handoff_misses; ! 89: ! 90: #if MACH_COUNTERS ! 91: extern mach_counter_t c_threads_current; ! 92: extern mach_counter_t c_threads_max; ! 93: extern mach_counter_t c_threads_min; ! 94: extern mach_counter_t c_threads_total; ! 95: extern mach_counter_t c_stacks_current; ! 96: extern mach_counter_t c_stacks_max; ! 97: extern mach_counter_t c_stacks_min; ! 98: extern mach_counter_t c_stacks_total; ! 99: extern mach_counter_t c_clock_ticks; ! 100: extern mach_counter_t c_ipc_mqueue_send_block; ! 101: extern mach_counter_t c_ipc_mqueue_receive_block_user; ! 102: extern mach_counter_t c_ipc_mqueue_receive_block_kernel; ! 103: extern mach_counter_t c_mach_msg_trap_block_fast; ! 104: extern mach_counter_t c_mach_msg_trap_block_slow; ! 105: extern mach_counter_t c_mach_msg_trap_block_exc; ! 106: extern mach_counter_t c_exception_raise_block; ! 107: extern mach_counter_t c_swtch_block; ! 108: extern mach_counter_t c_swtch_pri_block; ! 109: extern mach_counter_t c_thread_switch_block; ! 110: extern mach_counter_t c_thread_switch_handoff; ! 111: extern mach_counter_t c_ast_taken_block; ! 112: extern mach_counter_t c_thread_halt_self_block; ! 113: extern mach_counter_t c_vm_fault_page_block_busy_user; ! 114: extern mach_counter_t c_vm_fault_page_block_busy_kernel; ! 115: extern mach_counter_t c_vm_fault_page_block_backoff_user; ! 116: extern mach_counter_t c_vm_fault_page_block_backoff_kernel; ! 117: extern mach_counter_t c_vm_page_wait_block_user; ! 118: extern mach_counter_t c_vm_page_wait_block_kernel; ! 119: extern mach_counter_t c_vm_pageout_block; ! 120: extern mach_counter_t c_vm_pageout_scan_block; ! 121: extern mach_counter_t c_idle_thread_block; ! 122: extern mach_counter_t c_idle_thread_handoff; ! 123: extern mach_counter_t c_sched_thread_block; ! 124: extern mach_counter_t c_io_done_thread_block; ! 125: extern mach_counter_t c_net_thread_block; ! 126: extern mach_counter_t c_reaper_thread_block; ! 127: extern mach_counter_t c_swapin_thread_block; ! 128: extern mach_counter_t c_action_thread_block; ! 129: #endif /* MACH_COUNTERS */ ! 130: ! 131: #endif /* _KERN_COUNTERS_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.