调试过程中做一些记录:平台msm8953 ,android 7.1(部分参考网络大神的记录和翻译老外的文章)

一、

0、驱动层的裁剪  Android native层服务的裁剪 Android frameworks层服务的裁剪  Android APP层的裁剪

1、lk优化,去掉Lk里面的各种延时,目前启动时间1.3s左右

lk阶段可以把显示部分的初始化去掉,不再显示logo图片,节约0.2s左右

2、kernel优化 ,使用user版本的kernel,init进程启动时间在1s左右,需要继续裁剪Kernel大小,这样lk加载内核时间也会缩短

(1) 减少Log输出

(2)移除不必要的驱动,文件系统,子文件系统,查看 /dev /sys下的节点,移除不必要的功能。例子:如果wlan通过pcie链接,sdio接口驱动可以去掉

(3)裁剪设备树里面不必要的硬件设备。查看生成的.config,移除不必要的选项

(4)优化驱动的probe功能,减少不必要的延时

(5)bootgraph 用来分析内核功能, 在kernel cmdline 增加 initcall_debug ,然后dmesg > boot.log  bootgraph.pl boot.log >  boot.svg

BoardConfig-common.mk:BOARD_KERNEL_CMDLINE += initcall_debug ignore_logleveldriver:.probe_type = PROBE_PREFER_ASYNCHRONOUS,

(6)电源优化

on init# Disable UFS powersavingwrite /sys/devices/soc/${ro.boot.bootdevice}/clkscale_enable 0write /sys/devices/soc/${ro.boot.bootdevice}/clkgate_enable 0write /sys/devices/soc/${ro.boot.bootdevice}/hibern8_on_idle_enable 0write /sys/module/lpm_levels/parameters/sleep_disabled Y
on property:sys.boot_completed=1# Enable UFS powersavingwrite /sys/devices/soc/${ro.boot.bootdevice}/clkscale_enable 1write /sys/devices/soc/${ro.boot.bootdevice}/clkgate_enable 1write /sys/devices/soc/${ro.boot.bootdevice}/hibern8_on_idle_enable 1write /sys/module/lpm_levels/parameters/sleep_disabled N
on charger# Enable UFS powersavingwrite /sys/devices/soc/${ro.boot.bootdevice}/clkscale_enable 1write /sys/devices/soc/${ro.boot.bootdevice}/clkgate_enable 1write /sys/devices/soc/${ro.boot.bootdevice}/hibern8_on_idle_enable 1write /sys/class/typec/port0/port_type sinkwrite /sys/module/lpm_levels/parameters/sleep_disabled N

参考:google pixel 手机

CONFIG_ANDROID_LOGGER=y
CONFIG_IMX134=y
CONFIG_IMX132=y
CONFIG_OV9724=y
CONFIG_OV5648=y
CONFIG_GC0339=y
CONFIG_OV8825=y
CONFIG_OV8865=y
CONFIG_s5k4e1=y
CONFIG_OV12830=y
CONFIG_USB_EHCI_HCD=y
CONFIG_IOMMU_IO_PGTABLE_FAST_SELFTEST=y
CONFIG_IKCONFIG=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_TI_DRV2667=y
CONFIG_CHR_DEV_SCH=y
CONFIG_MMC=y
CONFIG_MMC_PERF_PROFILING=y
CONFIG_MMC_CLKGATE=y
CONFIG_MMC_PARANOID_SD_INIT=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_TEST=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_MSM=y
CONFIG_MMC_SDHCI_MSM_ICE=y
CONFIG_MMC_CQ_HCI=y
CONFIG_MSDOS_FS=y
# CONFIG_SYSFS_SYSCALL is not set
CONFIG_EEPROM_AT24=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_HBTP_INPUT=y
# CONFIG_VGA_ARB is not set
CONFIG_USB_MON=y
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y
CONFIG_USB_STORAGE_USBAT=y
CONFIG_USB_STORAGE_SDDR09=y
CONFIG_USB_STORAGE_SDDR55=y
CONFIG_USB_STORAGE_JUMPSHOT=y
CONFIG_USB_STORAGE_ALAUDA=y
CONFIG_USB_STORAGE_KARMA=y
CONFIG_USB_STORAGE_CYPRESS_ATACB=y
CONFIG_SW_SYNC_USER=y
CONFIG_SEEMP_CORE=y
CONFIG_MSM_SMEM_LOGGING=y
CONFIG_IOMMU_DEBUG=y
CONFIG_IOMMU_DEBUG_TRACKING=y
CONFIG_IOMMU_TESTS=y
CONFIG_MOBICORE_DRIVER=y
# CONFIG_DEBUG_PREEMPT is not set

二、android os部分优化

1、使用bootchart 生成图片的方式,结果生成的图片只有可怜的几项,跟网上相比丢失太多,原因未知。

2、决定使用Logcat来判断

三、zygote 预加载优化

diff --git a/base/preloaded-classes b/base/preloaded-classes
index fe2fba5..934a089 100644
--- a/base/preloaded-classes
+++ b/base/preloaded-classes
@@ -247,25 +247,25 @@
 [[S
 [[[I
 android.R$styleable
-android.accounts.Account
-android.accounts.Account$1
-android.accounts.AccountManager
-android.accounts.AccountManager$1
-android.accounts.AccountManager$11
-android.accounts.AccountManager$AmsTask
-android.accounts.AccountManager$AmsTask$1
-android.accounts.AccountManager$AmsTask$Response
-android.accounts.AccountManagerCallback
-android.accounts.AccountManagerFuture
-android.accounts.AccountsException
-android.accounts.AuthenticatorException
-android.accounts.IAccountManager
-android.accounts.IAccountManager$Stub
-android.accounts.IAccountManager$Stub$Proxy
-android.accounts.IAccountManagerResponse
-android.accounts.IAccountManagerResponse$Stub
-android.accounts.OnAccountsUpdateListener
-android.accounts.OperationCanceledException
+#android.accounts.Account
+#android.accounts.Account$1
+#android.accounts.AccountManager
+#android.accounts.AccountManager$1
+#android.accounts.AccountManager$11
+#android.accounts.AccountManager$AmsTask
+#android.accounts.AccountManager$AmsTask$1
+#android.accounts.AccountManager$AmsTask$Response
+#android.accounts.AccountManagerCallback
+#android.accounts.AccountManagerFuture
+#android.accounts.AccountsException
+#android.accounts.AuthenticatorException
+#android.accounts.IAccountManager
+#android.accounts.IAccountManager$Stub
+#android.accounts.IAccountManager$Stub$Proxy
+#android.accounts.IAccountManagerResponse
+#android.accounts.IAccountManagerResponse$Stub
+#android.accounts.OnAccountsUpdateListener
+#android.accounts.OperationCanceledException
 android.animation.AnimationHandler
 android.animation.AnimationHandler$1
 android.animation.AnimationHandler$2
@@ -963,15 +963,15 @@ android.hardware.Camera
 android.hardware.Camera$CameraInfo
 android.hardware.Camera$Face
 android.hardware.ConsumerIrManager
-android.hardware.Sensor
-android.hardware.SensorEvent
-android.hardware.SensorEventListener
-android.hardware.SensorManager
+#android.hardware.Sensor
+#android.hardware.SensorEvent
+#android.hardware.SensorEventListener
+#android.hardware.SensorManager
 android.hardware.SerialManager
 android.hardware.SerialPort
-android.hardware.SystemSensorManager
-android.hardware.SystemSensorManager$BaseEventQueue
-android.hardware.SystemSensorManager$SensorEventQueue
+#android.hardware.SystemSensorManager
+#android.hardware.SystemSensorManager$BaseEventQueue
+#android.hardware.SystemSensorManager$SensorEventQueue
 android.hardware.camera2.CameraCharacteristics$Key
 android.hardware.camera2.CameraManager
 android.hardware.camera2.CaptureRequest$Key
@@ -991,7 +991,7 @@ android.hardware.display.IDisplayManager$Stub$Proxy
 android.hardware.display.IDisplayManagerCallback
 android.hardware.display.IDisplayManagerCallback$Stub
 android.hardware.fingerprint.FingerprintManager
-android.hardware.hdmi.HdmiControlManager
+#android.hardware.hdmi.HdmiControlManager
 android.hardware.input.IInputDevicesChangedListener
 android.hardware.input.IInputDevicesChangedListener$Stub
 android.hardware.input.IInputManager
@@ -1009,27 +1009,27 @@ android.hardware.location.ContextHubManager
 android.hardware.location.ContextHubService
 android.hardware.location.IContextHubService
 android.hardware.location.IContextHubService$Stub
-android.hardware.radio.RadioManager
-android.hardware.radio.RadioManager$AmBandConfig
-android.hardware.radio.RadioManager$AmBandConfig$1
-android.hardware.radio.RadioManager$AmBandDescriptor
-android.hardware.radio.RadioManager$AmBandDescriptor$1
-android.hardware.radio.RadioManager$BandConfig
-android.hardware.radio.RadioManager$BandConfig$1
-android.hardware.radio.RadioManager$BandDescriptor
-android.hardware.radio.RadioManager$BandDescriptor$1
-android.hardware.radio.RadioManager$FmBandConfig
-android.hardware.radio.RadioManager$FmBandConfig$1
-android.hardware.radio.RadioManager$FmBandDescriptor
-android.hardware.radio.RadioManager$FmBandDescriptor$1
-android.hardware.radio.RadioManager$ModuleProperties
-android.hardware.radio.RadioManager$ModuleProperties$1
-android.hardware.radio.RadioManager$ProgramInfo
-android.hardware.radio.RadioManager$ProgramInfo$1
-android.hardware.radio.RadioMetadata
-android.hardware.radio.RadioMetadata$1
-android.hardware.radio.RadioModule
-android.hardware.radio.RadioTuner
+#android.hardware.radio.RadioManager
+#android.hardware.radio.RadioManager$AmBandConfig
+#android.hardware.radio.RadioManager$AmBandConfig$1
+#android.hardware.radio.RadioManager$AmBandDescriptor
+#android.hardware.radio.RadioManager$AmBandDescriptor$1
+#android.hardware.radio.RadioManager$BandConfig
+#android.hardware.radio.RadioManager$BandConfig$1
+#android.hardware.radio.RadioManager$BandDescriptor
+#android.hardware.radio.RadioManager$BandDescriptor$1
+#android.hardware.radio.RadioManager$FmBandConfig
+#android.hardware.radio.RadioManager$FmBandConfig$1
+#android.hardware.radio.RadioManager$FmBandDescriptor
+#android.hardware.radio.RadioManager$FmBandDescriptor$1
+#android.hardware.radio.RadioManager$ModuleProperties
+#android.hardware.radio.RadioManager$ModuleProperties$1
+#android.hardware.radio.RadioManager$ProgramInfo
+#android.hardware.radio.RadioManager$ProgramInfo$1
+#android.hardware.radio.RadioMetadata
+#android.hardware.radio.RadioMetadata$1
+#android.hardware.radio.RadioModule
+#android.hardware.radio.RadioTuner
 android.hardware.soundtrigger.SoundTrigger
 android.hardware.soundtrigger.SoundTrigger$ConfidenceLevel
 android.hardware.soundtrigger.SoundTrigger$ConfidenceLevel$1
@@ -1555,24 +1555,24 @@ android.net.wifi.WifiSsid
 android.net.wifi.WifiSsid$1
 android.net.wifi.nan.WifiNanManager
 android.net.wifi.p2p.WifiP2pManager
-android.nfc.IAppCallback
-android.nfc.IAppCallback$Stub
-android.nfc.INfcAdapter
-android.nfc.INfcAdapter$Stub
-android.nfc.INfcAdapter$Stub$Proxy
-android.nfc.INfcCardEmulation
-android.nfc.INfcCardEmulation$Stub
-android.nfc.INfcCardEmulation$Stub$Proxy
-android.nfc.INfcFCardEmulation
-android.nfc.INfcFCardEmulation$Stub
-android.nfc.INfcFCardEmulation$Stub$Proxy
-android.nfc.INfcTag
-android.nfc.INfcTag$Stub
-android.nfc.INfcTag$Stub$Proxy
-android.nfc.NfcActivityManager
-android.nfc.NfcAdapter
-android.nfc.NfcAdapter$1
-android.nfc.NfcManager
+#android.nfc.IAppCallback
+#android.nfc.IAppCallback$Stub
+#android.nfc.INfcAdapter
+#android.nfc.INfcAdapter$Stub
+#android.nfc.INfcAdapter$Stub$Proxy
+#android.nfc.INfcCardEmulation
+#android.nfc.INfcCardEmulation$Stub
+#android.nfc.INfcCardEmulation$Stub$Proxy
+#android.nfc.INfcFCardEmulation
+#android.nfc.INfcFCardEmulation$Stub
+#android.nfc.INfcFCardEmulation$Stub$Proxy
+#android.nfc.INfcTag
+#android.nfc.INfcTag$Stub
+#android.nfc.INfcTag$Stub$Proxy
+#android.nfc.NfcActivityManager
+#android.nfc.NfcAdapter
+#android.nfc.NfcAdapter$1
+#android.nfc.NfcManager
 android.opengl.EGL14
 android.opengl.EGLConfig
 android.opengl.EGLContext

四、app相关优化

1、去除不需要的app以及相关库

diff --git a/target/product/core.mk b/target/product/core.mk
index c315bb4..7e7c612 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -21,21 +21,13 @@
 # core_tiny.mk in addition to core_minimal.mk.
 
 PRODUCT_PACKAGES += \
-    BasicDreams \
     BlockedNumberProvider \
     BookmarkProvider \
-    Browser2 \
-    Calendar \
-    CalendarProvider \
     CaptivePortalLogin \
     CertInstaller \
     Contacts \
-    DeskClock \
     DocumentsUI \
     DownloadProviderUi \
-    Email \
-    ExactCalculator \
-    Exchange2 \
     ExternalStorageProvider \
     FusedLocation \
     InputDevices \
@@ -48,12 +40,9 @@ PRODUCT_PACKAGES += \
     PicoTts \
     PacProcessor \
     libpac \
-    PrintSpooler \
     PrintRecommendationService \
     ProxyHandler \
-    QuickSearchBox \
     Settings \
-    SharedStorageBackup \
     StorageManager \
     Telecom \
     TeleService \
diff --git a/target/product/core_base.mk b/target/product/core_base.mk
index 03d33e1..d02b058 100644
--- a/target/product/core_base.mk
+++ b/target/product/core_base.mk
@@ -33,7 +33,6 @@ PRODUCT_PACKAGES += \
     libfilterpack_imageproc \
     libgabi++ \
     libmdnssd \
-    libnfc_ndef \
     libpowermanager \
     libspeexresampler \
     libstagefright_soft_aacdec \
diff --git a/target/product/full_base.mk b/target/product/full_base.mk
index 65bdf0f..2f8eef5 100644
--- a/target/product/full_base.mk
+++ b/target/product/full_base.mk
@@ -25,17 +25,12 @@ PRODUCT_PACKAGES := \
     libWnnEngDic \
     libWnnJpnDic \
     libwnndict \
-    WAPPushManager
 
 PRODUCT_PACKAGES += \
-    Galaxy4 \
     HoloSpiralWallpaper \
-    LiveWallpapers \
-    LiveWallpapersPicker \
     MagicSmokeWallpapers \
     NoiseField \
     PhaseBeam \
-    PhotoTable
 
 # Additional settings used in all AOSP builds
 PRODUCT_PROPERTY_OVERRIDES := \
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index 5c48358..be3ed0d 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -21,7 +21,6 @@ PRODUCT_PACKAGES := \
     Bluetooth \
     BluetoothMidiService \
     Camera2 \
-    Gallery2 \
     Music \
     MusicFX \
     OneTimeInitializer \
diff --git a/target/product/telephony.mk b/target/product/telephony.mk
index e840ba1..60ede56 100644
--- a/target/product/telephony.mk
+++ b/target/product/telephony.mk
@@ -21,7 +21,6 @@ PRODUCT_PACKAGES := \
     CarrierConfig \
     Dialer \
     CallLogBackup \
-    CellBroadcastReceiver \
     EmergencyInfo \
     rild

2、languages_full.mk,locales_full.mk: 去除不需要的语言设置(可以去除res包的大小)

五、Bootanimation

控制动画包中资源数量及大小,另外考虑缩短循环播放和结尾的时间。

调试手段:
禁用开机动画:将”debug.sf.nobootanimation”设为”1” device/qcom/msm8996/system.prop
禁用锁屏:将”def_lockscreen_disabled”设为”true” frameworks/base/packages/SettingsProvider/res/values/defaults.xml

六、提升CPU频率 - 将所有CPU切换至性能模式

adb shell stop perf-hal-1-0adb shell "echo 1 > /sys/devices/system/cpu/cpu0/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu1/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu2/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu3/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu4/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu5/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu6/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu7/online"adb shell "echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
adb shell "echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor"
adb shell "echo performance > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor"
adb shell "echo performance > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor"
adb shell "echo performance > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor"
adb shell "echo performance > /sys/devices/system/cpu/cpu5/cpufreq/scaling_governor"
adb shell "echo performance > /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor"
adb shell "echo performance > /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor"adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpubw/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,mincpubw/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,memlat-cpu0/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom, memlat-cpu6/governor"

七、提升GPU频率

adb shell "echo 0 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel"
adb shell "echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on"
adb shell "echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor"

八、

android 7.1 开机速度优化记录相关推荐

  1. 直播代码,Android开机速度优化

    直播代码,Android开机速度优化的相关方法和代码 cpu升频和task上大核: on init# boost sched tunewrite /dev/stune/schedtune.prefer ...

  2. android开机优化服务,Android开机速度优化简单回顾

    Android的开机速度,基本上没人说快的,通常移植完系统后,马上要看的事情就是优化开机时间,以下是简单回忆以下以前做优化的那些事. 开机时间都花在哪? 优化开机时间,通常做的首先是那有有没有BUG, ...

  3. Android开启odex开关和开机速度优化

    开odex优化首次开机速度,是牺牲空间换取时间的做法,仅限于空间足够的设备.开了odex之后,在编译的时候,整个system image就会被预先优化.由于在启动时不再需要进行app的dex文件进行优 ...

  4. android odex版本调试_Android开启odex开关和开机速度优化

    开odex优化首次开机速度,是牺牲空间换取时间的做法,仅限于空间足够的设备.开了odex之后,在编译的时候,整个system image就会被预先优化.由于在启动时不再需要进行app的dex文件进行优 ...

  5. 今日头条 Android '秒' 级编译速度优化

    背景介绍 Android 项目一般使用 gradle 作为构建打包工具,而其执行速度慢也一直为人所诟病,对于今日头条 Android 项目这种千万行级别的大型工程来说,全量编译一次的时间可能高达六七分 ...

  6. Android—WebView加载速度优化工程实践

    一.混合开发的优势与缺陷 在混合开发大行其道的今天,很多页面和功能都转由前端实现,客户端只要在APP中嵌入一个WebView即可,同时前端开发的页面对于Android和iOS端的效果是统一的,省去了适 ...

  7. 关于Android 手机 开机速度的优化

    做了这么多年的手机,从来没写过什么文章.以下只是记录下平时自己的修改,仅供参考 关于mtk 平台手机开机速度的优化 第一:尽量减少data区内置app的数量,这个会严重影响开机速度,特别是第一次的开机 ...

  8. android系统 修改优化,修改Android系统源代码,优化开机速度。

    通常情况下,Android系统开机保持在20s~25s应该算是合格比较好的状态. 最近几天在看关于Android系统开机启动过程的相关内容.做个笔记. 关于有话Android系统开机时间有话,采取三个 ...

  9. Android开启odex,优化开机速度

    开odex优化首次开机速度,是牺牲空间换取时间的做法,仅限于空间足够的设备.开了odex之后,在编译的时候,整个system image就会被预先优化.由于在启动时不再需要进行app的dex文件进行优 ...

  10. 浅谈Android开机启动速度优化(含应用程序启动速度优化)

    众所周知Android开机启动速度较慢,于是如何加快启动速度便成为一个值得讨论的问题. 在查阅过许多资料后(特别是Google Group的android-platform),我整理总结出下面几点基本 ...

最新文章

  1. 生物信息通识技术研讨会
  2. php 点击表头排序,TP5+ajax实现点击表格表头切换排序,带分页
  3. latex 下划线_Vim Latex 的使用和配置技巧 (三): 用 snippet 编辑 latex
  4. Centos安装图形化界面
  5. 我的名片能运行Linux和Python,还能玩2048小游戏,成本只要20元
  6. spark源码解析之scala基本语法
  7. linux windows文件 编码_Linux与Windows实现文件交互的几种方式
  8. OC对象的本质及分类
  9. python删除空白没有显示_删除Python字符串中的空白
  10. 超声主瓣,旁瓣,栅瓣概念解析
  11. 如何用python爬视频_如何使用python网络爬虫抓取视频?
  12. Android常用框架收藏
  13. 冰火两重天----评NBA2009-12-28快船和凯尔特人的比赛
  14. ubuntu下 vscode 配置c++ 环境和opencv
  15. 用户故事与敏捷方法—课后习题解析
  16. Ceph的Paxos源码注释 - Phase 2
  17. python股指期货tick数据_股指期货中的Tick数据是什么意思
  18. Kubernetes1.24版本高可用集群环境搭建(二进制方式)
  19. 蒸汽调节阀特色与原理
  20. 运行SQL文件,出现[ERR] 1046 - No database selected

热门文章

  1. 【C语言】通讯录管理系统
  2. 各宽带接入服务商简称整理
  3. html 播放amr ios,关于iOS设备以amr格式播放音频文件
  4. B. Kay and Snowflake(重心的性质)
  5. 【Spring Security Oauth2】构建资源服务器(二):授权管理(Web授权,注解授权:securedEnabled, prePostEnabled, jsr250Enabled)
  6. Windows 10系统【之】内置应用
  7. [bitcoin143@india.com].dharma 是什么东东
  8. TB,PB, Eb, Zb, YB
  9. 2018年全球十大突破性技术
  10. javaweb调用python修改微信运动步数,使用小米运动接口