From owner-cvs-src@FreeBSD.ORG Fri Apr 11 00:01:53 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 891FF37B401; Fri, 11 Apr 2003 00:01:53 -0700 (PDT) Received: from smtp-relay.omnis.com (smtp-relay.omnis.com [216.239.128.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD43243FAF; Fri, 11 Apr 2003 00:01:52 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from softweyr.homeunix.net (66-91-236-204.san.rr.com [66.91.236.204]) by smtp-relay.omnis.com (Postfix) with ESMTP id 89C1443410; Fri, 11 Apr 2003 00:01:51 -0700 (PDT) From: Wes Peters Organization: Softweyr To: Bruce Evans , Wes Peters Date: Fri, 11 Apr 2003 00:01:50 -0700 User-Agent: KMail/1.5 References: <200304100705.h3A75OVW019701@repoman.freebsd.org> <20030410204421.A3151@gamplex.bde.org> In-Reply-To: <20030410204421.A3151@gamplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200304110001.50201.wes@softweyr.com> cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/i386 identcpu.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2003 07:01:53 -0000 On Thursday 10 April 2003 04:20, Bruce Evans wrote: > On Thu, 10 Apr 2003, Wes Peters wrote: > > wes 2003/04/10 00:05:24 PDT > > > > FreeBSD src repository > > > > Modified files: > > sys/i386/i386 identcpu.c > > Log: > > Add a sysctl that records and reports the CPU clock rate calculated > > at boot. Funny how often this trivial piece of information crops > > up in embedded boxen. > > > > Sponsored by: St. Bernard Software > > > > Revision Changes Path > > 1.121 +6 -0 src/sys/i386/i386/identcpu.c > > What's wrong with the existing sysctl (machdep.tsc_freq)? It is > machine dependent, but no more than the new sysctl (both only work for > certain i386's with TSC's). This control works across all "i386" processors you can buy today, and will also work across several other FreeBSD architectures as soon as I get my hands on the boxen required. The sparc64 is on its way; ia64 and x86-64 will follow later. Maybe much later. > It doesn't discard up to 6 digits of > precision. It reports the current frequency, which should be the actual > frequency, which should differ from the frequency determined at boot > time since it is difficult to determine the actual frequency at boot > time without making the boot too long. My need, now spanning 3 different companies and product lines, is more to determine a few broad classifications of hardware. If the numbers differ by more than 10, that would suffice, but in practice the expected numbers are 400, 550, 1130 (or maybe 1260) and 2400. Those are far enough apart to make even imprecise people like me believe I can tell the difference. I am well aware that the boot-time numbers on some hardware might differ wildly from the run-time numbers; my laptop boots at 75 MHz and switches up to 300 MHz as needed. That's not an issue in any of the 3 implementations that have asked for this. > Apr 9 20:08:28 besplex kernel: Timecounter "TSC" frequency 1532823868 > Hz Apr 9 20:08:28 besplex kernel: CPU: AMD Athlon(TM) XP1600+ > (1532.82-MHz 686-class CPU) > > The first line of this is only printed if the TSC is attached to a > timecounter, which is in most !SMP && !APM cases. The second line > prints the value that is returned by the new sysctl, except it doesn't > return the fractional part and has rounding bugs. And yet still suffices for the each of the different teams who have asked for it. A more complex, more accurate answer isn't better for their need, it's just more complex. -- Where am I, and what am I doing in this handbasket? Wes Peters wes@softweyr.com