Android power consumption (14) — debugging of Android power consumption

Time:2021-6-5

Debugging of Android power consumption problem (mainly the example of debugging method for “large” current problem during sleep)

  1. After the mobile phone enters the sleep, it is waked up by the upper APK. For the debug method, please grab the corresponding standby mobilelog and download it from the kernel_ Log, if wake up by RTC can be found in the log

In the corresponding main_ Search keywords in log

The APK corresponding to type 0 and type 2 is the wake-up source of the wake-up system,

For example:

From the log, the problem is that the system is awakened by APK with alarm type 0 & 2, which are com.android.phone & com.google.android.gsf

01-03 13:47:52.018 653 699 V AlarmManager: Native set alarm :Alarm{41e4d570 type 2 com.android.phone}
01-03 13:47:59.056 653 699 V AlarmManager: Native set alarm :Alarm{42041000 type 2 com.google.android.gsf}

01-03 13:48:52.076 653 699 V AlarmManager: Native set alarm :Alarm{421dec08 type 2 com.android.phone}
01-03 13:48:58.264 653 699 V AlarmManager: Native set alarm :Alarm{41c04b80 type 0 com.google.android.gsf}
01-03 13:48:58.358 653 885 V AlarmManager: Native set alarm :Alarm{42007638 type 0 com.google.android.gsf}
01-03 13:48:59.090 653 699 V AlarmManager: Native set alarm :Alarm{41d47db8 type 2 com.google.android.gsf}

After release wakelock (the system is still awake state), you will also see the com.dewav.timewidget asking for the clock with wakelock. Please remove it

01-03 13:49:00.355 1015 1015 V AppWidgetContext: package name: com.dewav.timewidget
01-03 13:49:00.355 1015 1015 V AppWidgetContext: context permission not changed 
01-03 13:49:01.168 653 699 V AlarmManager: Native set alarm :Alarm{41e02628 type 2 com.android.phone}
  1. For some modem related debugs, we need to combine kernel log / radio log / net log / modem log for analysis

If you find the wakened time point in the kernel, you can connect the kernel log with the upper time point in the following ways to search for UTC (possible time point) in the kernel log

Time zone conversion is required when crawling on the client)

image

Search the CPU wake up keyword in the kernel to find the corresponding time point. After conversion, the upper layer time can be obtained.

<4>[ 281.333369]-(0)[5:kworker/u:0][PCM WAKEUP NORMAL]CPU WAKE UP BY: CCIF 
<5>[ 281.333369]-(0)[5:kworker/u:0][Power/Sleep] slp_abort_cnt:0,slp_normal_cnt:12
<7>[ 281.333702] (0)[5:kworker/u:0]enable(1), count(1) res=0
<7>[ 281.334564] (0)[5:kworker/u:0]enable(0), count(0) res=0
<4>[ 281.334574] (0)[5:kworker/u:0]usb save current success
<7>[ 281.335210] (0)[5:kworker/u:0]enable(0), count(0) res=1
<6>[ 281.335505]-(0)[5:kworker/u:0][Power/Kernel]:ws activate-> ccci_modem1

CPU wake up by: CCIF and WS activate > CCCI_ After modem1, you can try to check whether there are corresponding time points in radio and Netlog

URC report or IP report sending and receiving. Both cases cause AP wakeup.