Re: powerd

From: Dag-Erling Smørgrav <des_at_des.no>
Date: Wed, 07 Dec 2005 00:34:00 +0100
des_at_des.no (Dag-Erling Smørgrav) 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
-- 
Dag-Erling Smørgrav - des_at_des.no
Received on Tue Dec 06 2005 - 22:34:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:48 UTC