I’m trying to get hold of CPU architecture information under Linux.
I understand the information is available via the sysfs filesystem.
I have CentOS 5 running in a Xen VM. The sysfs filesystem is mounted. However, the /sys/devices/system/cpu/cpu0/ directory is almost empty. The only entry is a single file, “online”, with a value of “1”.
What gives? where’s all my CPU information?
Okay, I’ve just had a chat with a sysadmin at work.
Looking at some machines, it looks like this information simply is not pushed by VMs. The VMs think they have a virtual CPU – rather than a CPU of the type of the real underlying CPU – and the cache information simply is not published.
It is published (and it’s nice to finally see it!) on real machines with reasonably modern kernels.