ADB:Android Debug Bridge。
这里性能调试如下:
性能测试需要进行如下设置:
- 如果要让user模式能够进行root操作,需要更改(system/core/adb/adb.c)
- 将无用的log信息去掉,#define LOG_NIDEBUG 0
- 如果调试Web的用户体验,需要wifi已经能够正常工作
以下命令将设备进入性能模式
将DDR进入性能模式
adb shell echo 400000000 > /sys/class/kgsl/kgsl-3d0/gpuclk
adb shell echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor
adb shell echo performance >/sys/class/devfreq/qcom,cpubw.30/governor(不同的设备可能会有差异)
读取交互模式cpu频率管理器参数
adb shell cat /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
adb shell cat /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
adb shell cat /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
adb shell cat /sys/devices/system/cpu/cpufreq/interactive/target_loads
adb shell cat /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
adb shell cat /sys/devices/system/cpu/cpufreq/interactive/boost
adb shell cat /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
adb shell cat /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
adb shell cat /sys/devices/system/cpu/cpufreq/interactive/timer_rate
adb shell cat /sys/devices/system/cpu/cpufreq/interactive/timer_slack
禁止内核thermal
adb shell
echo 0 > /sys/module/msm_thermal/core_control/enabled
通过无线adb调试
1. Connect a USB and verify that Wi-Fi is working on the device.
– adb tcpip 5555
– adb shell netcfg
– <output> wlan0 UP 10.42.118.17/22 0x00001043 f0:25:b7:f5:02:81
– adb connect 10.42.118.17
# In Wi-Fi settings, click the Wi-Fi network
name to get the IP.
2. Remove the USB and try adb devices.
3. To end the session:
– adb disconnect
GPU性能调试
将GPU进入性能模式
adb shell echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split
adb shell echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor
adb shell echo 1 > /sys/class/kgsl/kgsl-3d0/force_bus_on
adb shell echo 1 > /sys/class/kgsl/kgsl-3d0/force_rail_on
adb shell echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on
adb shell echo 1000000 > /sys/class/kgsl/kgsl-3d0/idle_timer
通过adb查看每秒滚屏数
1. adb pull /system/build.prop
2. Enable the properties debug.gr.calcfps = 1 and debug.gr.calcfps.period = 1 in the build.prop
file and save the file.
adb push build.prop /system/
adb shell chmod 0644 /system/build.prop
adb shell sync
adb shell reboot
3. Enable the FPS calculation (and display the distribution of frame arrival times) by setting
debug.gr.calcfps = 2.
4. Grep for FPS in logcat.
检查设备layer的组成和层数
1. Get the adb shell dumpsys SurfaceFlinger log.
2. Search for lines similar to those highlighted in the following log:
numHwLayers=4, flags=00000000
type | handle | hints | flags | tr | blend | format | source crop | frame name
------------+----------+----------+----------+----+-------+----------+---------------------------+---------
HWC | b71a1610 | 00000000 | 00000004 | 00 | 00100 | 00000002 | [ 160, 25, 480, 480] | [ 0, 25, 320, 480]
com.android.systemui.ImageWallpaper
HWC – MDP composition
GLES – GPU composition
During transition, the log sometimes shows HWC and GLES, which is Mixed mode composition.