]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
9bccf70c | 2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. |
1c79356b A |
3 | * |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
43866e37 | 6 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. |
1c79356b | 7 | * |
43866e37 A |
8 | * This file contains Original Code and/or Modifications of Original Code |
9 | * as defined in and that are subject to the Apple Public Source License | |
10 | * Version 2.0 (the 'License'). You may not use this file except in | |
11 | * compliance with the License. Please obtain a copy of the License at | |
12 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
13 | * file. | |
14 | * | |
15 | * The Original Code and all software distributed under the License are | |
16 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
1c79356b A |
17 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
18 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
43866e37 A |
19 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
20 | * Please see the License for the specific language governing rights and | |
21 | * limitations under the License. | |
1c79356b A |
22 | * |
23 | * @APPLE_LICENSE_HEADER_END@ | |
24 | */ | |
25 | /* | |
26 | * @OSF_COPYRIGHT@ | |
27 | */ | |
1c79356b A |
28 | /* |
29 | * Mach Operating System | |
30 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | |
31 | * All Rights Reserved. | |
32 | * | |
33 | * Permission to use, copy, modify and distribute this software and its | |
34 | * documentation is hereby granted, provided that both the copyright | |
35 | * notice and this permission notice appear in all copies of the | |
36 | * software, derivative works or modified versions, and any portions | |
37 | * thereof, and that both notices appear in supporting documentation. | |
38 | * | |
39 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
40 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
41 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
42 | * | |
43 | * Carnegie Mellon requests users of this software to return to | |
44 | * | |
45 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
46 | * School of Computer Science | |
47 | * Carnegie Mellon University | |
48 | * Pittsburgh PA 15213-3890 | |
49 | * | |
50 | * any improvements or extensions that they make and grant Carnegie Mellon | |
51 | * the rights to redistribute these changes. | |
52 | */ | |
53 | /* | |
54 | */ | |
55 | /* | |
56 | * File: mach/vm_statistics.h | |
57 | * Author: Avadis Tevanian, Jr., Michael Wayne Young, David Golub | |
58 | * | |
59 | * Virtual memory statistics structure. | |
60 | * | |
61 | */ | |
62 | ||
63 | #ifndef VM_STATISTICS_H_ | |
64 | #define VM_STATISTICS_H_ | |
65 | ||
66 | #include <mach/machine/vm_types.h> | |
67 | ||
68 | struct vm_statistics { | |
69 | integer_t free_count; /* # of pages free */ | |
70 | integer_t active_count; /* # of pages active */ | |
71 | integer_t inactive_count; /* # of pages inactive */ | |
72 | integer_t wire_count; /* # of pages wired down */ | |
73 | integer_t zero_fill_count; /* # of zero fill pages */ | |
74 | integer_t reactivations; /* # of pages reactivated */ | |
75 | integer_t pageins; /* # of pageins */ | |
76 | integer_t pageouts; /* # of pageouts */ | |
77 | integer_t faults; /* # of faults */ | |
78 | integer_t cow_faults; /* # of copy-on-writes */ | |
79 | integer_t lookups; /* object cache lookups */ | |
80 | integer_t hits; /* object cache hits */ | |
81 | }; | |
82 | ||
83 | typedef struct vm_statistics *vm_statistics_t; | |
84 | typedef struct vm_statistics vm_statistics_data_t; | |
85 | ||
86 | ||
87 | /* included for the vm_map_page_query call */ | |
88 | ||
89 | #define VM_PAGE_QUERY_PAGE_PRESENT 0x1 | |
90 | #define VM_PAGE_QUERY_PAGE_FICTITIOUS 0x2 | |
91 | #define VM_PAGE_QUERY_PAGE_REF 0x4 | |
92 | #define VM_PAGE_QUERY_PAGE_DIRTY 0x8 | |
93 | ||
94 | ||
95 | /* | |
96 | * Each machine dependent implementation is expected to | |
97 | * keep certain statistics. They may do this anyway they | |
98 | * so choose, but are expected to return the statistics | |
99 | * in the following structure. | |
100 | */ | |
101 | ||
102 | struct pmap_statistics { | |
103 | integer_t resident_count; /* # of pages mapped (total)*/ | |
104 | integer_t wired_count; /* # of pages wired */ | |
105 | }; | |
106 | ||
107 | typedef struct pmap_statistics *pmap_statistics_t; | |
108 | ||
109 | #define VM_FLAGS_FIXED 0x0 | |
110 | #define VM_FLAGS_ANYWHERE 0x1 | |
111 | #define VM_FLAGS_ALIAS_MASK 0xFF000000 | |
112 | #define VM_GET_FLAGS_ALIAS(flags, alias) \ | |
113 | (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24 | |
114 | #define VM_SET_FLAGS_ALIAS(flags, alias) \ | |
115 | (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \ | |
116 | (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24)) | |
117 | ||
118 | #define VM_MEMORY_MALLOC 1 | |
119 | #define VM_MEMORY_MALLOC_SMALL 2 | |
120 | #define VM_MEMORY_MALLOC_LARGE 3 | |
121 | #define VM_MEMORY_MALLOC_HUGE 4 | |
122 | #define VM_MEMORY_SBRK 5// uninteresting -- no one should call | |
55e303ae A |
123 | #define VM_MEMORY_REALLOC 6 |
124 | #define VM_MEMORY_MALLOC_TINY 7 | |
1c79356b A |
125 | |
126 | #define VM_MEMORY_ANALYSIS_TOOL 10 | |
127 | ||
128 | #define VM_MEMORY_MACH_MSG 20 | |
129 | #define VM_MEMORY_IOKIT 21 | |
130 | #define VM_MEMORY_STACK 30 | |
131 | #define VM_MEMORY_GUARD 31 | |
132 | #define VM_MEMORY_SHARED_PMAP 32 | |
133 | /* memory containing a dylib */ | |
134 | #define VM_MEMORY_DYLIB 33 | |
135 | ||
136 | // Placeholders for now -- as we analyze the libraries and find how they | |
137 | // use memory, we can make these labels more specific. | |
138 | #define VM_MEMORY_APPKIT 40 | |
139 | #define VM_MEMORY_FOUNDATION 41 | |
140 | #define VM_MEMORY_COREGRAPHICS 42 | |
141 | #define VM_MEMORY_CARBON 43 | |
9bccf70c | 142 | #define VM_MEMORY_JAVA 44 |
1c79356b A |
143 | #define VM_MEMORY_ATS 50 |
144 | ||
145 | ||
146 | /* memory allocated by the dynamic loader for itself */ | |
147 | #define VM_MEMORY_DYLD 60 | |
148 | /* malloc'd memory created by dyld */ | |
149 | #define VM_MEMORY_DYLD_MALLOC 61 | |
150 | ||
151 | /* Reserve 240-255 for application */ | |
152 | #define VM_MEMORY_APPLICATION_SPECIFIC_1 240 | |
153 | #define VM_MEMORY_APPLICATION_SPECIFIC_16 255 | |
154 | ||
155 | #define VM_MAKE_TAG(tag) (tag<<24) | |
156 | #endif /* VM_STATISTICS_H_ */ |