My app got rejected to store because of high power consumption, how to debug problems? [answered]
We need pointers on how to debug that and how it's tested in Harbour QA.
We need pointers on how to debug that and how it's tested in Harbour QA.
Harbour QA process is using powertop tool. We'll try to add some instructions how developer can debug and reproduce similar problems. This needs enabled developer mode on the Jolla device.
Steps to install powertop from command line: (note: pkcon requires root i.e. devel-su
)
Add mer-tools repository:
ssu ar mer-tools
Refresh repository cache:
pkcon refresh
Install tool:
pkcon install powertop
After installing powertop tool, usage is easy via ssh over USB or WLAN connection. Difference between these connections is that device does not suspend when we have PC USB connection enabled and with WLAN device goes to suspend if we don't have any network traffic and display is turned off.
Powertop tool provides a list of all running processes which are waking up and how many times in a second. Compared to strace only one process is monitored, it does not tell all about the system, e.g. when our process has interaction with audio or network.
Harbour QA testing is mostly done with PC USB cable connection, application minimized to home screen and display is turned off. In this state application should not block suspend and wake ups should be minimal (< ~60, this is a reference value, final call has Harbour QA on case by case basis). A good practice is to take a "system state" before opening application and compare those results when application is minimized to home screen.
Suspend is blocked by wake locks. An easy test for that is catting /sys/power/wake_lock file. The file should be empty normally if nothing from user space is not blocking suspend. If application is using e.g. audio, then file should include "mce_cpu_keepalive" string.
Of course applications are allowed to do things in the background but that should be minimal for its own functionality. E.g are internet streaming.
Hopefully this post will help developers!
But since many important applications are still published outside Harbour QA (->Openrepos), we end users would need some tools to hunt down these power thieves. At least handy would be: - installation journal/log - cumulative statistics about resource usage (CPU, net IO, ...)
Couple of "wild" applications (Crest, Hunger Meter) show something, but I suppose they don't show anything cumulative ?
Upp15 ( 2014-02-06 17:38:51 +0200 )editAsked: 2014-01-10 16:22:57 +0200
Seen: 1,378 times
Last updated: Aug 23 '14