summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2019-12-05 15:19:35 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2019-12-05 15:19:35 +0000
commitd3babb0768ae9143689d2cfd18f2b12d6ec598a9 (patch)
tree348bd5f2d64225f07fbae2a2e87c4bb6225971c9 /sys
parent3a6ea69ab8dbb923f79a9ea231945e06344895a0 (diff)
Move uvmexp_print() to a better place.
ok mlarkin@
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/files3
-rw-r--r--sys/uvm/uvm_meter.c62
-rw-r--r--sys/uvm/uvm_stat.c98
3 files changed, 62 insertions, 101 deletions
diff --git a/sys/conf/files b/sys/conf/files
index d6ada6f53a9..0cef7842919 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $OpenBSD: files,v 1.677 2019/11/05 08:18:47 mpi Exp $
+# $OpenBSD: files,v 1.678 2019/12/05 15:19:33 mpi Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -964,7 +964,6 @@ file uvm/uvm_page.c
file uvm/uvm_pager.c
file uvm/uvm_pdaemon.c
file uvm/uvm_pmemrange.c
-file uvm/uvm_stat.c
file uvm/uvm_swap.c
file uvm/uvm_swap_encrypt.c uvm_swap_encrypt
file uvm/uvm_unix.c
diff --git a/sys/uvm/uvm_meter.c b/sys/uvm/uvm_meter.c
index 794811366ba..081bd769554 100644
--- a/sys/uvm/uvm_meter.c
+++ b/sys/uvm/uvm_meter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_meter.c,v 1.38 2018/11/06 07:49:38 otto Exp $ */
+/* $OpenBSD: uvm_meter.c,v 1.39 2019/12/05 15:19:33 mpi Exp $ */
/* $NetBSD: uvm_meter.c,v 1.21 2001/07/14 06:36:03 matt Exp $ */
/*
@@ -43,6 +43,7 @@
#include <sys/sysctl.h>
#include <sys/vmmeter.h>
#include <uvm/uvm.h>
+#include <uvm/uvm_ddb.h>
#ifdef UVM_SWAP_ENCRYPT
#include <uvm/uvm_swap.h>
@@ -312,3 +313,62 @@ uvm_total(struct vmtotal *totalp)
totalp->t_rmshr = 0; /* XXX */
totalp->t_armshr = 0; /* XXX */
}
+
+#ifdef DDB
+
+/*
+ * uvmexp_print: ddb hook to print interesting uvm counters
+ */
+void
+uvmexp_print(int (*pr)(const char *, ...))
+{
+
+ (*pr)("Current UVM status:\n");
+ (*pr)(" pagesize=%d (0x%x), pagemask=0x%x, pageshift=%d\n",
+ uvmexp.pagesize, uvmexp.pagesize, uvmexp.pagemask,
+ uvmexp.pageshift);
+ (*pr)(" %d VM pages: %d active, %d inactive, %d wired, %d free (%d zero)\n",
+ uvmexp.npages, uvmexp.active, uvmexp.inactive, uvmexp.wired,
+ uvmexp.free, uvmexp.zeropages);
+ (*pr)(" min %d%% (%d) anon, %d%% (%d) vnode, %d%% (%d) vtext\n",
+ uvmexp.anonminpct, uvmexp.anonmin, uvmexp.vnodeminpct,
+ uvmexp.vnodemin, uvmexp.vtextminpct, uvmexp.vtextmin);
+ (*pr)(" freemin=%d, free-target=%d, inactive-target=%d, "
+ "wired-max=%d\n", uvmexp.freemin, uvmexp.freetarg, uvmexp.inactarg,
+ uvmexp.wiredmax);
+ (*pr)(" faults=%d, traps=%d, intrs=%d, ctxswitch=%d fpuswitch=%d\n",
+ uvmexp.faults, uvmexp.traps, uvmexp.intrs, uvmexp.swtch,
+ uvmexp.fpswtch);
+ (*pr)(" softint=%d, syscalls=%d, kmapent=%d\n",
+ uvmexp.softs, uvmexp.syscalls, uvmexp.kmapent);
+
+ (*pr)(" fault counts:\n");
+ (*pr)(" noram=%d, noanon=%d, noamap=%d, pgwait=%d, pgrele=%d\n",
+ uvmexp.fltnoram, uvmexp.fltnoanon, uvmexp.fltnoamap,
+ uvmexp.fltpgwait, uvmexp.fltpgrele);
+ (*pr)(" ok relocks(total)=%d(%d), anget(retries)=%d(%d), "
+ "amapcopy=%d\n", uvmexp.fltrelckok, uvmexp.fltrelck,
+ uvmexp.fltanget, uvmexp.fltanretry, uvmexp.fltamcopy);
+ (*pr)(" neighbor anon/obj pg=%d/%d, gets(lock/unlock)=%d/%d\n",
+ uvmexp.fltnamap, uvmexp.fltnomap, uvmexp.fltlget, uvmexp.fltget);
+ (*pr)(" cases: anon=%d, anoncow=%d, obj=%d, prcopy=%d, przero=%d\n",
+ uvmexp.flt_anon, uvmexp.flt_acow, uvmexp.flt_obj, uvmexp.flt_prcopy,
+ uvmexp.flt_przero);
+
+ (*pr)(" daemon and swap counts:\n");
+ (*pr)(" woke=%d, revs=%d, scans=%d, obscans=%d, anscans=%d\n",
+ uvmexp.pdwoke, uvmexp.pdrevs, uvmexp.pdscans, uvmexp.pdobscan,
+ uvmexp.pdanscan);
+ (*pr)(" busy=%d, freed=%d, reactivate=%d, deactivate=%d\n",
+ uvmexp.pdbusy, uvmexp.pdfreed, uvmexp.pdreact, uvmexp.pddeact);
+ (*pr)(" pageouts=%d, pending=%d, nswget=%d\n", uvmexp.pdpageouts,
+ uvmexp.pdpending, uvmexp.nswget);
+ (*pr)(" nswapdev=%d\n",
+ uvmexp.nswapdev);
+ (*pr)(" swpages=%d, swpginuse=%d, swpgonly=%d paging=%d\n",
+ uvmexp.swpages, uvmexp.swpginuse, uvmexp.swpgonly, uvmexp.paging);
+
+ (*pr)(" kernel pointers:\n");
+ (*pr)(" objs(kern)=%p\n", uvm.kernel_object);
+}
+#endif
diff --git a/sys/uvm/uvm_stat.c b/sys/uvm/uvm_stat.c
deleted file mode 100644
index 2d50c11b394..00000000000
--- a/sys/uvm/uvm_stat.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* $OpenBSD: uvm_stat.c,v 1.30 2018/06/19 22:35:07 krw Exp $ */
-/* $NetBSD: uvm_stat.c,v 1.18 2001/03/09 01:02:13 chs Exp $ */
-
-/*
- * Copyright (c) 1997 Charles D. Cranor and Washington University.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * from: Id: uvm_stat.c,v 1.1.2.3 1997/12/19 15:01:00 mrg Exp
- */
-
-/*
- * uvm_stat.c
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#include <uvm/uvm.h>
-#include <uvm/uvm_ddb.h>
-
-#ifdef DDB
-
-/*
- * uvmexp_print: ddb hook to print interesting uvm counters
- */
-void
-uvmexp_print(int (*pr)(const char *, ...))
-{
-
- (*pr)("Current UVM status:\n");
- (*pr)(" pagesize=%d (0x%x), pagemask=0x%x, pageshift=%d\n",
- uvmexp.pagesize, uvmexp.pagesize, uvmexp.pagemask,
- uvmexp.pageshift);
- (*pr)(" %d VM pages: %d active, %d inactive, %d wired, %d free (%d zero)\n",
- uvmexp.npages, uvmexp.active, uvmexp.inactive, uvmexp.wired,
- uvmexp.free, uvmexp.zeropages);
- (*pr)(" min %d%% (%d) anon, %d%% (%d) vnode, %d%% (%d) vtext\n",
- uvmexp.anonminpct, uvmexp.anonmin, uvmexp.vnodeminpct,
- uvmexp.vnodemin, uvmexp.vtextminpct, uvmexp.vtextmin);
- (*pr)(" freemin=%d, free-target=%d, inactive-target=%d, "
- "wired-max=%d\n", uvmexp.freemin, uvmexp.freetarg, uvmexp.inactarg,
- uvmexp.wiredmax);
- (*pr)(" faults=%d, traps=%d, intrs=%d, ctxswitch=%d fpuswitch=%d\n",
- uvmexp.faults, uvmexp.traps, uvmexp.intrs, uvmexp.swtch,
- uvmexp.fpswtch);
- (*pr)(" softint=%d, syscalls=%d, kmapent=%d\n",
- uvmexp.softs, uvmexp.syscalls, uvmexp.kmapent);
-
- (*pr)(" fault counts:\n");
- (*pr)(" noram=%d, noanon=%d, noamap=%d, pgwait=%d, pgrele=%d\n",
- uvmexp.fltnoram, uvmexp.fltnoanon, uvmexp.fltnoamap,
- uvmexp.fltpgwait, uvmexp.fltpgrele);
- (*pr)(" ok relocks(total)=%d(%d), anget(retries)=%d(%d), "
- "amapcopy=%d\n", uvmexp.fltrelckok, uvmexp.fltrelck,
- uvmexp.fltanget, uvmexp.fltanretry, uvmexp.fltamcopy);
- (*pr)(" neighbor anon/obj pg=%d/%d, gets(lock/unlock)=%d/%d\n",
- uvmexp.fltnamap, uvmexp.fltnomap, uvmexp.fltlget, uvmexp.fltget);
- (*pr)(" cases: anon=%d, anoncow=%d, obj=%d, prcopy=%d, przero=%d\n",
- uvmexp.flt_anon, uvmexp.flt_acow, uvmexp.flt_obj, uvmexp.flt_prcopy,
- uvmexp.flt_przero);
-
- (*pr)(" daemon and swap counts:\n");
- (*pr)(" woke=%d, revs=%d, scans=%d, obscans=%d, anscans=%d\n",
- uvmexp.pdwoke, uvmexp.pdrevs, uvmexp.pdscans, uvmexp.pdobscan,
- uvmexp.pdanscan);
- (*pr)(" busy=%d, freed=%d, reactivate=%d, deactivate=%d\n",
- uvmexp.pdbusy, uvmexp.pdfreed, uvmexp.pdreact, uvmexp.pddeact);
- (*pr)(" pageouts=%d, pending=%d, nswget=%d\n", uvmexp.pdpageouts,
- uvmexp.pdpending, uvmexp.nswget);
- (*pr)(" nswapdev=%d\n",
- uvmexp.nswapdev);
- (*pr)(" swpages=%d, swpginuse=%d, swpgonly=%d paging=%d\n",
- uvmexp.swpages, uvmexp.swpginuse, uvmexp.swpgonly, uvmexp.paging);
-
- (*pr)(" kernel pointers:\n");
- (*pr)(" objs(kern)=%p\n", uvm.kernel_object);
-}
-#endif