Android power consumption (22) --- MTK power consumption analysis

1. What kind of log is needed for power consumption

Please follow a few principles for power consumption problems:

---------------------------------------------------------------------------------------------------------------------

(1) The process of testing power consumption data must use the user version and close all logs

(2) Unless there are special needs, please close the modem log (including C2K modem log) at any time .

(3) For the mobile log part, do not only provide kernel log (or uart log), but be sure to provide a complete mobile log package

(3) If you have rich processing experience and really need to open the modem log, you must provide the mobile log analysis description when the modem log was not opened before.

 

Log grabbing principle:

when is it available

data connection closed

data connection open

need

mobile log ( close modem log )

mobile log + net log ( close modem log )

If mobile + net log cannot locate the problem

mobile log + modem log

mobile log + net log + modem log

2. Tools needed to measure the current waveform

Measuring the current waveform requires a professional tool with high sampling accuracy and the ability to save the entire current change as a file.

Recommended here: PowerMonitor

Official website introduction:

https://www.msoon.com/LabEquipment/PowerMonitor/

Its graphical interface is

Some measured current waveforms provide waveforms as

In contrast, the accuracy is too low, you can only look at the picture, and the problem is not easy to locate.

  • Use of Powermonitor

1. Connect the fake battery to the powermonitor , try not to use large capacitors for the fake battery [Note: The fake battery needs to have an NTC  resistor, otherwise it may not be able to boot normally]

2. If the red light appears when the powermonitor  is turned on, you can set Parameters  à  Power-up current limit  and slide it to a place with a larger value

This can avoid high power-on current, because the default setting of powermonitor is low, and overcurrent protection is prone to occur, which will cause the red light of powermonitor to light up.

 

 

3. Set the voltage to 4V [ Set Vout ] , then click  Vout Enable

4. Click Run to  view the waveform

 

5. After recording the desired waveform, you can click Save  to save the waveform

3、thermal log

  • Why do you need to capture thermal log

我们使用WhatsTemp 这个APP来抓取thermal log

thermal log里面包含了CPU/GPU使用信息,以及thermal limit的状况

对我们分析动态场景的功耗问题是极为有用的

 

  • APP哪里下载

WhatsTemp可以在online上下载到:Home > Tool > WhatsTemp

 

  • APP使用方法

4、systrace/ftrace

systrace/ftrace 也是我们分析功耗问题常用的工具

-------------------------------------------------------------------------------------------------------------

thermal log只能帮你粗略看CPU的loading状况,

而systrace/ftrace可以帮你定位到是谁在使用CPU,也可以用来分析idle状态下的毛刺波形是谁触发的

我们通常会把两者结合起来用:

用thermal log做初步分析比较loading的差异,用systrace/ftrace来定位root cause

5、wireshark

  • 为什么要使用wireshark

wireshark是我们用来分析netlog的一个工具

通常用来定位开数据连接的待机功耗问题,查找是哪个APP/Process在使用数据

 

  • 哪里可以下载

wireshark可以在公共网络上下载到,一般公司负责协议/TCP/Wifi这些部门也会有这个工具

 

  • 怎么使用wireshark

首先需要在抓log时,打开mtklog中的netlog,就可以找到netlog对应的文件

 

用wireshark打开这个.cap文件,界面如下

 

有时候最前面的【时间戳】格式会不对,会跟mobile log对不上,如果遇到了,可以通过如下菜单调整

[View]->[Time Display Format]

 

6、layerdump

 

命令:adb shell dumpsys SurfaceFlinger

下面问launcher的图层:

h/w composer state:
h/w composer present and enabled
Hardware Composer state (version 01050000):
mDebugForceFakeVSync=0
Display[0] configurations (* current):
* 0: 1080x1920, xdpi=368.114990, ydpi=368.114990, refresh=16553550, colorTransform=0
numHwLayers=5, flags=00000000
type | handle | hint | flag | tr | blnd | format | source crop (l,t,r,b) | frame | name 
-----------+----------+------+------+----+------+-------------+--------------------------------+------------------------+------
HWC | 7d2f027f00 | 0002 | 0000 | 00 | 0100 | RGBx_8888 | 0.0, 0.0, 1080.0, 1920.0 | 0, 0, 1080, 1920 | com.android.systemui.ImageWallpaper
HWC | 7d2f027680 | 0002 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1080.0, 1920.0 | 0, 0, 1080, 1920 | com.android.launcher3/com.android.launcher3.Launcher
HWC | 7d2f027200 | 0002 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1080.0, 54.0 | 0, 0, 1080, 54 | StatusBar
HWC | 7d2b367d80 | 0002 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1080.0, 108.0 | 0, 1812, 1080, 1920 | NavigationBar
FB TARGET | 7d2f626e80 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1080.0, 1920.0 | 0, 0, 1080, 1920 | HWC_FRAMEBUFFER_TARGET






Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325459032&siteId=291194637