前言
自已写的脚本,抓取高通功耗相关 log, 以检查有没有休眠下去
具体分析可参考高通有文档:
【非常好】80-p0955-1sc_b_extensive_power_debug_guide.功耗分析_需要仪器.pdf
脚本
使用也很简单,先连 USB -> 运行脚本 -> 断开 USB -> 过三分钟左右再连上 USB -> 在终端任意按键 -> 查看 当前目前下 log
@echo off
set pra=dmesg -c
set suspendtime=%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%-%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
echo %suspendtime%
@echo on
adb wait-for-device
adb root
adb wait-for-device
:: 作用:AP 是否进入睡眠
adb shell cat /sys/kernel/debug/rpm_stats > %suspendtime%.rpm_stats.suspend.txt
:: 作用:判断哪个 CPU 没有睡眠
adb shell cat /sys/kernel/debug/rpm_master_stats > %suspendtime%.rpm_master_stats.suspend.txt
:: 作用:查看哪路 CLK 没关
adb shell "echo 1 > /sys/module/kernel/parameters/initcall_debug"
adb shell "echo 1 > /sys/kernel/debug/clk/debug_suspend"
adb shell "echo 1 > /sys/module/msm_show_resume_irq/parameters/debug_mask"
adb shell "echo 32 > /sys/module/msm_pm/parameters/debug_mask"
adb shell "echo 8 > /sys/module/mpm_of/parameters/debug_mask"
pause
adb wait-for-device
adb root
adb wait-for-device
:: 唤醒
@echo off
set resumetime=%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%-%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
echo %resumetime%
@echo on
adb shell cat /sys/kernel/debug/rpm_stats > %resumetime%.rpm_stats.resume.txt
adb shell cat /sys/kernel/debug/rpm_master_stats > %resumetime%.rpm_master_stats.resume.txt
adb shell %pra:"=% > %resumetime%.kernel.txt
pause