date and time created 93/06/10 23:43:39 by bostic
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 11 Jun 1993 14:43:39 +0000 (06:43 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 11 Jun 1993 14:43:39 +0000 (06:43 -0800)
SCCS-vsn: sys/scripts/kdump 7.1

usr/src/sys/scripts/kdump [new file with mode: 0644]

diff --git a/usr/src/sys/scripts/kdump b/usr/src/sys/scripts/kdump
new file mode 100644 (file)
index 0000000..63779d3
--- /dev/null
@@ -0,0 +1,37 @@
+# Dump kmem statistics
+#      @(#)kdump       7.1 (Berkeley) %G%
+
+set $last=75
+set $seg=43
+
+# kmem_hdr
+define kmemhdr
+       printf "\tINUSE\tCALLS\tMEMUSED\tLIMBLK\tMAPBLK\tMAXUSED\t\tLIMIT\n"
+end
+
+# pkmem <ptr>
+define pkmem
+       set $kp=(struct kmemstats *)$arg0
+       set $n = (struct kmemstats *)$kp - (struct kmemstats *)kmemstats
+       printf "%d:\t%d\t%d", $n, $kp->ks_inuse, $kp->ks_calls
+       printf "\t0x%x\t%d", $kp->ks_memuse, $kp->ks_limblocks
+       printf "\t%d\t0x%x\t\t%d\n", $kp->ks_mapblocks, $kp->ks_maxused, $kp->ks_limit
+end
+
+define kmemdump
+       set $kp=(struct kmemstats *)(kmemstats + $arg0)
+       kmemhdr
+       pkmem $kp
+end
+
+define kdumpall
+       set $i=0
+
+       kmemhdr
+       set $kp = (struct kmemstats *)kmemstats
+       while ($i < $last)
+               pkmem $kp
+               set $kp++
+               set $i++
+       end
+end