From owner-freebsd-acpi@FreeBSD.ORG Fri Jun 18 17:24:24 2004 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E015A16A4CE for ; Fri, 18 Jun 2004 17:24:24 +0000 (GMT) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 542EA43D41 for ; Fri, 18 Jun 2004 17:24:24 +0000 (GMT) (envelope-from nate@root.org) Received: (qmail 49814 invoked by uid 1000); 18 Jun 2004 17:24:24 -0000 Date: Fri, 18 Jun 2004 10:24:24 -0700 (PDT) From: Nate Lawson To: YONETANI Tomokazu In-Reply-To: <20040618052615.GA48947@les.ath.cx> Message-ID: <20040618102336.K49727@root.org> References: <20040616131055.GA37637@les.ath.cx> <20040618052615.GA48947@les.ath.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-acpi@freebsd.org Subject: Re: cx_usage X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2004 17:24:25 -0000 On Fri, 18 Jun 2004, YONETANI Tomokazu wrote: > On Wed, Jun 16, 2004 at 10:10:55PM +0900, YONETANI Tomokazu wrote: > > What do you think about the following changes? > > > > - print 100% instead of 99% when there's only 1 Cx state, and 0% > > when the sum is zero. > > - two digits from fractional part of each percentage are shown; > > my Laptop PC barely enters into C3 state and hw.acpi.cpu.cx_usage > > is almost always "0% 99% 0%" after revision 1.39. it's now shown as > > "0.00% 99.96% 0.03%" > > Actually, cpu_cx_stats[i] * 100 may not fit in u_int and would print > incorrect value as values grow. Please try this instead. I plan to commit some version of this patch. There are some problems with the logic for sum == 0. -Nate