FreeBSD/Linux Kernel Cross Reference
sys/gdbscripts/kdump
1 # $NetBSD: kdump,v 1.2 1997/02/12 23:35:07 gwr Exp $
2
3 # Dump kmem statistics
4 # @(#)kdump 8.1 (Berkeley) 6/10/93
5
6 set $last=75
7 set $seg=43
8
9 # kmem_hdr
10 define kmemhdr
11 printf "\tINUSE\tCALLS\tMEMUSED\tLIMBLK\tMAPBLK\tMAXUSED\t\tLIMIT\n"
12 end
13
14 # pkmem <ptr>
15 define pkmem
16 set $kp=(struct kmemstats *)$arg0
17 set $n = (struct kmemstats *)$kp - (struct kmemstats *)kmemstats
18 printf "%d:\t%d\t%d", $n, $kp->ks_inuse, $kp->ks_calls
19 printf "\t0x%x\t%d", $kp->ks_memuse, $kp->ks_limblocks
20 printf "\t%d\t0x%x\t\t%d\n", $kp->ks_mapblocks, $kp->ks_maxused, $kp->ks_limit
21 end
22
23 define kmemdump
24 set $kp=(struct kmemstats *)(kmemstats + $arg0)
25 kmemhdr
26 pkmem $kp
27 end
28
29 define kdumpall
30 set $i=0
31
32 kmemhdr
33 set $kp = (struct kmemstats *)kmemstats
34 while ($i < $last)
35 pkmem $kp
36 set $kp++
37 set $i++
38 end
39 end
Cache object: 047584783e93c421d57abdee108a2c4b
|