Skip to contentSkip to conversation

reading battery status and CPU time

DISCUSSION Jan Rychter 2 participants 2 messages Apr 4, 2003 – Apr 10, 2003 1 message not in the archive ACPI

lore
Share & tools
lore
#0 lore raw

FYI: reading battery status still consumes lots of CPU time. Unless it's supposed to be that way?

time cat /proc/acpi/battery/BAT0/state produces:

0.000u 0.040s 0:00.12 33.3%     0+0k 0+0io 108pf+0w
0.000u 0.040s 0:00.13 30.7%     0+0k 0+0io 108pf+0w
0.000u 0.030s 0:00.12 25.0%     0+0k 0+0io 108pf+0w
0.000u 0.030s 0:00.14 21.4%     0+0k 0+0io 108pf+0w
0.000u 0.050s 0:00.14 35.7%     0+0k 0+0io 108pf+0w
0.000u 0.030s 0:00.14 21.4%     0+0k 0+0io 108pf+0w

... which causes applications like wmacpi to consume tens of seconds of CPU time after a while. Not really a price I'd be willing to pay for knowing the battery status.

This is on 2.4.21-pre6 with acpi-20030328. Sharp Mebius PC-MT1-H3.

--J.

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/

#2 lore raw
In reply to a message not in the archive
Quoted 3 lines · Jan Rychter

FYI: reading battery status still consumes lots of CPU time. Unless it's supposed to be that way?
This is on 2.4.21-pre6 with acpi-20030328. Sharp Mebius PC-MT1-H3.

I have the same on a Sony Vaio FX405 (0.11 sec for one "cat state"). I just disassembled and recompiled my DSDT and put some debug output there.
Very interesting: _BIF gets called twice!
It would still mean 0.05 secs for one query, but it would at least help a little bit.

Maybe someone can also tell me, why there are two _BIF methods in my dsdt and only one is called. Could it be for the second battery slot? I just pulled the battery out of the first one and the machine crashed ... maybe my dsdt is a bit broken.
I had to remove several Store(Local0, Local0) (NOOP's?????) to make it compile. There were no other warnings except missing return code of _WAK (but I don't/can't use ACPI suspend).

btw: Does anybody know how I could print out 1/100 sec accurate timestamps via syslog/dmesg?

thanks
Markus

Signature · 11 lines
__________________    /"\
Markus Gaugusch       \ /    ASCII Ribbon Campaign
[email protected]     X     Against HTML Mail
                      / \


-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com