powerd

Dag-Erling Smørgrav des at des.no
Tue Dec 6 15:34:14 PST 2005


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



More information about the freebsd-current mailing list