FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 05-09-2012, 08:47 AM
qiaonuohan
 
Default Adding a new command rbtree

Hello HATAYAMA,

I am trying to add a new command can be used to display rbtree and
radix tree. After some investigation, I find they are similar to the
build-in command "list". So I send this mail to ask your opinion about
making cmd_list to be similar to the command "struct/union/*".

Another thing needed to be inquired is about the style of displaying
tree. I will list some of my thought, and some suggestion will be glad
to get from you.

1.
NODE ... : ...
NODE ... : ...
NODE ... : ...
NODE ... : ...
NODE ... : ...
NODE ... : ...

This style can not indicate whether the leaf is left or right. And with
a big depth, the output may be ugly. So I do not like it.

2.
l - left child
r - right child

root NODE ... : ...
l NODE ... : ...
ll NODE ... : ...
lll NODE ... : ...
lr NODE ... : ...
r NODE ... : ...

Of course, in radix tree, l & r will be changed to some string that can
indicate the child of a node. Still, with a big depth, the line will be
too long and ugly.

3.
root NODE addr1 : ...
addr1 l NODE addr2 : ...
addr2 l NODE addr3 : ...
addr3 l NODE addr4 : ...
addr2 r NODE addr5 : ...
addr1 r NODE addr6 : ...

(l & r have the same meaning with the one in the 2.)

Surely, I prefer the the third one. What do you think? Or eliminating
the information indicating position is acceptable?

--
--
Regards
Qiao Nuohan



--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 05-09-2012, 01:25 PM
Dave Anderson
 
Default Adding a new command rbtree

----- Original Message -----
> Hello HATAYAMA,
>
> I am trying to add a new command can be used to display rbtree and
> radix tree. After some investigation, I find they are similar to the
> build-in command "list". So I send this mail to ask your opinion about
> making cmd_list to be similar to the command "struct/union/*".

Having radix_tree and rbtree enumerators is a good idea.

But before you get started, please do *not* pollute the cmd_list()
function with these two facilities. Make it a separate command
("tree" perhaps?) that can branch and handle the two different
tree types.

It would also be helpful if the interfaces could be made available for
use by other commands, i.e., similar to the way that the "irq" command
uses the do_radix_tree() function in filesys.c, or the way that do_list()
is used by cmd_list(), but is also available as a general purpose function
for other commands.

Dave

>
> Another thing needed to be inquired is about the style of displaying
> tree. I will list some of my thought, and some suggestion will be
> glad
> to get from you.
>
> 1.
> NODE ... : ...
> NODE ... : ...
> NODE ... : ...
> NODE ... : ...
> NODE ... : ...
> NODE ... : ...
>
> This style can not indicate whether the leaf is left or right. And
> with
> a big depth, the output may be ugly. So I do not like it.
>
> 2.
> l - left child
> r - right child
>
> root NODE ... : ...
> l NODE ... : ...
> ll NODE ... : ...
> lll NODE ... : ...
> lr NODE ... : ...
> r NODE ... : ...
>
> Of course, in radix tree, l & r will be changed to some string that
> can
> indicate the child of a node. Still, with a big depth, the line will
> be
> too long and ugly.
>
> 3.
> root NODE addr1 : ...
> addr1 l NODE addr2 : ...
> addr2 l NODE addr3 : ...
> addr3 l NODE addr4 : ...
> addr2 r NODE addr5 : ...
> addr1 r NODE addr6 : ...
>
> (l & r have the same meaning with the one in the 2.)
>
> Surely, I prefer the the third one. What do you think? Or eliminating
> the information indicating position is acceptable?
>
> --
> --
> Regards
> Qiao Nuohan
>
>
>
> --
> Crash-utility mailing list
> Crash-utility@redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
>

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 05-09-2012, 03:01 PM
Wen Congyang
 
Default Adding a new command rbtree

At 2012/5/9 21:25, Dave Anderson Wrote:



----- Original Message -----

Hello HATAYAMA,

I am trying to add a new command can be used to display rbtree and
radix tree. After some investigation, I find they are similar to the
build-in command "list". So I send this mail to ask your opinion about
making cmd_list to be similar to the command "struct/union/*".


Having radix_tree and rbtree enumerators is a good idea.

But before you get started, please do *not* pollute the cmd_list()
function with these two facilities. Make it a separate command
("tree" perhaps?) that can branch and handle the two different
tree types.

It would also be helpful if the interfaces could be made available for
use by other commands, i.e., similar to the way that the "irq" command
uses the do_radix_tree() function in filesys.c, or the way that do_list()
is used by cmd_list(), but is also available as a general purpose function
for other commands.


Hmm, the interfaces is made available for use by other commands,
do you mean that the new command(tree?) can be a built-in command?

Thanks
Wen Congyang



Dave



Another thing needed to be inquired is about the style of displaying
tree. I will list some of my thought, and some suggestion will be
glad
to get from you.

1.
NODE ... : ...
NODE ... : ...
NODE ... : ...
NODE ... : ...
NODE ... : ...
NODE ... : ...

This style can not indicate whether the leaf is left or right. And
with
a big depth, the output may be ugly. So I do not like it.

2.
l - left child
r - right child

root NODE ... : ...
l NODE ... : ...
ll NODE ... : ...
lll NODE ... : ...
lr NODE ... : ...
r NODE ... : ...

Of course, in radix tree, l& r will be changed to some string that
can
indicate the child of a node. Still, with a big depth, the line will
be
too long and ugly.

3.
root NODE addr1 : ...
addr1 l NODE addr2 : ...
addr2 l NODE addr3 : ...
addr3 l NODE addr4 : ...
addr2 r NODE addr5 : ...
addr1 r NODE addr6 : ...

(l& r have the same meaning with the one in the 2.)

Surely, I prefer the the third one. What do you think? Or eliminating
the information indicating position is acceptable?

--
--
Regards
Qiao Nuohan



--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility



--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility



--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 05-09-2012, 03:09 PM
Dave Anderson
 
Default Adding a new command rbtree

----- Original Message -----
> At 2012/5/9 21:25, Dave Anderson Wrote:
> >
> >
> > ----- Original Message -----
> >> Hello HATAYAMA,
> >>
> >> I am trying to add a new command can be used to display rbtree and
> >> radix tree. After some investigation, I find they are similar to the
> >> build-in command "list". So I send this mail to ask your opinion about
> >> making cmd_list to be similar to the command "struct/union/*".
> >
> > Having radix_tree and rbtree enumerators is a good idea.
> >
> > But before you get started, please do *not* pollute the cmd_list()
> > function with these two facilities. Make it a separate command
> > ("tree" perhaps?) that can branch and handle the two different
> > tree types.
> >
> > It would also be helpful if the interfaces could be made available for
> > use by other commands, i.e., similar to the way that the "irq" command
> > uses the do_radix_tree() function in filesys.c, or the way that do_list()
> > is used by cmd_list(), but is also available as a general purpose function
> > for other commands.
>
> Hmm, the interfaces is made available for use by other commands,
> do you mean that the new command(tree?) can be a built-in command?

That's right. Given its general nature, a command that dumps the
contents of the two tree variants would be a good candidate for a
built-in command.

Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 05-10-2012, 01:31 AM
HATAYAMA Daisuke
 
Default Adding a new command rbtree

From: qiaonuohan <qiaonuohan@cn.fujitsu.com>
Subject: [Crash-utility] Adding a new command rbtree
Date: Wed, 09 May 2012 16:47:58 +0800

> Hello HATAYAMA,
>
> I am trying to add a new command can be used to display rbtree and
> radix tree. After some investigation, I find they are similar to the
> build-in command "list". So I send this mail to ask your opinion about
> making cmd_list to be similar to the command "struct/union/*".
>
> Another thing needed to be inquired is about the style of displaying
> tree. I will list some of my thought, and some suggestion will be glad
> to get from you.
>
> 1.
> NODE ... : ...
> NODE ... : ...
> NODE ... : ...
> NODE ... : ...
> NODE ... : ...
> NODE ... : ...
>
> This style can not indicate whether the leaf is left or right. And
> with
> a big depth, the output may be ugly. So I do not like it.
>
> 2.
> l - left child
> r - right child
>
> root NODE ... : ...
> l NODE ... : ...
> ll NODE ... : ...
> lll NODE ... : ...
> lr NODE ... : ...
> r NODE ... : ...
>
> Of course, in radix tree, l & r will be changed to some string that
> can
> indicate the child of a node. Still, with a big depth, the line will
> be
> too long and ugly.
>
> 3.
> root NODE addr1 : ...
> addr1 l NODE addr2 : ...
> addr2 l NODE addr3 : ...
> addr3 l NODE addr4 : ...
> addr2 r NODE addr5 : ...
> addr1 r NODE addr6 : ...
>
> (l & r have the same meaning with the one in the 2.)
>
> Surely, I prefer the the third one. What do you think? Or eliminating
> the information indicating position is acceptable?
>

Hello Qiaon,

It seems natural to me to make output format of both new commands
compatible to list as much as possible. For example, list command
outputs list of address for each nodes at default. rbtree and rdtree
should do like this at defalt?

Other information specific to individual tree structures such as
position of node within the tree could be useful if given. But the
output examples you're showing above can easily violate 80 column
rule. Instead, how about splitting the feature of indicating position
from the default output?

My quick idea here: First, given address of starting node, list all
the nodes addresses connected to the starting node.

crash> list 0xffff88003ef1f908
ffff88003ef1f908
ffff88003ef1eec8
ffff88003ef1e488
ffff88003ef2b948
ffff88003ef2af08
ffff88003ef2a4c8
ffff88003ef55988
ffff88003ef54f48
ffff88003ef899c8

Suppose that user wants to know where the node with ffff88003ef2a4c8
positions in the tree starting from 0xffff88003ef1f908; in other
words, position of node ffff88003ef2a4c8 relative to
0xffff88003ef1f908. Then:

crash> rbtree -p 0xffff88003ef1f908 ffff88003ef2a4c8
rlr

where I choosed -p at random intending "p"osition.

Maybe there's case where user wants to know many positions at the same
time. It might be better to use "<" operator? like

crash> list 0xffff88003ef1f908 > ADDRESS_list.txt
crash> rbtree -p 0xffff88003ef1f908 < ADDRESS_list.txt

Thanks.
HATAYAMA, Daisuke

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 05-10-2012, 02:06 AM
qiaonuohan
 
Default Adding a new command rbtree

At 2012-5-10 9:31, HATAYAMA Daisuke wrote:

From: qiaonuohan<qiaonuohan@cn.fujitsu.com>
Subject: [Crash-utility] Adding a new command rbtree
Date: Wed, 09 May 2012 16:47:58 +0800


Hello HATAYAMA,

I am trying to add a new command can be used to display rbtree and
radix tree. After some investigation, I find they are similar to the
build-in command "list". So I send this mail to ask your opinion about
making cmd_list to be similar to the command "struct/union/*".

Another thing needed to be inquired is about the style of displaying
tree. I will list some of my thought, and some suggestion will be glad
to get from you.

1.
NODE ... : ...
NODE ... : ...
NODE ... : ...
NODE ... : ...
NODE ... : ...
NODE ... : ...

This style can not indicate whether the leaf is left or right. And
with
a big depth, the output may be ugly. So I do not like it.

2.
l - left child
r - right child

root NODE ... : ...
l NODE ... : ...
ll NODE ... : ...
lll NODE ... : ...
lr NODE ... : ...
r NODE ... : ...

Of course, in radix tree, l& r will be changed to some string that
can
indicate the child of a node. Still, with a big depth, the line will
be
too long and ugly.

3.
root NODE addr1 : ...
addr1 l NODE addr2 : ...
addr2 l NODE addr3 : ...
addr3 l NODE addr4 : ...
addr2 r NODE addr5 : ...
addr1 r NODE addr6 : ...

(l& r have the same meaning with the one in the 2.)

Surely, I prefer the the third one. What do you think? Or eliminating
the information indicating position is acceptable?



Hello Qiaon,

It seems natural to me to make output format of both new commands
compatible to list as much as possible. For example, list command
outputs list of address for each nodes at default. rbtree and rdtree
should do like this at defalt?

Other information specific to individual tree structures such as
position of node within the tree could be useful if given. But the
output examples you're showing above can easily violate 80 column
rule. Instead, how about splitting the feature of indicating position
from the default output?

My quick idea here: First, given address of starting node, list all
the nodes addresses connected to the starting node.

crash> list 0xffff88003ef1f908
ffff88003ef1f908
ffff88003ef1eec8
ffff88003ef1e488
ffff88003ef2b948
ffff88003ef2af08
ffff88003ef2a4c8
ffff88003ef55988
ffff88003ef54f48
ffff88003ef899c8

Suppose that user wants to know where the node with ffff88003ef2a4c8
positions in the tree starting from 0xffff88003ef1f908; in other
words, position of node ffff88003ef2a4c8 relative to
0xffff88003ef1f908. Then:

crash> rbtree -p 0xffff88003ef1f908 ffff88003ef2a4c8
rlr

where I choosed -p at random intending "p"osition.

Maybe there's case where user wants to know many positions at the same
time. It might be better to use "<" operator? like

crash> list 0xffff88003ef1f908> ADDRESS_list.txt
crash> rbtree -p 0xffff88003ef1f908< ADDRESS_list.txt


Hello HATAYAMA,

Hmm, your idea seems not that good to me. As you said, it needs to
search the tree to get the information of position one by one. It will
waste time and effort. But you inspired me. Take look at the following
style.


crash> rbtree ...
NODE addr1
...
NODE addr2
...
NODE addr3
...
NODE addr4
...
NODE addr5
...
NODE addr6
...

crash> rbtree -p ...
NODE addr1
(position information)
...
NODE addr2
(position information)
...
NODE addr3
(position information)
...
NODE addr4
(position information)
...
NODE addr5
(position information)
...
NODE addr6
(position information)
...

-p option will make the command to output position information.




Thanks.
HATAYAMA, Daisuke






--
--
Regards
Qiao Nuohan



--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 05-10-2012, 02:30 AM
HATAYAMA Daisuke
 
Default Adding a new command rbtree

From: qiaonuohan <qiaonuohan@cn.fujitsu.com>
Subject: Re: [Crash-utility] Adding a new command rbtree
Date: Thu, 10 May 2012 10:06:25 +0800

> At 2012-5-10 9:31, HATAYAMA Daisuke wrote:
>> From: qiaonuohan<qiaonuohan@cn.fujitsu.com>
>> Subject: [Crash-utility] Adding a new command rbtree
>> Date: Wed, 09 May 2012 16:47:58 +0800

> Hello HATAYAMA,
>
> Hmm, your idea seems not that good to me. As you said, it needs to
> search the tree to get the information of position one by one. It will
> waste time and effort. But you inspired me. Take look at the following
> style.
>
> crash> rbtree ...
> NODE addr1
> ...
> NODE addr2
> ...
> NODE addr3
> ...
> NODE addr4
> ...
> NODE addr5
> ...
> NODE addr6
> ...
>
> crash> rbtree -p ...
> NODE addr1
> (position information)
> ...
> NODE addr2
> (position information)
> ...
> NODE addr3
> (position information)
> ...
> NODE addr4
> (position information)
> ...
> NODE addr5
> (position information)
> ...
> NODE addr6
> (position information)
> ...
>
> -p option will make the command to output position information.
>

It seems better to me.

Just one more thing: "NODE" is obvious and seems not necessary.

Thanks.
HATAYAMA, Daisuke

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 05-17-2012, 03:31 AM
qiaonuohan
 
Default Adding a new command rbtree

Hello Dave,

The attachment is the code that adds two command, rbtree and rdtree. The
commands work well, but, onsidering some code is a copy of command list,
I think the code still need a big change.
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 05-18-2012, 09:04 PM
Dave Anderson
 
Default Adding a new command rbtree

----- Original Message -----
> Hello Dave,
>
> The attachment is the code that adds two command, rbtree and rdtree. The
> commands work well, but, onsidering some code is a copy of command list,
> I think the code still need a big change.
>

Hi Qiao,

I haven't been able to spend much time looking at this patch, but
these are my initial impressions.

My suggestion of a single "tree" command was just that, where there
would be a single "tree" command, and that command would require an
option to make the differentiation between an red-black tree and a
radix tree.

I don't quite understand why you *only* have the "[-o] offset" advertised
for the rbtree command? Virtually every instance of a radix_tree_root
structure in the kernel is embedded in a data structure, similar to the
typical usage of an rb_root. Why the difference?

The "-H start" option should probably be something like "-R" for "root".
When -H is used in the list command, it refers to list_[H]ead.

The examples in the help pages are not particularly helpful.
I don't know what "tts.rb" refers to? Can you find better examples
that the user can relate to?

Also, a clear explanation of what the "position information" actually
means would be helpful.

Thanks,
Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 05-21-2012, 01:46 AM
qiaonuohan
 
Default Adding a new command rbtree

At 2012-5-19 5:04, Dave Anderson wrote:



----- Original Message -----

Hello Dave,

The attachment is the code that adds two command, rbtree and rdtree. The
commands work well, but, onsidering some code is a copy of command list,
I think the code still need a big change.



Hi Qiao,

I haven't been able to spend much time looking at this patch, but
these are my initial impressions.

My suggestion of a single "tree" command was just that, where there
would be a single "tree" command, and that command would require an
option to make the differentiation between an red-black tree and a
radix tree.

I don't quite understand why you *only* have the "[-o] offset" advertised
for the rbtree command? Virtually every instance of a radix_tree_root
structure in the kernel is embedded in a data structure, similar to the
typical usage of an rb_root. Why the difference?


I only considered the address to be the pointer of radix_tree_root or
radix_tree_node. As you said, I will add the pointer to the structure
in which radix_tree_root embedded in. And about other suggestion, I
will accept to modify my patch.



The "-H start" option should probably be something like "-R" for "root".
When -H is used in the list command, it refers to list_[H]ead.

The examples in the help pages are not particularly helpful.
I don't know what "tts.rb" refers to? Can you find better examples
that the user can relate to?

Also, a clear explanation of what the "position information" actually
means would be helpful.

Thanks,
Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility





--
--
Regards
Qiao Nuohan



--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 05:07 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org