]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: add aarch64 specific names
authorKarel Zak <kzak@redhat.com>
Mon, 9 Jan 2017 12:01:39 +0000 (13:01 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 9 Jan 2017 12:04:41 +0000 (13:04 +0100)
It seems that aarch64 uses a different names for some /proc/cpuinfo
fields (e.g. intel: bogomips, flags, and aarch64: BogoMIPS, features, ...)

Addresses: https://github.com/karelzak/util-linux/issues/392
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu.c
tests/expected/lscpu/lscpu-armv7

index df561ac7f1ea4526aeec5f8a53b0362f05f543b4..94cc00cf6e9027ee192734fbab516014a8c78d09 100644 (file)
@@ -562,11 +562,14 @@ read_basicinfo(struct lscpu_desc *desc, struct lscpu_modifier *mod)
                else if (lookup(buf, "cpu MHz static", &desc->static_mhz)) ;   /* s390 */
                else if (lookup(buf, "flags", &desc->flags)) ;          /* x86 */
                else if (lookup(buf, "features", &desc->flags)) ;       /* s390 */
+               else if (lookup(buf, "Features", &desc->flags)) ;       /* aarch64 */
                else if (lookup(buf, "type", &desc->flags)) ;           /* sparc64 */
                else if (lookup(buf, "bogomips", &desc->bogomips)) ;
+               else if (lookup(buf, "BogoMIPS", &desc->bogomips)) ;    /* aarch64 */
                else if (lookup(buf, "bogomips per cpu", &desc->bogomips)) ; /* s390 */
                else if (lookup(buf, "cpu", &desc->cpu)) ;
                else if (lookup(buf, "revision", &desc->revision)) ;
+               else if (lookup(buf, "CPU revision", &desc->revision)) ; /* aarch64 */
                else if (lookup(buf, "max thread id", &desc->mtid)) ; /* s390 */
                else if (lookup_cache(buf, desc)) ;
                else
index 050578df5c0eb3f527d22f0fbbe00fce674f5c30..6f7db2b6b8332b10bcdf3e5e64881835464cf771 100644 (file)
@@ -3,8 +3,11 @@ On-line CPU(s) list:   0,1
 Thread(s) per core:    1
 Core(s) per socket:    2
 Socket(s):             1
+Model:                 4
 CPU max MHz:           1700.0000
 CPU min MHz:           200.0000
+BogoMIPS:              1694.10
+Flags:                 swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt
 
 # The following is the parsable format, which can be fed to other
 # programs. Each different item in every column has an unique ID