Android 功耗問題debug處理(主要是睡眠時“大”電流問題的debug方法示例)
- 在手機進入sleep后,被上層apk喚醒的debug方法, 請抓取相應的待機的mobilelog, 從kernel_log中分析,如果log中可以查找到 wake up by RTC
請在相應的main_log中查找關鍵字
Alarm triggering, 其后面對應的type 0, type 2所對應的APk就是喚醒系統的喚醒源,
例如:
從log 上看,問題是由于系統被alarm type 為0 & 2 的APK喚醒,分別為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}
而release wakelock后(系統還是awake state),也會看到com.dewav.timewidget去要帶有wakelock的clock, 請您去掉看看
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}
- 而對于一些與modem相關的debug,需要結合kernel log/ radio log/net log/modem log來結合分析
在kernel中發現被喚醒的時間點,可以通過以下方式將kernel log和上層的時間點聯系起來,在kernel log中搜索UTC(可能
在客戶端抓取的話,需要時區轉換)
在kernel中搜索CPU WAKE UP關鍵字,可以找到對應的時間點,在結合上圖經過轉換后,得到上層的時間,
<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以及ws activate->ccci_modem1后,可以嘗試查看radiolog中以及netlog中是否有對應時間點的
URC上報或者IP報收發,這兩種case都會引起AP喚醒,
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/239859.html
標籤:其他
