[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-26 Thread zhijun
Eric Schrock wrote: > On Sat, Aug 25, 2007 at 10:45:10AM +0800, zhijun wrote: > >> I really appreciate your kindness to explain this for me. >> >> ::array ... p | ::eval '> well with mdb pipeline. What I am suprized is that ::array ... p | /Kn >> *doesn't* give pure uintptr_t's, as its output

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-25 Thread zhijun
Eric Schrock wrote: > You have a couple different things in play here. > > First, MDB pipelines only work with uintptr_t's, not arbitrary text. So > when you try to pipe something like "foo: X" or "X Y Z" to another dcmd, > the parser will choke. > > Normally, the formatting commands ('/' and fr

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-25 Thread Eric Schrock
On Sat, Aug 25, 2007 at 10:45:10AM +0800, zhijun wrote: > > I really appreciate your kindness to explain this for me. > > ::array ... p | ::eval ' well with mdb pipeline. What I am suprized is that ::array ... p | /Kn > *doesn't* give pure uintptr_t's, as its output has an address in the first

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-25 Thread Jonathan Adams
On 8/24/07, zhijun wrote: > > > Eric Schrock wrote: > > You have a couple different things in play here. > > First, MDB pipelines only work with uintptr_t's, not arbitrary text. So > when you try to pipe something like "foo: X" or "X Y Z" to another dcmd, > the parser will choke. > > Normally, th

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-24 Thread zhijun
fffecc47e000::array "struct vnode *" 0t2048 p|::eval >>> 0xfffecc47e000: 0 0xfffecc47e008: 0 0xfffecc47e010: 0 0xfffecc47e018: 0 0xfffecc47e020: 0 0xfffecc47e028: 0 0xfffecc47e030: 0 0xfffecc47e038: 0 0xfffecc47e0

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-24 Thread Eric Schrock
You have a couple different things in play here. First, MDB pipelines only work with uintptr_t's, not arbitrary text. So when you try to pipe something like "foo: X" or "X Y Z" to another dcmd, the parser will choke. Normally, the formatting commands ('/' and friends) recognize when you are in p

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-24 Thread zhijun
Eric Schrock ??: > On Thu, Aug 23, 2007 at 11:34:20PM +0800, zhijun wrote: > >> Alexandre Chartre wrote: >> >>> You can do: >>> >>>*swap_vnodes::array "struct vnode *" 0t2048 | /Kn | ::grep . >>> >>> alex. >>> >> Hi alex, >> Thanks, it works. >> Whille I still would lik

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-23 Thread zhijun
Alexandre Chartre wrote: > > You can do: > >*swap_vnodes::array "struct vnode *" 0t2048 | /Kn | ::grep . > > alex. Hi alex, Thanks, it works. Whille I still would like to know whether this is a way to specify "not equal" in mdb, so I can exclude the variables with some specific val

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-23 Thread zhijun
Hi folks, I met a problem when investigating the swap code. There is an array called swap_vnodes[],which contains pointers to all the swap vnodes in system. static struct vnode **swap_vnodes; #define MAX_SWAP_VNODES 2048 While this is a pointer to pointer,I would like to dump the array and see wh

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-23 Thread Eric Schrock
On Fri, Aug 24, 2007 at 12:27:38AM +0800, zhijun wrote: > > Thanks, Eric. This eliminates most of my doublts. > Just want to be sure, it seems that from the below results, actually mdb > taks '=' as the command, instead of taking 0x1234. > > *swap_vnodes::array "struct vnode *" 0t2048 p |/Kn |::gr

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-23 Thread Eric Schrock
On Thu, Aug 23, 2007 at 11:34:20PM +0800, zhijun wrote: > Alexandre Chartre wrote: > > > > You can do: > > > >*swap_vnodes::array "struct vnode *" 0t2048 | /Kn | ::grep . > > > > alex. > Hi alex, > Thanks, it works. > Whille I still would like to know whether this is a way to specify

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-23 Thread Alexandre Chartre
!= works but you have to use quote otherwise the ! is interpreted as a pipe to a shell command ; so you can do: *swap_vnodes::array "struct vnode *" 0t2048 | /Kn | ::grep '. != 0' alex. zhijun wrote: > Alexandre Chartre wrote: >> >> You can do: >> >>*swap_vnodes::array "struct vnod

[mdb-discuss] how to dump a array and find which slots are non zero?

2007-08-23 Thread Alexandre Chartre
You can do: *swap_vnodes::array "struct vnode *" 0t2048 | /Kn | ::grep . alex. zhijun wrote: > Hi folks, > I met a problem when investigating the swap code. There is an array > called swap_vnodes[],which contains pointers to all the swap vnodes in > system. > > static struct vnode **swa