3 # Count the number of buffers in the buffer cache for which
4 # bp->b_flags & $bufcount_match is non-0.
6 # @(#)bdump 8.1 (Berkeley) 6/10/93
8 set $bufcount_match=0x020000
16 set $bp = bufhash[$i].b_forw
17 while ($bp != bufhash[$i].b_back)
18 if ($bp->b_flags & $bufcount_match)
23 # printf "bucket: %d cumulative %d\n", $i, $num
26 printf "Number of buffers with flags & %x in hash table: %d\n", $bufcount_match, $num
29 # Dump the entire buffer cache.
38 set $bp = bufhash[$i].b_forw
39 while ($bp != bufhash[$i].b_back)
40 printf "bp=0x%x flags=0x%x vp=0x%x lblkno=0x%x blkno=0x%x\n", $bp, $bp->b_flags, $bp->b_vp, $bp->b_lblkno, $bp->b_blkno
46 printf "Number of buffers in hash table: %d\n", $num
49 # Dump the buffers in a particular hashbucket.
50 # usage: dumpbucket bucketnumber
54 set $bp = bufhash[$arg0].b_forw
55 while ($bp != bufhash[$arg0].b_back)
56 printf "bp=0x%x flags=0x%x vp=0x%x lblkno=0x%x blkno=0x%x\n", $bp, $bp->b_flags, $bp->b_vp, $bp->b_lblkno, $bp->b_blkno
60 printf "Number of buffers in bucket %d: %d\n", $arg0, $num
63 # Dump the buffers on the empty and age queues
72 printf "Queue %d\n", $i
73 set $bp = (struct buf *)bufqueues[$i].qe_next
75 printf "bp=0x%x flags=0x%x vp=0x%x lbn=%d size=0x%x\n", $bp, $bp->b_flags, $bp->b_vp, $bp->b_lblkno, $bp->b_bufsize
77 set $bp = (struct buf *)$bp->b_freelist.qe_next
81 printf "Number of buffers in free lists: %d\n", $num
86 set $bp = (struct buf *)$arg0
88 printf "bp=0x%x flags=0x%x bn=0x%x lbn=%d count=%d size=%d\n", $bp, $bp->b_flags, $bp->b_blkno, $bp->b_lblkno, $bp->b_bcount, $bp->b_bufsize
89 set $bp = (struct buf *)$bp->b_vnbufs.qe_next
97 printf "Queue %d\n", $arg0
98 set $bp = (struct buf *)bufqueues[$arg0].qe_next
100 printf "bp=0x%x flags=0x%x vp=0x%x lbn=%d size=0x%x\n", $bp, $bp->b_flags, $bp->b_vp, $bp->b_lblkno, $bp->b_bufsize
102 set $bp = (struct buf *)$bp->b_freelist.qe_next
104 printf "Number of buffers on queue %d: %d\n", $arg0, $num