/proc/cpuinfo is the way to go - here's part of the last entry on my server:
Code:
processor : 15
vendor_id : GenuineIntel
cpu family : 6
model : 46
model name : Intel(R) Xeon(R) CPU E7520 @ 1.87GHz
stepping : 6
cpu MHz : 1862.049
cache size : 18432 KB
physical id : 1
siblings : 8
core id : 10
cpu cores : 4
Since these are quad-core processors and I have 16 processors defined, you would think I have 4 chips. But no. Each core is hyperthreaded and counts as 2, so the right thing to look at is "siblings". I have 16 processors / 8 siblings = 2 chips.
Note: so to count them up:
if siblings = S, then each processor = 1/S chips
else if cores = C, then each processor = 1/C chips
else each processor = 1 chip