Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jan 2002 11:33:51 -0800
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        hackers@freebsd.org
Subject:   cpu info in userland
Message-ID:  <20020122113351.A25927@Odin.AC.HMC.Edu>

next in thread | raw e-mail | index | archive | help

--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I'm working on a port of Globus to FreeBSD and some of the monitoring
tools want to publish info about each CPU in the system.  On the i386
the most info I need is generally found at the top of dmesg:

CPU: Pentium III/Pentium III Xeon/Celeron (996.85-MHz 686-class CPU)
  Origin =3D "GenuineIntel"  Id =3D 0x686  Stepping =3D 6
  Features=3D0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE=
,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>

I'm trying to figure out how to get it from userland (in a shell script).
I've looked at the cpuid port which seems to do most of it, but it
doesn't display clock speed, only works on IA32 cpus, and won't be
accurate if we have mismatched CPUs.[0]

Linux displays this information in /proc/cpuinfo though there's no
consistancy between platforms (at least alpha and i386 seem to have
nothing in common.)  Is there something similar I'm missing or is this a
missing feature?

-- Brooks

[0] I seem to recall seeing someone post a dmesg with an SMP system with
differently clocked CPUs in it so this is a potential concern.

--=20
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

--d6Gm4EdcadzBjdND
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8Tb6fXY6L6fI4GtQRAsYOAJ9ubLEfgzPCKqG/MiOHJphVI5ik8gCgzQzo
VC6FHXQogm7GFJpyQ6EH1Yo=
=9syj
-----END PGP SIGNATURE-----

--d6Gm4EdcadzBjdND--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020122113351.A25927>