Line data Source code
1 : /* $OpenBSD: uvm_stat.c,v 1.30 2018/06/19 22:35:07 krw Exp $ */
2 : /* $NetBSD: uvm_stat.c,v 1.18 2001/03/09 01:02:13 chs Exp $ */
3 :
4 : /*
5 : * Copyright (c) 1997 Charles D. Cranor and Washington University.
6 : * All rights reserved.
7 : *
8 : * Redistribution and use in source and binary forms, with or without
9 : * modification, are permitted provided that the following conditions
10 : * are met:
11 : * 1. Redistributions of source code must retain the above copyright
12 : * notice, this list of conditions and the following disclaimer.
13 : * 2. Redistributions in binary form must reproduce the above copyright
14 : * notice, this list of conditions and the following disclaimer in the
15 : * documentation and/or other materials provided with the distribution.
16 : *
17 : * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 : * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 : * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 : * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 : * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 : * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 : * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 : * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 : * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 : * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 : *
28 : * from: Id: uvm_stat.c,v 1.1.2.3 1997/12/19 15:01:00 mrg Exp
29 : */
30 :
31 : /*
32 : * uvm_stat.c
33 : */
34 :
35 : #include <sys/param.h>
36 : #include <sys/systm.h>
37 :
38 : #include <uvm/uvm.h>
39 : #include <uvm/uvm_ddb.h>
40 :
41 : #ifdef DDB
42 :
43 : /*
44 : * uvmexp_print: ddb hook to print interesting uvm counters
45 : */
46 : void
47 0 : uvmexp_print(int (*pr)(const char *, ...))
48 : {
49 :
50 0 : (*pr)("Current UVM status:\n");
51 0 : (*pr)(" pagesize=%d (0x%x), pagemask=0x%x, pageshift=%d\n",
52 0 : uvmexp.pagesize, uvmexp.pagesize, uvmexp.pagemask,
53 0 : uvmexp.pageshift);
54 0 : (*pr)(" %d VM pages: %d active, %d inactive, %d wired, %d free (%d zero)\n",
55 0 : uvmexp.npages, uvmexp.active, uvmexp.inactive, uvmexp.wired,
56 0 : uvmexp.free, uvmexp.zeropages);
57 0 : (*pr)(" min %d%% (%d) anon, %d%% (%d) vnode, %d%% (%d) vtext\n",
58 0 : uvmexp.anonminpct, uvmexp.anonmin, uvmexp.vnodeminpct,
59 0 : uvmexp.vnodemin, uvmexp.vtextminpct, uvmexp.vtextmin);
60 0 : (*pr)(" freemin=%d, free-target=%d, inactive-target=%d, "
61 0 : "wired-max=%d\n", uvmexp.freemin, uvmexp.freetarg, uvmexp.inactarg,
62 0 : uvmexp.wiredmax);
63 0 : (*pr)(" faults=%d, traps=%d, intrs=%d, ctxswitch=%d fpuswitch=%d\n",
64 0 : uvmexp.faults, uvmexp.traps, uvmexp.intrs, uvmexp.swtch,
65 0 : uvmexp.fpswtch);
66 0 : (*pr)(" softint=%d, syscalls=%d, kmapent=%d\n",
67 0 : uvmexp.softs, uvmexp.syscalls, uvmexp.kmapent);
68 :
69 0 : (*pr)(" fault counts:\n");
70 0 : (*pr)(" noram=%d, noanon=%d, noamap=%d, pgwait=%d, pgrele=%d\n",
71 0 : uvmexp.fltnoram, uvmexp.fltnoanon, uvmexp.fltnoamap,
72 0 : uvmexp.fltpgwait, uvmexp.fltpgrele);
73 0 : (*pr)(" ok relocks(total)=%d(%d), anget(retries)=%d(%d), "
74 0 : "amapcopy=%d\n", uvmexp.fltrelckok, uvmexp.fltrelck,
75 0 : uvmexp.fltanget, uvmexp.fltanretry, uvmexp.fltamcopy);
76 0 : (*pr)(" neighbor anon/obj pg=%d/%d, gets(lock/unlock)=%d/%d\n",
77 0 : uvmexp.fltnamap, uvmexp.fltnomap, uvmexp.fltlget, uvmexp.fltget);
78 0 : (*pr)(" cases: anon=%d, anoncow=%d, obj=%d, prcopy=%d, przero=%d\n",
79 0 : uvmexp.flt_anon, uvmexp.flt_acow, uvmexp.flt_obj, uvmexp.flt_prcopy,
80 0 : uvmexp.flt_przero);
81 :
82 0 : (*pr)(" daemon and swap counts:\n");
83 0 : (*pr)(" woke=%d, revs=%d, scans=%d, obscans=%d, anscans=%d\n",
84 0 : uvmexp.pdwoke, uvmexp.pdrevs, uvmexp.pdscans, uvmexp.pdobscan,
85 0 : uvmexp.pdanscan);
86 0 : (*pr)(" busy=%d, freed=%d, reactivate=%d, deactivate=%d\n",
87 0 : uvmexp.pdbusy, uvmexp.pdfreed, uvmexp.pdreact, uvmexp.pddeact);
88 0 : (*pr)(" pageouts=%d, pending=%d, nswget=%d\n", uvmexp.pdpageouts,
89 0 : uvmexp.pdpending, uvmexp.nswget);
90 0 : (*pr)(" nswapdev=%d\n",
91 0 : uvmexp.nswapdev);
92 0 : (*pr)(" swpages=%d, swpginuse=%d, swpgonly=%d paging=%d\n",
93 0 : uvmexp.swpages, uvmexp.swpginuse, uvmexp.swpgonly, uvmexp.paging);
94 :
95 0 : (*pr)(" kernel pointers:\n");
96 0 : (*pr)(" objs(kern)=%p\n", uvm.kernel_object);
97 0 : }
98 : #endif
|