如何启用Android L MR1 5.1的引导图表
我正在调查android的首次启动,并希望启用bootchart,但我总是失败,下面是我所做的,有人可以帮助我吗 因为bootchart服务在/data分区装载之前启动,所以每次bootchart初始化失败。 内核日志中的失败消息是:bootcheringinitfailure 因此,为了确保bootchart init成功,我修改了相关代码。这个解决方案在AndroidL中可以很好地工作,但在AndroidL MR1中失败了。 手机在执行以下更改后保持重启;在我禁用selinux后,手机会在第一个徽标处阻塞如何启用Android L MR1 5.1的引导图表,android,performance,Android,Performance,我正在调查android的首次启动,并希望启用bootchart,但我总是失败,下面是我所做的,有人可以帮助我吗 因为bootchart服务在/data分区装载之前启动,所以每次bootchart初始化失败。 内核日志中的失败消息是:bootcheringinitfailure 因此,为了确保bootchart init成功,我修改了相关代码。这个解决方案在AndroidL中可以很好地工作,但在AndroidL MR1中失败了。 手机在执行以下更改后保持重启;在我禁用selinux后,手机会在第
有人在android L MR1上启用过引导图吗?如何更改的代码? 如何修改代码以确保bootchart init在/data/partition挂载后运行
提前谢谢你!这对我来说是非常严重的。通过这个
init.rc
,我能够为第一次启动启用引导图表:
on post-fs-data
# We chown/chmod /data again so because mount is run as root + defaults
chown system system /data
chmod 0771 /data
# We restorecon /data in case the userdata partition has been reset.
restorecon /data
# start debuggerd to make debugging early-boot crashes easier.
start debuggerd
start debuggerd64
# Make sure we have the device encryption key.
start vold
installkey /data
# Start bootcharting as soon as possible after the data partition is
# mounted to collect more data.
mkdir /data/bootchart 0755 shell shell
# if you need to enable bootchart uncomment next line
# Old Android
# write /data/bootchart-start 120
# Android > 7.0
# write /data/bootchart/start 120
bootchart_init
有人能回答我的问题吗?你没有试过在Android 5.1上启用bootchart吗?你找到解决方案了吗?
init/init.c
static int bootchart_init_action(int nargs, char **args)
{
bootchart_count = bootchart_init();
if (bootchart_count < 0) {
ERROR("bootcharting init failure\n");
+ queue_builtin_action(bootchart_init_action, "bootchart_init");
} else if (bootchart_count > 0) {
NOTICE("bootcharting started (period=%d ms)\n", bootchart_count*BOOTCHART_POLLING_MS);
} else {
NOTICE("bootcharting ignored\n");
}
rootdir/init.rc
on post-fs-data
# We chown/chmod /data again so because mount is run as root + defaults
chown system system /data
chmod 0771 /data
# We restorecon /data in case the userdata partition has been reset.
restorecon /data
+ write /data/bootchart-start 600
# Avoid predictable entropy pool. Carry over entropy from previous boot.
copy /data/system/entropy.dat /dev/urandom
/system/core/init/Android.mk
+ INIT_BOOTCHART :=true
ifeq ($(strip $(INIT_BOOTCHART)),true)
LOCAL_SRC_FILES += bootchart.c
LOCAL_CFLAGS += -DBOOTCHART=1
endif
on post-fs-data
# We chown/chmod /data again so because mount is run as root + defaults
chown system system /data
chmod 0771 /data
# We restorecon /data in case the userdata partition has been reset.
restorecon /data
# start debuggerd to make debugging early-boot crashes easier.
start debuggerd
start debuggerd64
# Make sure we have the device encryption key.
start vold
installkey /data
# Start bootcharting as soon as possible after the data partition is
# mounted to collect more data.
mkdir /data/bootchart 0755 shell shell
# if you need to enable bootchart uncomment next line
# Old Android
# write /data/bootchart-start 120
# Android > 7.0
# write /data/bootchart/start 120
bootchart_init