Reprint: http://blog.csdn.net/yimiyangguang1314/article/details/8807096
1. First modify the kernel Bootargs and add the following in Bootargs:
- printk.time=y Initcall_debug
The Bootargs I used was modified as follows :
- Setenv Bootargs "Root=/dev/mtdblock2 rootfstype=yaffs2 init=/init console=ttysac2,115200 printk.time=yInitcall_ Debug"
This way the kernel will print out the startup time for each module when it starts:
printk.time=y represents the kernel print information that contains timestamps, how your kernel is not configured:
- Kernel Hacking
- --on printks
can be added printk.time=y kernel parameters, printing time information, If the option above is configured, you can add printk.time=y parameter.
Printk.time=y is suitable for viewing boot time information without recompiling the kernel.
initcall_debug The various module information loaded by the kernel, this option allows you to see the order in which the kernel loads each module, which modules are loaded by the kernel, which can be seen from the information. If your kernel system does not need to use a module, try not to load it, so that the kernel occupies the storage space, you can also speed up the kernel boot process.
kernel provides a "Show_delta" script, You can use this script to help us analyze the time-consuming situation of each module during kernel startup. Use the following method:
- $kernel/scripts/show_delta log_file > Boot_time_info
Linux Kernel boot Time analysis