首页 > 移动平台 > 详细

Android/Linux boot time优化

时间:2017-01-10 08:15:13      阅读:593      评论:0      收藏:0      [点我收藏+]

基于analyze_boot.py分析Android/Linux的kernel boot时间

1.修改HiKey的BoardConfig.mk文件,使能initcall_debug,增加dmesg buffer大小。

diff --git a/hikey/BoardConfig.mk b/hikey/BoardConfig.mk
index 6d17130..64e8789 100644
--- a/hikey/BoardConfig.mk
+++ b/hikey/BoardConfig.mk
@@ -4,7 +4,7 @@ TARGET_BOARD_PLATFORM := hikey
ifeq ($(TARGET_KERNEL_USE_4_1), true)
BOARD_KERNEL_CMDLINE := console=ttyAMA3,115200 androidboot.console=ttyAMA3 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noru
else
-BOARD_KERNEL_CMDLINE := console=ttyFIQ0 androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime
+BOARD_KERNEL_CMDLINE := console=ttyFIQ0 androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime initcall_debug log_buf_len=16M
endif
 
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736

2.adb shell dmesg保存内核log到dmesg.txt中。

adb shell dmesg > dmesg.txt

3.使用analyze_boot.py分析dmesg.txt,生成从kernel启动到启动用户空间init之间timeline图表。

./analyze_boot.py -dmesg dmesg.txt
          Host: lenovo-Product
     Test time: 2017-01-09_19:16:25
     Boot time: 1970-01-01_08:00:03
Kernel Version: 4.4.0-31-generic
  Kernel start: 0.000
    init start: 5977.254

4.结果分析。

整个boot情况概况如下:

技术分享

查看某一个细节的启动时间,如hisi_thermal_driver_init:

技术分享

工具代码分析

 

analyze_boot.py:https://github.com/arnoldlu/suspendresume/blob/master/analyze_boot.py

使用bootchart分析

Android/Linux boot time优化

原文:http://www.cnblogs.com/arnoldlu/p/6266331.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!