Sync usage with man page.
[netbsd-mini2440.git] / sys / gdbscripts / vchain
blob030ea22309b53de6c3c4015dadd6be216b2921dd
1 #       $NetBSD: vchain,v 1.5 2006/11/04 20:33:17 pooka Exp $
3 #       @(#)vchain      8.1 (Berkeley) 6/10/93
6 define vchain
7         set $num = 0
9         set $vp=(struct vnode *)$arg0
10         while ($vp)
11                 printf "vp: 0x%lx freelist_next: 0x%lx usecount: %d flags: i:0x%x v:0x%x u:0x%x\n",\
12                        $vp, $vp->v_freelist.tqe_next, $vp->v_uobj.uo_refs, \
13                        $vp->v_iflag, $vp->v_vflag, $vp->v_uflag
14                 set $num++
15                 set $vp = $vp->v_mntvnodes.tqe_next
16         end
17         printf "Number of vnodes: %d\n", $num
18 end
20 document vchain
21 Given a vnode, follow its mount pointers
22 end
24 define vprint
25         set $vp=(struct vnode *)$arg0
26         set $ip=(struct inode *)$vp->v_data
27 end
29 define mp_vchain
30         set $mp = (struct mount *)$arg0
31         vchain $mp->mnt_vnodelist.tqh_first
32 end
33 document mp_vchain
34 print the vnode chain for a given mount point
35 end
37 define vall
38         set $mp=mountlist.cqh_first
39         while ($mp)
40                 printf "\tmount point at 0x%x\n", $mp
41                 mp_vchain $mp
42                 set $mp=$mp->mnt_list.cqe_next
44                 # "break"
45                 if ((const void *)$mp == (const void *)&mountlist)
46                         set $mp = 0
47                 end
48         end
49 end
50 document vall
51 print vnode chains for all mount points
52 end
54 define mountdump
55         set $mp=mountlist.cqh_first
56         while ($mp)
57                 printf "%s on %s type %s, (mp 0x%x, privdata 0x%x)\n", \
58                     $mp->mnt_stat->f_mntfromname, $mp->mnt_stat->f_mntonname, \
59                     $mp->mnt_op->vfs_name, $mp, $mp->mnt_data
60                 set $mp=$mp->mnt_list.cqe_next
61                 if ((const void *)$mp == (const void *)&mountlist)
62                         set $mp = 0
63                 end
64         end
65 end