Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2004 01:34:08 +0100
From:      Palle Girgensohn <girgen@pingpong.net>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: how find out CPU clockrate?
Message-ID:  <332740000.1073694848@palle.girgensohn.se>
In-Reply-To: <20040109234215.GB3393@dan.emsphone.com>
References:  <300110000.1073689940@palle.girgensohn.se> <20040109234215.GB3393@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
It a sound library, JACK. I dunno, I'll try commenting the code, see what 
happens...

Thank,

/Palle

--On fredag, januari 09, 2004 17.42.15 -0600 Dan Nelson 
<dnelson@allantgroup.com> wrote:

> In the last episode (Jan 10), Palle Girgensohn said:
>> How can I programatically find out the CPU frequency?
>>
>> I'm trying to port a program from Linux, and it uses /proc/cpuinfo.
>>
>> $ cat /compat/linux/proc/cpuinfo
>> cpu MHz         : 349.20
>>
>> Pretty neat, but it does not exist in FreeBSD, and sysctl does not
>> give out this information. Grepping the dmesg.boot seems somewhat odd
>> for a C program:
>>
>> $ dmesg | grep -i hz
>> Timecounter "i8254"  frequency 1193182 Hz
>> CPU: Pentium II/Pentium II Xeon/Celeron (349.20-MHz 686-class CPU)
>>
>> Better ideas?
>
> I think someone suggested that more CPU information be exported via
> sysctl nodes at some point, but no-one has found it important enough to
> code.  Note that on laptops and many ACPI motherboards, you can tweak
> the CPU speed on the fly, so you can't just store the bootup value.
> Other architectures may also allow multiple CPUs at different speeds.
>
> As for your issue, I'd say just comment the code out.  Do you really
> need to know the CPU speed?  Another option is to shell out and run
> cpuid or x86info, but those are x86-only, of course.
>
> --
> 	Dan Nelson
> 	dnelson@allantgroup.com






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