Re: [PATCH 2/2] lscpu: use cpu and revision tag if available

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

 



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.

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?

    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