Improving Android Bootup Time: Tim Bird Sony Network Entertainment, Inc
Improving Android Bootup Time: Tim Bird Sony Network Entertainment, Inc
Bootup Time
Tim Bird
Sony Network Entertainment, Inc.
<tim.bird (at) am.sony.com>
to
service zygote /system/xbin/strace -tt -o/data/boot.strace /system/bin/app_process -Xzygote
/system/bin --zygote --start-system-server
Android system log
• Android has built-in logging system
• Use ‘logcat’ command to view messages
• I added extra instrumentation for class
preloading and package scanning
• I also set PARSE_CHATTY flag for
package scanning
• I built my own tool (logdelta) to scan log
and produce 'delta' times
Dalvik method tracer
• Method tracer is built into Dalvik
• Can be activated with ddms or using calls
inside source
• Unfortunately, it didn’t work on the EVM
platform, due to a problem with the clock
• Would be problematical for boot anyway,
since thread of execution goes outside of
Java (into C++ and kernel) for lots of
important operations
Ftrace
• I could have really used ftrace for some
things
̵ Like to see page faults intermingled with
system calls
• Kernel version for EVM (2.6.29) didn’t
support it
• Should be usable in future version of
Android (Froyo is at 2.6.32)
• NOTE: ARM is missing function graph
tracing
̵ But there’s a fix
̵ See http://elinux.org/Ftrace_Function_Graph_ARM
Measurement results
• Stopwatch
• Grabserial
• Printk times
• Strace
• Bootchart
• Logcat
Stopwatch results
ADP1 4 32 57 39
Nexus 1 3.5 20 36 79
EVM 17* 37 62 45
• Interesting init_calls:
̵ ip_auto_config = 1.51 seconds
̵ ehci_hcd_init = .1 seconds
• Usually more on real hardware
̵ Various omap init routines = .86 seconds