Util-Linux package development
 help / color / mirror / Atom feed
From: Ruediger Meier <sweet_f_a@gmx.de>
To: Karel Zak <kzak@redhat.com>
Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>,
	util-linux@vger.kernel.org
Subject: Re: [PATCH] lscpu: Fix model and model name on Power Systems
Date: Tue, 15 Mar 2016 16:29:29 +0100	[thread overview]
Message-ID: <201603151629.30154.sweet_f_a@gmx.de> (raw)
In-Reply-To: <20160315134941.atrpxt45iua6bq7b@ws.net.home>

On Tuesday 15 March 2016, Karel Zak wrote:
> On Tue, Mar 15, 2016 at 09:33:31AM +0100, Ruediger Meier wrote:
> > > diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
> > > index fc32762..423bc56 100644
> > > --- a/sys-utils/lscpu.c
> > > +++ b/sys-utils/lscpu.c
> > > @@ -465,8 +465,13 @@ read_basicinfo(struct lscpu_desc *desc,
> > > struct lscpu_modifier *mod) else if (lookup(buf, "vendor_id",
> > > &desc->vendor)) ;
> > >  		else if (lookup(buf, "family", &desc->family)) ;
> > >  		else if (lookup(buf, "cpu family", &desc->family)) ;
> > > +#if defined(__powerpc__) || defined(__powerpc64__)
> > > +		else if (lookup(buf, "revision", &desc->model)) ;
> > > +		else if (lookup(buf, "cpu", &desc->modelname)) ;
> > > +#else
> > >  		else if (lookup(buf, "model", &desc->model)) ;
> > >  		else if (lookup(buf, "model name", &desc->modelname)) ;
> > > +#endif
> > >  		else if (lookup(buf, "stepping", &desc->stepping)) ;
> > >  		else if (lookup(buf, "cpu MHz", &desc->mhz)) ;
> > >  		else if (lookup(buf, "flags", &desc->flags)) ;		/* x86 */
> >
> > Would it be possible to decide on runtime what to do, ideally
> > looking into /proc or /sys to see whether it's a powerpc? This
> > ifdef does not work with lscpu --sysroot.
>
>  I have reverted the patch for --sysroot, so the #ifdef is applied to
>  live systems only (please, test it). Not elegant, but better than
>  nothing.

I have another idea, just use revision and cpu if available. I'll send a 
patch.


  reply	other threads:[~2016-03-15 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14 14:48 [PATCH] lscpu: Fix model and model name on Power Systems Vasant Hegde
2016-03-14 15:19 ` Karel Zak
2016-03-14 15:20   ` Vasant Hegde
2016-03-15  8:33 ` Ruediger Meier
2016-03-15 13:49   ` Karel Zak
2016-03-15 15:29     ` Ruediger Meier [this message]
2016-03-16  5:36     ` Vasant Hegde

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=201603151629.30154.sweet_f_a@gmx.de \
    --to=sweet_f_a@gmx.de \
    --cc=hegdevasant@linux.vnet.ibm.com \
    --cc=kzak@redhat.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