1. First modify the bootargs of the kernel and add the following content to the bootargs:
- Printk. Time = yInitcall_debug
The modified bootargs is as follows:
- Setenv bootargs "root =/dev/mtdblock2 rootfstype = yaffs2 init =/init console = ttysac2. 115200Printk. Time = y initcall_debug"
In this way, when the kernel is started, the startup time of each module is printed:
Printk. Time = y
Indicates that the kernel print information contains a timestamp. How does one configure your kernel:
- Kernel hacking
- ---> Show
Timing information on printks
You can add printk. Time = y in bootargs.
Kernel Parameters: print the time information. If the preceding options are configured, The printk. Time = y parameter is not added.
Printk. Time = y is applicable to viewing the startup time without re-compiling the kernel.
Initcall_debugPrint information about each module loaded by the kernel. You can see the order in which modules are loaded by the kernel, if your kernel system does not need to use a certain module, try not to load it into it. This will save the storage space occupied by the kernel and speed up the kernel startup process.
2.
Use the script in the kernel to analyze the startup time
A "show_delta" script is provided in the kernel to help us analyze the time consumption of each module when the kernel starts. The usage is as follows:
- $ Kernel/scripts/show_delta LOG_FILE> boot_time_info