# of processors
Robin Battey
zanfur at zanfur.com
Mon Jan 20 20:42:11 PST 2003
Don't quote me on this, as it's been a while since I've looked at
/proc/cpuinfo on a dual proc system, but I believe that there is a blank
line between processor listings, and at the end (making it one per
processor). Perhaps counting those would be more universal.
On another note: different architectures have different handlers for the
/proc/cpuinfo hook. The differences can be found in the function
get_cpuinfo in the file linux/arch/<whatever>/kernel/setup.c, which is
what handles the output of a read on /proc/cpuinfo. There is really no
reason for these to be similar across architectures, nothing really relies
on them except for us humans.
Cheers!
-robin
P.S. my output, just to add to the merriness (yeah, it's an old box):
[zanfur at sephiroth zanfur]$ more /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 4
model : 3
model name : 486 DX/2
stepping : 5
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme
bogomips : 33.17
[zanfur at sephiroth zanfur]$
On Mon, Jan 20, 2003 at 06:23:27PM -0800, Kolbe Kegel wrote:
> I'm very interested to know why your output is so different from mine.
> Perhaps it has to do simply with the fact that you're using ppc instead
> of x86. My system has many more fields than does yours, and in fact the
> only field in common is "bogomips". Attempting to grep ^cpu on my
> machine would match "cpu MHz", "cpu family", and "cpuid level" for a
> count of 3. That is clearly not the result that we're looking for! This
> is quite an interesting discrepancy actually, you would think that there
> would be some attempt at standardization of this information. It's also
> interesting that your cpuinfo includes information on the motherboard
> and the amount of RAM in your machine. Those things seem almost
> completely unrelated to "cpu info".
>
> processor : 0
> vendor_id : AuthenticAMD
> cpu family : 6
> model : 4
> model name : AMD Athlon(tm) Processor
> stepping : 2
> cpu MHz : 706.289
> cache size : 256 KB
> fdiv_bug : no
> hlt_bug : no
> f00f_bug : no
> coma_bug : no
> fpu : yes
> fpu_exception : yes
> cpuid level : 1
> wp : yes
> flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca
> cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow
> bogomips : 1388.54
>
>
> Phillip Garland escribió::
>
> >cat /proc/cpuinfo gives:
> >
> >cpu : 740/750
> >temperature : 53-57 C (uncalibrated)
> >clock : 233MHz
> >revision : 2.2 (pvr 0008 0202)
> >bogomips : 465.30
> >machine : iMac,1
> >motherboard : iMac MacRISC Power Macintosh
> >L2 cache : 512K unified
> >memory : 96MB
> >pmac-generation : NewWorld
> >
> >so I'm guessing the equivalent command is:
> >
> >cat /proc/cpuinfo | egrep ^cpu | wc -l
> >
> >which gives "1", as it should. I don't have a MP box or the kernel source around right now, so I don't for sure that this is correct. Ideally there should be a way to do this that is portable across architectures and recent kernel versions, but don't know what it is.
> >
> >~Phillip
> >
> >On Mon, 20 Jan 2003, Kolbe Kegel wrote:
> >
> >
> >
> >>well what does the output of 'cat /proc/cpuinfo' look like?
> >>
> >>and that's not ancient... if it works and you don't need the latest,
> >>latest feature, why upgrade? people are still using 2.2! (i use it on my
> >>router.)
> >>
> >>--kolbe
> >>
> >>Phillip Garland escribió::
> >>
> >>
> >>
> >>>This seems not to work across all architectures or kernel versions. On my ppc box running Linux 2.4.16 (Yes, I know it's ancient, but it's worked better for me than more recent kernels), this gives 0.
> >>>
> >>>~Phillip
> >>>
> >>>
> >>>On Mon, 20 Jan 2003, J. Hughes wrote:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>This should do the job:
> >>>>
> >>>>cat /proc/cpuinfo | egrep ^processor | wc -l
> >>>>
> >>>>On Mon, 20 Jan 2003, Scholz Matthew wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>Let us just say that I need to know how many
> >>>>>processors a linux machine has using. Let us also say
> >>>>>that I'm not sure exactly how to retrieve said
> >>>>>information.
> >>>>>
> >>>>>Let us add for the sake of argument, that I would like
> >>>>>a single command line argument which returns some
> >>>>>useful sembalance of aforementioned processorial
> >>>>>quantity.
> >>>>>
> >>>>>Is there such a beast?
> >>>>>
> >>>>>Thanx
> >>>>>
> >>>>>__________________________________________________
> >>>>>Do you Yahoo!?
> >>>>>Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> >>>>>http://mailplus.yahoo.com
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
> >
> >
--
Robin Battey
90CF 2E8F 8A96 D0C0 09A2 9CFE C130 6CD4 6DC3 6DCF
http://www.zanfur.com/zanfur.pub
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
Url : http://mailman1.u.washington.edu/pipermail/linux/attachments/20030120/36679dae/attachment.bin
More information about the Linux
mailing list