Util-Linux package development
 help / color / mirror / Atom feed
From: Ruediger Meier <sweet_f_a@gmx.de>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org,
	Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Subject: Re: [PATCH 2/2] lscpu: use cpu and revision tag if available
Date: Wed, 16 Mar 2016 11:23:58 +0100	[thread overview]
Message-ID: <201603161123.58299.sweet_f_a@gmx.de> (raw)
In-Reply-To: <20160316093700.dekdnjyx6c2mfs4h@ws.net.home>

On Wednesday 16 March 2016, Karel Zak wrote:
> On Wed, Mar 16, 2016 at 08:57:26AM +0100, Ruediger Meier wrote:
> > > +	if (cpu) {
> > > +		free(desc->modelname);
> > > +		desc->modelname = cpu;
> > > +	}
> > > +	if (revision) {
> > > +		free(desc->model);
> > > +		desc->model = revision;
> > > +	}
> > > +
>
> The problem I see is that Linux kernel does not provide any unified
> abstraction for /proc/cpuinfo, the file is generated individually by
> architecture specific code, so the field names are very arch
> specific. (use "git grep show_cpuinfo" in kernel tree to see more)
>
> For example "revision" is no PPC specific, it's also used by ia64.
> Alpha uses "cpu revision" and "cpu model", etc.

Yes, but the probability is high that the new code will do it better. 
Like in sparc case.

> The ideal solution (for v2.29) would be to have more
> read_cpuinfo_<arch>() functions to hide the differences.
>
> > Watching this again today I think it could be even better to add
> > cpu and revision members to the struct and move both if conditions
> > to the printing code section.
>
> Do you want to send a new version of the patch?

Yep.

      reply	other threads:[~2016-03-16 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 15:31 [PATCH 1/2] Revert "lscpu: keep lscpu usable on snapshots" Ruediger Meier
2016-03-15 15:31 ` [PATCH 2/2] lscpu: use cpu and revision tag if available Ruediger Meier
2016-03-16  5:35   ` Vasant Hegde
2016-03-16  7:57   ` Ruediger Meier
2016-03-16  9:37     ` Karel Zak
2016-03-16 10:23       ` Ruediger Meier [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=201603161123.58299.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