[Crash-utility] [PATCH 1/1] Resend CLI list command, print deep structure members

Dave Anderson anderson at redhat.com
Thu May 14 22:37:14 UTC 2015



----- Original Message -----
> Hi Dave,
> 
> I'm sorry for my poor Inglish :)
> 
> > I actually haven't studied the meat of parse_for_member_new() yet,
> > but in testing the patch, I've come up with a few issues that still
> > need addressing.
> 
> Could you please clarify your last point?

If you mean the paragraph above, I meant that I haven't reviewed 
parse_for_member_new() and its support functions, but have only done
some preliminary testing, which lead to the issues I listed below.

> 
> > Unlike what you have done for "struct" and "list", when the "task"
> > command calls task_struct_member(), if *any* of the comma-separated
> > members are the new complicated format, you set the call_new_parser
> > flag, so it somewhat defeats the purpose of having the flag at all:
> > 
> >         if (call_new_parser) {
> >                 for (i = 0; i < argcnt; i++) {
> >                         dm.member = arglist[i];
> >                         parse_for_member_new(&dm, 0);
> >                 }
> >         } else {
> >                 parse_task_thread(argcnt, arglist, tc);
> >         }
> 
> If I understood you right, you want the `parse_task_thread` to be called
> for every simple field and `parse_for_member_new` should be called for
> complicated format only. That is if you specify line
> 
> % task -R foo,bar,baz.foo.xxx
> 
> `parse_task_thread` should be called for `foo` and `bar`, whereas
> `parse_for_member_new` would be called for `baz.foo.xxx` only.
> 
> Am I right?

That's exactly right.

> 
> > I still would like the confidence of knowing that the old function
> > will still be used with the simple "struct.member" format.
> > 
> > And related to the issue above, here's a bug -- the "task" command
> > is quite often useful to call from "foreach", where for each task,
> > the task's banner is displayed followed by the requested data.
> ...
> > But when I add a new extended reference, the banner doesn't get displayed,
> > rendering the command useless:
> ...
> 
> I will fix it.
> 
> > Also, similar to the "list" command, the "tree" command also supports the
> > "-s struct.member" option:
> > 
> >   crash> help tree
> >   ... [ cut ] ...
> > 
> >     -s struct  For each entry in a tree, format and print it as this type
> >     of data
> >                structure; use the "struct.member" format in order to display a
> >                particular member of the structure.  To display multiple members
> >                of a structure, use a comma-separated list of members.
> > 
> > Can you look into putting support there as well?
> 
> Ok, I will fix it.
> 
> Thanks,
> Alexandr

Great -- and you don't have to bother updating the "help task", "help list" and
"help tree" descriptions.  Let's just get the patch working first, and then I'll
take care of the documentation.

Thanks,
  Dave




More information about the Crash-utility mailing list