周末在家,看了一下比较关注的Google I/O视频,其中在Introduction to Project Volta里面有个battery historian的工具,看着比较有意思,用Nexus 5刷了个Android L preview的版本试试。
使用battery historian步骤:
1、adb shell dumpsys batterystats --enable full-wake-history
2、adb shell dumpsys batterystats --reset
3、adb bugreport |tee bugreport.txt
4、python historian.py -a bugreport.txt | tee battery.html
用Chrome打开battery.html,可以看到:
beautiful!是不是似曾相识的感觉,如果你用过性能分析工具,不然Systrace、Ftrace、Arm Streamline等性能分析工具,那再熟悉不过了。
图形还是相当的漂亮。一个性能问题当你找不到解决方法的时候,最后用图形表示出来,看来Brendan D. Gregg话影响深远呀!
参考链接:
https://developer.android.com/preview/api-overview.html
http://forum.xda-developers.com/google-nexus-5/help/played-android-l-battery-historian-tool-t2808146