Talk:Per-Activity Power Usage

From OLPC
Revision as of 20:11, 14 August 2008 by Gnu (talk | contribs) (What to do to the system *now* to help this future scenario)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Measuring power events

The abstract "power per activity" numbers may not be too useful to end-users, but they would be very useful to developers, seeking to optimize the power usage of the system in general and of particularly egregious activities.

Small changes to the system, made soon, that would merely record the key information needed for this analysis, would be great. Things like:

  • Activity startup and shutdown, and foregrounding should trigger a couloumb counter reading.
  • Logging of the times and precipitating events that caused sleeps and wakeups, along with couloumb counter readings.
  • Logging of other power-related events such as screen dimming, enabling or disabling WiFi or Mesh, plugging or removing USB or SD.

Note that the couloumb counter only works when the system is running without external power. Also, the couloumb counter is extremely hard to read; the CPU has to ask the EC which communicates over a slow and cumbersome 1-wire interface into the battery pack. Putting a couloumb counter on the main power supply, directly and cheaply readable by the CPU (and/or providing a way for software to interrupt the incoming external power at will, thus throwing the system onto its battery), would improve automatic measurement of power in ordinary operation. Also, the counter has limited short-term precision, though it does better over the long term; see its data sheet: Maxim DS2756 data sheet.

A logging infrastructure that kept this info in a few pages of RAM in a daemon, and only wrote them out upon each shutdown or lid-close suspension, would provide lots of data collection without much flash wear or performance impact. In the current hardware, the logging should probably not occur when on AC power, since the couloumb counter provides little useful info in that case.