java -jar 启动优化_Android 8.1 启动时间优化--耗时分析

之前分析各个部分耗时,都是通过分析log,在SecureCRT中设置时间戳,打印出如下log

[   22.266201] c1 [saudio] saudio_wait_monitor_cmd error -5

[   22.266205] c1 sblock_receive:sblock-5-13 not ready!

[   22.266209] c1 [saudio] Error: sblock_receive dst 5, channel 13 result is -5

[   22.266226] c1 [saudio] saudio_wait_monitor_cmd error -5

[   22.266229] c1 sblock_receive:sblock-5-17 not ready!

[   22.266232] c1 [saudio] Error: sblock_receive dst 5, channel 17 result is -5

[   22.302337] c3 init: Parsing file /system/etc/init/ims_bridged.rc...

[   22.309790] c3 init: Parsing file /system/etc/init/init-debug.rc...

[   22.316932] c3 init: Parsing file /system/etc/init/installd.rc...

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

有效,但数据不全面,不利于分析。百度到了bootchart这个工具,很实用。

1) bootchart工具

在Android O当中,bootchart已经默认集成在Init当中。所以收集数据可以用以下步骤:

只需要你通过开关打开即可生效:“adb shell ‘touch /data/bootchart/enabled’”

重启设备

$ANDROID_BUILD_TOP/system/core/init/grab-bootchart.sh抓取数据生成一张png图片,即可进行分析。

sp8541e_srvm:/data/bootchart $ tar -czf bootchart.tgz enabled header proc_diskstats.log proc_ps.log proc_stat.log

adb pull /data/bootchart/bootchart.tgz .\Desktop\

拷贝bootchart.tgz 到Ubuntu服务器上

Ubuntu服务器上 sudo apt-get install bootchart

bootchart bootchart.tgz

命令结束后就生成对应的png图片。

但是如果碰到bootchart工具不能使用的情况,就需要自己下载bootchart源码:http://www.bootchart.org/download.html,解压后:

1. ant编译

2. java -jar bootchart.jar ../bootchart/bootchart.tgz 生成分析结果图

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值