Print this page
6583 remove whole-process swapping
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/sysinfo.h
+++ new/usr/src/uts/common/sys/sysinfo.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
22 22 /* All Rights Reserved */
23 23
24 24
25 25 /*
26 26 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
27 27 * Use is subject to license terms.
28 28 */
29 29
30 30 #ifndef _SYS_SYSINFO_H
31 31 #define _SYS_SYSINFO_H
32 32
33 33 #include <sys/types.h>
34 34 #include <sys/t_lock.h>
35 35 #include <sys/kstat.h>
36 36 #include <sys/machlock.h>
37 37
38 38 #ifdef __cplusplus
39 39 extern "C" {
40 40 #endif
41 41
42 42 /*
43 43 * System Information.
44 44 */
45 45 #define CPU_IDLE 0
46 46 #define CPU_USER 1
47 47 #define CPU_KERNEL 2
48 48 #define CPU_WAIT 3
49 49 #define CPU_STATES 4
50 50
51 51 #define W_IO 0
52 52 #define W_SWAP 1
53 53 #define W_PIO 2
54 54 #define W_STATES 3
55 55
56 56 typedef struct cpu_sysinfo {
57 57 uint_t cpu[CPU_STATES]; /* CPU utilization */
58 58 uint_t wait[W_STATES]; /* CPU wait time breakdown */
59 59 /*
60 60 * The two stats lwrite and bwrite are used by sar(1) to
61 61 * generate the write cache hit percentage (%wcache value).
62 62 *
63 63 * The value is calculated as follows (unless lwrite < 0.5 and
64 64 * then %wcache is coded to 100%):
65 65 *
66 66 * (lwrite - bwrite)/lwrite * 100.0
67 67 *
68 68 * This calculation assumes that when a physical write occurs
69 69 * (bwrite incremented), that a logical write (lwrite
70 70 * incremented) has also occured. Note that a logical write
71 71 * (lwrite incremented) my occur on its own.
72 72 *
73 73 * Similar for lread/bread and %rcache.
74 74 */
75 75 uint_t bread; /* physical block reads */
76 76 uint_t bwrite; /* physical block writes (sync+async) */
77 77 uint_t lread; /* logical block reads */
78 78 uint_t lwrite; /* logical block writes */
79 79 uint_t phread; /* raw I/O reads */
80 80 uint_t phwrite; /* raw I/O writes */
81 81 uint_t pswitch; /* context switches */
82 82 uint_t trap; /* traps */
83 83 uint_t intr; /* device interrupts */
84 84 uint_t syscall; /* system calls */
85 85 uint_t sysread; /* read() + readv() system calls */
86 86 uint_t syswrite; /* write() + writev() system calls */
87 87 uint_t sysfork; /* forks */
88 88 uint_t sysvfork; /* vforks */
89 89 uint_t sysexec; /* execs */
90 90 uint_t readch; /* bytes read by rdwr() */
91 91 uint_t writech; /* bytes written by rdwr() */
92 92 uint_t rcvint; /* XXX: UNUSED */
93 93 uint_t xmtint; /* XXX: UNUSED */
94 94 uint_t mdmint; /* XXX: UNUSED */
95 95 uint_t rawch; /* terminal input characters */
96 96 uint_t canch; /* chars handled in canonical mode */
97 97 uint_t outch; /* terminal output characters */
98 98 uint_t msg; /* msg count (msgrcv()+msgsnd() calls) */
99 99 uint_t sema; /* semaphore ops count (semop() calls) */
100 100 uint_t namei; /* pathname lookups */
101 101 uint_t ufsiget; /* ufs_iget() calls */
102 102 uint_t ufsdirblk; /* directory blocks read */
103 103 uint_t ufsipage; /* inodes taken with attached pages */
104 104 uint_t ufsinopage; /* inodes taked with no attached pages */
105 105 uint_t inodeovf; /* inode table overflows */
106 106 uint_t fileovf; /* file table overflows */
107 107 uint_t procovf; /* proc table overflows */
108 108 uint_t intrthread; /* interrupts as threads (below clock) */
109 109 uint_t intrblk; /* intrs blkd/prempted/released (swtch) */
110 110 uint_t idlethread; /* times idle thread scheduled */
111 111 uint_t inv_swtch; /* involuntary context switches */
112 112 uint_t nthreads; /* thread_create()s */
113 113 uint_t cpumigrate; /* cpu migrations by threads */
114 114 uint_t xcalls; /* xcalls to other cpus */
115 115 uint_t mutex_adenters; /* failed mutex enters (adaptive) */
116 116 uint_t rw_rdfails; /* rw reader failures */
117 117 uint_t rw_wrfails; /* rw writer failures */
118 118 uint_t modload; /* times loadable module loaded */
119 119 uint_t modunload; /* times loadable module unloaded */
120 120 uint_t bawrite; /* physical block writes (async) */
121 121 /* Following are gathered only under #ifdef STATISTICS in source */
122 122 uint_t rw_enters; /* tries to acquire rw lock */
123 123 uint_t win_uo_cnt; /* reg window user overflows */
124 124 uint_t win_uu_cnt; /* reg window user underflows */
125 125 uint_t win_so_cnt; /* reg window system overflows */
126 126 uint_t win_su_cnt; /* reg window system underflows */
127 127 uint_t win_suo_cnt; /* reg window system user overflows */
128 128 } cpu_sysinfo_t;
129 129
130 130 typedef struct sysinfo { /* (update freq) update action */
131 131 uint_t updates; /* (1 sec) ++ */
132 132 uint_t runque; /* (1 sec) += num runnable procs */
133 133 uint_t runocc; /* (1 sec) ++ if num runnable procs > 0 */
134 134 uint_t swpque; /* (1 sec) += num swapped procs */
135 135 uint_t swpocc; /* (1 sec) ++ if num swapped procs > 0 */
136 136 uint_t waiting; /* (1 sec) += jobs waiting for I/O */
137 137 } sysinfo_t;
138 138
139 139 typedef struct cpu_syswait {
140 140 int iowait; /* procs waiting for block I/O */
141 141 int swap; /* XXX: UNUSED */
142 142 int physio; /* XXX: UNUSED */
143 143 } cpu_syswait_t;
144 144
145 145 typedef struct cpu_vminfo {
146 146 uint_t pgrec; /* page reclaims (includes pageout) */
147 147 uint_t pgfrec; /* page reclaims from free list */
148 148 uint_t pgin; /* pageins */
149 149 uint_t pgpgin; /* pages paged in */
150 150 uint_t pgout; /* pageouts */
151 151 uint_t pgpgout; /* pages paged out */
152 152 uint_t swapin; /* swapins */
153 153 uint_t pgswapin; /* pages swapped in */
154 154 uint_t swapout; /* swapouts */
155 155 uint_t pgswapout; /* pages swapped out */
156 156 uint_t zfod; /* pages zero filled on demand */
157 157 uint_t dfree; /* pages freed by daemon or auto */
158 158 uint_t scan; /* pages examined by pageout daemon */
159 159 uint_t rev; /* revolutions of the page daemon hand */
160 160 uint_t hat_fault; /* minor page faults via hat_fault() */
161 161 uint_t as_fault; /* minor page faults via as_fault() */
162 162 uint_t maj_fault; /* major page faults */
163 163 uint_t cow_fault; /* copy-on-write faults */
164 164 uint_t prot_fault; /* protection faults */
165 165 uint_t softlock; /* faults due to software locking req */
166 166 uint_t kernel_asflt; /* as_fault()s in kernel addr space */
167 167 uint_t pgrrun; /* times pager scheduled */
168 168 uint_t execpgin; /* executable pages paged in */
169 169 uint_t execpgout; /* executable pages paged out */
170 170 uint_t execfree; /* executable pages freed */
171 171 uint_t anonpgin; /* anon pages paged in */
172 172 uint_t anonpgout; /* anon pages paged out */
173 173 uint_t anonfree; /* anon pages freed */
174 174 uint_t fspgin; /* fs pages paged in */
175 175 uint_t fspgout; /* fs pages paged out */
176 176 uint_t fsfree; /* fs pages free */
177 177 } cpu_vminfo_t;
178 178
179 179 typedef struct vminfo { /* (update freq) update action */
180 180 uint64_t freemem; /* (1 sec) += freemem in pages */
181 181 uint64_t swap_resv; /* (1 sec) += reserved swap in pages */
182 182 uint64_t swap_alloc; /* (1 sec) += allocated swap in pages */
183 183 uint64_t swap_avail; /* (1 sec) += unreserved swap in pages */
184 184 uint64_t swap_free; /* (1 sec) += unallocated swap in pages */
185 185 uint64_t updates; /* (1 sec) ++ */
186 186 } vminfo_t;
187 187
188 188 typedef struct cpu_stat {
189 189 uint_t __cpu_stat_lock[2]; /* 32-bit kstat compat. */
190 190 cpu_sysinfo_t cpu_sysinfo;
191 191 cpu_syswait_t cpu_syswait;
192 192 cpu_vminfo_t cpu_vminfo;
193 193 } cpu_stat_t;
194 194
195 195 typedef struct cpu_sys_stats {
196 196 uint64_t cpu_ticks_idle; /* CPU utilization */
197 197 uint64_t cpu_ticks_user;
198 198 uint64_t cpu_ticks_kernel;
199 199 uint64_t cpu_ticks_wait;
200 200 uint64_t wait_ticks_io; /* CPU wait time breakdown */
201 201 uint64_t bread; /* physical block reads */
202 202 uint64_t bwrite; /* physical block writes (sync+async) */
203 203 uint64_t lread; /* logical block reads */
204 204 uint64_t lwrite; /* logical block writes */
205 205 uint64_t phread; /* raw I/O Reads */
206 206 uint64_t phwrite; /* raw I/O writes */
207 207 uint64_t pswitch; /* context switches */
208 208 uint64_t trap; /* traps */
209 209 uint64_t intr[PIL_MAX]; /* device interrupts per PIL */
210 210 uint64_t syscall; /* system calls */
211 211 uint64_t sysread; /* read() + readv() system calls */
212 212 uint64_t syswrite; /* write() + writev() system calls */
213 213 uint64_t sysfork; /* forks */
214 214 uint64_t sysvfork; /* vforks */
215 215 uint64_t sysexec; /* execs */
216 216 uint64_t readch; /* bytes read by rdwr() */
217 217 uint64_t writech; /* bytes written by rdwr() */
218 218 uint64_t rcvint; /* XXX: unused (mostly) */
219 219 uint64_t xmtint; /* XXX: unused */
220 220 uint64_t mdmint; /* XXX: unused */
221 221 uint64_t rawch; /* terminal input characters */
222 222 uint64_t canch; /* chars handled in canonical mode */
223 223 uint64_t outch; /* terminal output characters */
224 224 uint64_t msg; /* msg count (msgrcv() + msgsnd()) */
225 225 uint64_t sema; /* semaphore ops count (semop()) */
226 226 uint64_t namei; /* pathname lookups */
227 227 uint64_t ufsiget; /* ufs_iget() calls */
228 228 uint64_t ufsdirblk; /* directory blocks read */
229 229 uint64_t ufsipage; /* inodes taken with attached pages */
230 230 uint64_t ufsinopage; /* inodes taken with no attached pgs */
231 231 uint64_t procovf; /* failed forks */
232 232 uint64_t intrblk; /* ints blkd/prempted/rel'd (swtch) */
233 233 uint64_t intrunpin; /* intr thread unpins pinned thread */
234 234 uint64_t idlethread; /* times idle thread scheduled */
235 235 uint64_t inv_swtch; /* involuntary context switches */
236 236 uint64_t nthreads; /* thread_create()s */
237 237 uint64_t cpumigrate; /* cpu migrations by threads */
238 238 uint64_t xcalls; /* xcalls to other cpus */
239 239 uint64_t mutex_adenters; /* failed mutex enters (adaptive) */
240 240 uint64_t rw_rdfails; /* rw reader failures */
241 241 uint64_t rw_wrfails; /* rw writer failures */
242 242 uint64_t modload; /* times loadable module loaded */
243 243 uint64_t modunload; /* times loadable module unloaded */
244 244 uint64_t bawrite; /* physical block writes (async) */
↓ open down ↓ |
244 lines elided |
↑ open up ↑ |
245 245 uint64_t iowait; /* count of waiters for block I/O */
246 246 } cpu_sys_stats_t;
247 247
248 248 typedef struct cpu_vm_stats {
249 249 uint64_t pgrec; /* page reclaims (includes pageout) */
250 250 uint64_t pgfrec; /* page reclaims from free list */
251 251 uint64_t pgin; /* pageins */
252 252 uint64_t pgpgin; /* pages paged in */
253 253 uint64_t pgout; /* pageouts */
254 254 uint64_t pgpgout; /* pages paged out */
255 - uint64_t swapin; /* swapins */
256 - uint64_t pgswapin; /* pages swapped in */
257 - uint64_t swapout; /* swapouts */
258 - uint64_t pgswapout; /* pages swapped out */
259 255 uint64_t zfod; /* pages zero filled on demand */
260 256 uint64_t dfree; /* pages freed by daemon or auto */
261 257 uint64_t scan; /* pages examined by pageout daemon */
262 258 uint64_t rev; /* revolutions of page daemon hand */
263 259 uint64_t hat_fault; /* minor page faults via hat_fault() */
264 260 uint64_t as_fault; /* minor page faults via as_fault() */
265 261 uint64_t maj_fault; /* major page faults */
266 262 uint64_t cow_fault; /* copy-on-write faults */
267 263 uint64_t prot_fault; /* protection faults */
268 264 uint64_t softlock; /* faults due to software locking req */
269 265 uint64_t kernel_asflt; /* as_fault()s in kernel addr space */
270 266 uint64_t pgrrun; /* times pager scheduled */
271 267 uint64_t execpgin; /* executable pages paged in */
272 268 uint64_t execpgout; /* executable pages paged out */
273 269 uint64_t execfree; /* executable pages freed */
274 270 uint64_t anonpgin; /* anon pages paged in */
275 271 uint64_t anonpgout; /* anon pages paged out */
276 272 uint64_t anonfree; /* anon pages freed */
277 273 uint64_t fspgin; /* fs pages paged in */
278 274 uint64_t fspgout; /* fs pages paged out */
279 275 uint64_t fsfree; /* fs pages free */
280 276 } cpu_vm_stats_t;
281 277
282 278 typedef struct cpu_stats {
283 279 cpu_sys_stats_t sys;
284 280 cpu_vm_stats_t vm;
285 281 } cpu_stats_t;
286 282
287 283 #ifdef __cplusplus
288 284 }
289 285 #endif
290 286
291 287 #endif /* _SYS_SYSINFO_H */
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX