on post-fs-data ...... # Start bootcharting as soon as possible after the data partition is # mounted to collect more data. mkdir /data/bootchart 0755 shell shell bootchart start
# 这里由于系统车机系统定制了,采集的bootchart时间只有20s左右特别短,需要自定义一个属性,开发早期需要看到launcher起来了,手动设置一个属性关闭bootchart on property:sys.boot_completed=1 bootchart stop
2.采集bootchart开关
1 2 3 4 5 6 7 8 9 10 11 12
static Result<Success> do_bootchart_start(){ // We don't care about the content, but we do care that /data/bootchart/enabled actually exists. // 只要/data/bootchart/enabled文件存在,就开启一个线程开始统计bootchart std::string start; if (!android::base::ReadFileToString("/data/bootchart/enabled", &start)) { LOG(VERBOSE) << "Not bootcharting"; return Success(); }