[Crash-utility] Fix bug of list -h

Dave Anderson anderson at redhat.com
Thu Jun 7 13:39:19 UTC 2012



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

> > > 
> > > Hello Petr and Dave,
> > > 
> > > I misunderstood the usage.
> > > 
> > > What I really think is changing the start address from the address of
> > > list_head to the address of the structure where list_head is embedded.
> > > 
> > > In many cases I use list command, I found I can get the address of the
> > > structure where the list_head embedded directly. And I can get the
> > > offset of list_head by -o option. So the offset, say "+432" in your
> > > example, can be omitted. What do you think of such change?
> > 
> > That was also my suggestion. It would even turn "list -h" into something
> > useful. ;-)
> > 
> > Here's my attempt at a patch.
> 
> Plus the documentation part.
> 
> Petr

Thinking back, I think that I left out the -h option because there's no
way the command can tell whether it's passing through the "real"
starting list_head of the list.  The real starting list_head may
be either:

 (1) a standalone LIST_HEAD(), or
 (2) a list_head in a data structure that is different than the data
     structure containing all of the entries of interest.

When that's true, the command will display a bogus structure address
for (1) or (2) when it passing through that list_head.  And if
the -s option is used, it will display compete crap for that 
particular entry.  (unless by chance the -e option is used)

So the documentation update needs work -- it actually confuses the issue
more than it already is...

I think the -h description should state that the address is a pointer to
a "data structure containing a list_head".  The "next" sentence probably 
doesn't belong there, because it's pretty much repeating the list_head
related discussion above in help page's number "2" section.  And
there should probably be a caveat re: the fact that there may be 
a bogus structure address shown in the case of an external LIST_HEAD()
or a starting list_head that's in a different data structure entirely.  

And most importantly, a simple but clear example should be shown.

Dave




 





More information about the Crash-utility mailing list