From owner-freebsd-questions@FreeBSD.ORG Fri Jan 9 16:34:14 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BC7B16A4D0 for ; Fri, 9 Jan 2004 16:34:14 -0800 (PST) Received: from amsfep15-int.chello.nl (amsfep15-int.chello.nl [213.46.243.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id A2D3F43D39 for ; Fri, 9 Jan 2004 16:34:12 -0800 (PST) (envelope-from girgen@pingpong.net) Received: from palle.girgensohn.se ([213.89.138.245]) by amsfep15-int.chello.nlESMTP <20040110003410.PGIY3882.amsfep15-int.chello.nl@palle.girgensohn.se>; Sat, 10 Jan 2004 01:34:10 +0100 Received: from localhost (localhost [127.0.0.1]) by palle.girgensohn.se (8.12.9p2/8.12.9) with ESMTP id i0A0Y8kC018618; Sat, 10 Jan 2004 01:34:09 +0100 (CET) (envelope-from girgen@pingpong.net) Date: Sat, 10 Jan 2004 01:34:08 +0100 From: Palle Girgensohn To: Dan Nelson 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> X-Mailer: Mulberry/3.1.0 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline cc: freebsd-questions@freebsd.org Subject: Re: how find out CPU clockrate? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jan 2004 00:34:14 -0000 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 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