4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / sys / scripts / kdump
# Dump kmem statistics
# @(#)kdump 8.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