Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling u-Boot/Kernel boot sequence

I am profiling the booting process of power PC board, what is the simplest way to profile the booting sequence ?

My first idea is to modify the u-boot/kernel code add printf/printk (using realtime device as reference) and print them on the console. However just printing them on the console may affect the time.

Any thoughts?

Regards, Robert.

like image 484
uzurpatorul Avatar asked May 01 '09 23:05

uzurpatorul


People also ask

What is kernel boot sequence?

The boot sequence starts when the computer is turned on, and is completed when the kernel is initialized and systemd is launched. The startup process then takes over and finishes the task of getting the Linux computer into an operational state. Overall, the Linux boot and startup process is fairly simple to understand.

How do I boot Linux kernel from boot?

The process of Uboot booting the kernel is to determine how to start the kernel by reading the bootcmd in the environment variable env. For example, uboot wants to read the kernel partition from the nand flash to the memory address 0x30007FC0 and start the kernel. You can use the following command: bootm 0x30007FC0.

How are the command line arguments passed to Linux kernel by the U-Boot bootloader )?

The short answer to that question is U-Boot, but the more precise answer is that the U-Boot boot loader passes the kernel command-line transparently to the Linux kernel using a feature known as atags from a U-Boot variable named bootargs.


2 Answers

There is a wonderful utility called bootchart which will give you a graphical representation of the boot process and tell you when each task started and how long it took to complete.

Check it out.

alt text
(source: bootchart.org)

like image 163
Robert S. Barnes Avatar answered Oct 06 '22 00:10

Robert S. Barnes


Everyone knows the best way to profile an u-boot is with sonar.

like image 20
Charlie Martin Avatar answered Oct 06 '22 00:10

Charlie Martin