Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Jon Stanley <jonstanley@gmail.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>, util-linux@vger.kernel.org
Subject: Re: [PATCH] lscpu: add support for books
Date: Wed, 27 Jul 2011 23:35:54 +0200	[thread overview]
Message-ID: <20110727213554.GB9588@nb.net.home> (raw)
In-Reply-To: <20110718222130.GF4354@nb.redhat.com>

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@redhat.com> 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@redhat.com>
 http://karelzak.blogspot.com

      reply	other threads:[~2011-07-27 21:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 11:29 [PATCH] lscpu: add support for books Heiko Carstens
2011-07-11 10:40 ` Karel Zak
2011-07-13  3:46   ` Heiko Carstens
2011-07-18  9:10     ` Karel Zak
2011-07-18 15:17       ` Jon Stanley
2011-07-18 22:21         ` Karel Zak
2011-07-27 21:35           ` Karel Zak [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110727213554.GB9588@nb.net.home \
    --to=kzak@redhat.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jonstanley@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox