/proc/stat on SMP machine

Mikael Abrahamsson (swmike@uplift.sparta.lu.se)
Sat, 5 Apr 1997 13:01:42 +0200 (MET DST)


Looks to me like /proc/stat doesnt reflect the status of each CPU on a
multiprocessor machine. What does it measure? Average of both? Just the
first one?

Background to my question is that there are these nifty little programs
that'll display cpu status etc on LEDs you have connected to the parallell
port. Would be nice to be able to monitor as each processor works...

I looked in fs/proc/array.c where it looks like the /proc/stat file is
generated, but it only gets something called kstat.whatever, but I am not
experienced enough to find out where this data comes from.

uniprocessor machine:

cpu 81711 30419 29674 364681
disk 51292 1624 2375 1
disk_rio 20373 803 1705 1
disk_wio 30919 821 670 0
disk_rblk 40752 6400 10886 2
disk_wblk 61838 6568 4784 0
page 149856 149930
swap 3 0
intr 781746 506485 17954 0 6 33253 4336 2 0 0 246 0 139250 56288 1 23368
557
ctxt 762103
btime 860232265
processes 12651

multiprocessor machine:

cpu 2601887 135875 6125497 17018238
disk 1609104 5307163 0 0
disk_rio 675384 1795399 0 0
disk_wio 933720 3511764 0 0
disk_rblk 1350780 3590810 0 0
disk_wblk 1867440 7023528 0 0
page 7006707 9239216
swap 4 0
intr 125473032 25881497 127708 0 0 0 1008552 663 0 0 79757069 0 0 1450944
10345731 0 6900868
ctxt 85511101
btime 859978545
processes 874470

processor : 0
cpu : 686
model : Pentium Pro
vendor_id : GenuineIntel
stepping : 7
fdiv_bug : no
hlt_bug : no
fpu : yes
fpu_exception : yes
cpuid : yes
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic 11 mtrr pge mca
cmov
bogomips : 198.66

processor : 1
cpu : 686
model : Pentium Pro
vendor_id : GenuineIntel
stepping : 7
fdiv_bug : no
hlt_bug : no
fpu : yes
fpu_exception : yes
cpuid : yes
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic 11 mtrr pge mca
cmov
bogomips : 198.66

-----
Mikael Abrahamsson email: swmike@df.lth.se