Linux Kernel startup time analysis

Source: Internet
Author: User

1. First modify the bootargs of the kernel and add the following content to the bootargs:


  1. Printk. Time = yInitcall_debug

The modified bootargs is as follows:

  1. 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:

  1. Kernel hacking
  2. ---> 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:
 

  1. $ Kernel/scripts/show_delta LOG_FILE> boot_time_info

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.