From owner-freebsd-current@FreeBSD.ORG Tue Dec 6 23:34:14 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6711116A420; Tue, 6 Dec 2005 23:34:14 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DC9143D72; Tue, 6 Dec 2005 23:34:08 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id CF3F42086; Wed, 7 Dec 2005 00:34:00 +0100 (CET) X-Spam-Tests: AWL,BAYES_00,FORGED_RCVD_HELO X-Spam-Learn: ham X-Spam-Score: -3.3/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id BE39C2085; Wed, 7 Dec 2005 00:34:00 +0100 (CET) Received: by xps.des.no (Postfix, from userid 1001) id 9B59F33C1D; Wed, 7 Dec 2005 00:34:00 +0100 (CET) To: Nate Lawson References: <43938F61.1050202@terranova.net> <4393F60E.2040106@shapeshifter.se> <86mzjflc97.fsf@xps.des.no> <439495B1.5060305@shapeshifter.se> <861x0qmuen.fsf@xps.des.no> <43956ADF.4050504@shapeshifter.se> <86slt6lb9s.fsf@xps.des.no> <4395A265.8080006@root.org> <86d5k9eric.fsf@xps.des.no> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Wed, 07 Dec 2005 00:34:00 +0100 In-Reply-To: <86d5k9eric.fsf@xps.des.no> (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav's?= message of "Wed, 07 Dec 2005 00:26:51 +0100") Message-ID: <868xuxer6f.fsf@xps.des.no> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: njl@freebsd.org, Fredrik Lindberg , Travis Mikalson , current@freebsd.org Subject: Re: powerd X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2005 23:34:14 -0000 des@des.no (Dag-Erling Sm=F8rgrav) writes: > powerd is a mess, BTW. I've tried to fix the most blatant mistakes > (poor understanding of signal handling), but it basically needs a > rewrite. The signal handling code can probably be removed entirely. Its only purpose is to catch SIGINT / SIGTERM so powerd can print some stats before exiting, but said stats are meaningless because: a) they assume that the main loop runs once every poll_interval, when in fact the time between two successive iterations can range from microseconds (interrupted usleep() / select()) to hours or even days (suspended laptop). b) even assuming that a) does not apply and that ACPI provides accurate values, it still only reports power consumed by the CPU, not by peripherals or the LCD backlight. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no