PSA: If you're reading and parsing /proc/cpuinfo for anything, you should probably stop.
The CPU information you're probably looking for is available in structured form in /sys/devices/system/cpu, no horrible text parsing required. And unlike /proc/cpuinfo, the /sys hierarchy is standardized across architectures (as much as is practical). In particular, you will not find CPU topology info in /proc/cpuinfo on non-x86 architectures.
Signed, ARM64 users who keep seeing things like "1 cpu, 1 core, 8 threads" in software written by x86 users (I'm looking at you, GeekBench).
https://social.treehouse.systems/@marcan/113548772069263164
@marcan FYI @serebit
@marcan and if all you need is to know how many threads to spawn to scale on cores:
sysconf(_SC_NPROCESSORS_CONF); /* processors configured */
sysconf(_SC_NPROCESSORS_ONLN); /* […]
@marcan When all you need is quick grep through "cpu features" flags then `/proc/cpuinfo` gives you readable names.
`/sys/devices/system/cpu/modalias` gives you hex codes for which you need to […]
────