For procps-ng-4.0.01: No `core id' in e.g. aarch65 or ppc64le /proc/cpuinfo

"Dr. Werner Fink" <[email protected]> Mon, 24 Oct 2022 14:26:54 +0200
Newsgroups gmane.linux.procps.devel
Message-ID <[email protected]>
Hi,

vmstat fails due an assumption that the tag `core id' is common in
/proc/cpuinfo ... but it is not ...

on aarch64 I see

 processor       : 0
 BogoMIPS        : 50.00
 Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
 CPU implementer : 0x41
 CPU architecture: 8
 CPU variant     : 0x3
 CPU part        : 0xd0c
 CPU revision    : 1

 [...]

 processor       : 79
 BogoMIPS        : 50.00
 Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
 CPU implementer : 0x41
 CPU architecture: 8
 CPU variant     : 0x3
 CPU part        : 0xd0c
 CPU revision    : 1

and on ppc64le I see

 processor       : 0
 cpu             : POWER9 (architected), altivec supported
 clock           : 3000.000000MHz
 revision        : 2.2 (pvr 004e 0202)

 [...]

 processor       : 7
 cpu             : POWER9 (architected), altivec supported
 clock           : 3000.000000MHz
 revision        : 2.2 (pvr 004e 0202)

 timebase        : 512000000
 platform        : pSeries
 model           : IBM,9008-22L
 machine         : CHRP IBM,9008-22L
 MMU             : Hash

that is on `processor' is valid.  Therefore stat_cores_verify()
does fail

 openat(AT_FDCWD, "/proc/cpuinfo", O_RDONLY) = 4
 newfstatat(4, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0
 read(4, "processor\t: 0\nBogoMIPS\t: 50.00\nF"..., 1024) = 1024
 read(4, "rm aes pmull sha1 sha2 crc32 ato"..., 1024) = 1024
 read(4, "asimdrdm lrcpc dcpop asimddp ssb"..., 1024) = 1024
 read(4, "x41\nCPU architecture: 8\nCPU vari"..., 1024) = 1024
 read(4, " 0xd0c\nCPU revision\t: 1\n\nprocess"..., 1024) = 1024
 read(4, "0.00\nFeatures\t: fp asimd evtstrm"..., 1024) = 1024
 read(4, " crc32 atomics fphp asimdhp cpui"..., 1024) = 1024
 read(4, "op asimddp ssbs\nCPU implementer\t"..., 1024) = 1024
 read(4, "ure: 8\nCPU variant\t: 0x3\nCPU par"..., 1024) = 1024
 read(4, "on\t: 1\n\nprocessor\t: 38\nBogoMIPS\t"..., 1024) = 1024
 read(4, "p asimd evtstrm aes pmull sha1 s"..., 1024) = 1024
 read(4, "hp asimdhp cpuid asimdrdm lrcpc "..., 1024) = 1024
 read(4, "PU implementer\t: 0x41\nCPU archit"..., 1024) = 1024
 read(4, "t\t: 0x3\nCPU part\t: 0xd0c\nCPU rev"..., 1024) = 1024
 read(4, "\t: 59\nBogoMIPS\t: 50.00\nFeatures\t"..., 1024) = 1024
 read(4, "es pmull sha1 sha2 crc32 atomics"..., 1024) = 1024
 read(4, "asimdrdm lrcpc dcpop asimddp ssb"..., 1024) = 1024
 read(4, "0x41\nCPU architecture: 8\nCPU var"..., 1024) = 1024
 read(4, ": 0xd0c\nCPU revision\t: 1\n\nproces"..., 1024) = 998
 read(4, "", 1024)                       = 0
 close(4)                                = 0
 write(2, "vmstat: ", 8vmstat: )                 = 8
 write(2, "Unable to create system stat str"..., 38Unable to create system stat structure) = 38
 write(2, "\n", 1
 )                       = 1
 close(1)                                = 0
 close(2)                                = 0
 exit_group(1)                           = ?


Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr
signature.asc (application/pgp-signature, 894 B)
-----BEGIN PGP SIGNATURE-----

iQJgBAABCABKFiEEGwa/WjgpkPvLonW+UOkNVR3Bay4FAmNWhIksFIAAAAAAFQAO
cGthLWFkZHJlc3NAZ251cGcub3Jnd2VybmVyQHN1c2UuZGUACgkQUOkNVR3Bay6N
/w/+Ng0kt9tJg2jEIMvpV3ucMMSuOixBfmzf8XGHkSLHbYofUOGp981oa1CFC8p1
18hYqFLfkItg1FuYw0CIslquURj4yB5+HY4LKI7dCDgDAlF8cb234xpCWUIXoZid
Qu5sVAFhJd8Sd/tdiMiVnzePn84F/EGCoJyKSsD1rjOMAW+cvMPtZPz2y5+mQzxR
AZN2ll5gExcIxt//pR3YQKeFx1YYxZOPsZkg5lDKAG8Uh9NDXcG5jzwGm1JAhydo
Qov0s739hJ0FOEDsDIlbfWmbK0dhixoHr7LKzFg/pDu6R06v3TKn3IISRjZaKidp
m1Uf/ilqq6JZac9RlonmsnyTNtbNx3VxMS8iqmWl0KbOyqLWJK8JAbeTZ/brzgxT
hNRZK56UkyMgu4MZ8GxRZHXIOvhN0gWoqu1u35boLLXRQD/J+Jfk38haom2CWb9X
uVSZVhkJO5Q5rG5DcWwWFG6jGyXmj4z6m6pZdvi/aDFpaBn7AJ8b5Re7jwD2cGEm
Z426BKoxaOF6M/iK6THtd4YmJP+LB9ZM2CCta06vj7371QdIcvXhl723SBCAMKfO
GZZpAP4omK3NB2g/x4NVjZ/Veq3dXTo9lAI+nk3/QdJBDJNlX35ZK/uMfnJj4BHA
PSkXOiwySItthMAaxPviamMM3bfOuHqlepUusTc26mYrI0E=
=lfBj
-----END PGP SIGNATURE-----