You are here

Boot profiling on the RaspberryPi with bootchart

Submitted by sjs205 on Sat, 02/09/2013 - 03:28

I have recently been playing with bootchart on my desktop and decided to try it out on the Raspberry Pi.

"Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process. Resource utilization and process information are collected during the boot process and are later rendered in a PNG, SVG or EPS encoded chart."http://www.bootchart.org/

Using bootchart on the desktop, one simply has to install (apt-get/yum) and then enable it by substituting bootchart binary for init in '/boot/menu.lst' or '/boot/grub2/grub.cfg' on the kernel command line, by changing:

init=/sbin/init

to:

init=/sbin/bootchartd

The process is similar with the Pi, however, due to some issues with both bootchart and the boot process with embedded devices, this can become a little more complicated, see the embedded Linux wiki on the subject. However, the guys over at Raspbian seem to have sorted these issues and as such, installation and setup is very easy. We install with:

sudo apt-get install bootchart

And then add the kernel command line parameters in the '/boot/cmdline.txt' file, simply append the following:

init=/sbin/bootchartd bootchart_init=/sbin/init

Once the setup is complete, restart the pi. Once it has restarted, login, and you should find a file called called 'bootchart.tgz' in your '/var/log' directory, this is the where bootchart stores all of the process information that it has logged during the boot process. This file can then converted to a diagram with the following command:

bootchart /var/log/bootchart.tgz

Once complete, either start a desktop session or ssh the resultant .png file out of there. It should look similar to the following: