NetBSD/sys/gdbscripts/kdump
1997-02-12 23:35:06 +00:00

40 lines
796 B
Plaintext

# $NetBSD: kdump,v 1.2 1997/02/12 23:35:07 gwr Exp $
# Dump kmem statistics
# @(#)kdump 8.1 (Berkeley) 6/10/93
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