[Crash-utility] [PATCH 0/3] Add a "percpu" command

Dave Anderson anderson at redhat.com
Wed Oct 16 13:55:03 UTC 2013



----- Original Message -----
> On Tue, 15 Oct 2013 14:20:08 -0400 (EDT)
> Dave Anderson <anderson at redhat.com> wrote:
> 
> > ----- Original Message -----
> > > On Sat, 12 Oct 2013 21:41:49 +0200
> > > Petr Tesarik <ptesarik at suse.cz> wrote:
> > > 
> > > >[...]
> > > > In general, I think it's a matter of taste, and if you dislike new
> > > > commands, it all boils down to finding a suitable syntax to extend the
> > > > existing commands. Unfortunately, "-c" (as CPU) is already taken for
> > > > count, and "-p" (as processor) is already taken for pointer
> > > > dereference. :-(
> > > > 
> > > > I can think of:
> > > > 
> > > > A. "-C" (but it requires a shift key, and two options that only
> > > >    differ in case may be confusing)
> > > > B. any other random letter ("-a" is free).
> > > 
> > > Hm, it seems this is the only blocking piece. If nobody has an idea
> > > until tomorrow, I'll just pick '-C', even though I hate both the shift
> > > key and the fact that another command ('irq') uses a different option
> > > ('-c') for the same concept.
> > 
> > I agree with you on both counts.
> > 
> > I haven't had the chance to reply to your second response (I took the
> > holiday
> > off yesterday), but I think a suitable compromise would be to change the
> > "struct/union/* -c count" option to perhaps a "-n number" option?
> > 
> > Another other option that crossed my mind would be to have a unique manner
> > for presenting per-cpu addresses and cpu(s) as a command argument.  They
> > are
> > offset values, but they could be confused for zero-based kernel virtual
> > address
> > arches (s390/s390x), so there would need to be a option to differentiate
> > zero-based kernel virtual addresses, and then a second option of the cpu
> > specifier.
> 
> FYI I went through the same exercise...
> 
> > But anyway, maybe per-cpu addresses could be made to be "self-identified"
> > if they were presented as "<offset>:<cpu-identifer>", where the colon would
> > define the argument as a per-cpu item, and the <cpu-identifier> part could
> > be
> > one of the following:
> > 
> >   offset:               nothing following the colon means the current cpu
> >   offset:a              all cpus
> >   offset:cpu-specifier  same as your patch or the irq command
> 
> This is genius! I really love this syntax and I'm working on the patch
> already.

How about the somewhat similar usage for "p", where the self-identified object
could also contain a per-cpu symbol:

  <per-cpu symbol>:<cpu-identifier>

Then we could do something like:

  crash> p <per-cpu symbol>

which would continue to output the type and addresses as it does now,
but then alternatively you could:

  crash> p <per-cpu symbol>:<cpu_identifier>

which would just print the datatype contents for the cpus specified?

Dave


 




More information about the Crash-utility mailing list