Re: [PATCH] lscpu: add support for books

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 19, 2011 at 12:21:30AM +0200, Karel Zak wrote:
> On Mon, Jul 18, 2011 at 11:17:24AM -0400, Jon Stanley wrote:
> > On Mon, Jul 18, 2011 at 5:10 AM, Karel Zak <kzak@xxxxxxxxxx> wrote:
> > 
> > >  I'm not sure if the currently used extra separators (,,) for the
> > >  caches is a good idea. Maybe it would be better to force people to
> > >  parse the last comment line where is the header for the columns.
> > 
> > Speaking as a user of lscpu, I think that forcing people to parse the
> > last comment line is not a particularly good idea - no one is used to
> > doing it, and I'm not sure of any other utility that forces you to
> > parse it's "machine-readable" output. Stability of this format is key.
> 
>  Yes, -p sucks ;-)
> 
> > >  The ideal solution is to extend the "-p" functionality and allow to
> > >  specify expected columns at command line, something like:
> > >
> > >    lscpu -p -o cpu,core,book,socket
> > 
> > I think that this is the only long-term supportable way to do this.
> > CPU architectures (even in the x86 world that I'm interested in) ARE
> > going to change and evolve. Heck, it's even possible that concepts
> > like the hypervisor scheduling parameters that you mentioned on s390
> > could eventually make their way down to x86 virtualization, and
> > exposing stuff like that in lscpu would be nice.
> 
>  I'll try to add this functionality in next days.

Implemented.

The command "lscpu -p" without any other argument is backwardly
compatible and does not include Books in the output, for example:

  $ lscpu -p
  # CPU,Core,Socket,Node,,L1d,L1i,L2
  0,0,0,0,,0,0,0
  1,1,0,0,,1,1,0

The command "lscpu -p=<columns>" prints always all requested 
columns in the defined order. The caches are separated by ':', for
example:

  $ lscpu -p=CPU,NODE,CACHE
  # CPU,Node,L1d:L1i:L2
  0,0,0:0:0
  1,0,1:1:0

  $ lscpu -p=CPU,NODE,CACHE,BOOK,SOCKET
  # CPU,Node,L1d:L1i:L2,Book,Socket
  0,0,0:0:0,,0
  1,0,1:1:0,,0

(yeah, no Books on my ThinkPad :-)

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux