Bootchart

From CLFS-HINTS

Jump to: navigation, search

Bootchart is a nifty little logging utility that you can use to monitor the performance of your boot process.

Contents

Theory of Operation

When bootchartd is started by the kernel, it will first start boot logging in background and then exec /sbin/init or an alternative init process. The boot logger will mount a tmpfs file system for log file storage and wait for /proc to be mounted. It will then run several logging functions in parallel and wait for the boot process to end (i.e. one of the predefined processes for runlevels 2, 3 or 5 is running).

The file /var/log/bootchart.tgz can be rendered to produce a png, svg, or eps of the boot process. The bootchart.tgz file can be rendered with the JAR file bootchart.jar. Alternatively, upload the log tarball to the renderer web service.

Other Uses of Bootchart

In addition to the boot process, the bootchartd logger may also be used to profile a running system or specific applications. This may performed by regular users as well, by using the following procedure:

Copy the default bootchartd configuration file locally:

cp /etc/bootchartd.conf /home/weibullguy/tmp/

Edit /home/weibullguy/tmp/bootchartd.conf and replace the BOOTLOG_DEST value with a directory you have write permissions.

BOOTLOG_DEST=/home/weibullguy/tmp/bootchart.tgz

Run bootchartd from within /home/weibullguy/tmp/, profiling the system in general or a specific application:

Profile A Running System

Think of creating a graphical top output, to profile the system in general:

/sbin/bootchartd start; sleep 5; /sbin/bootchartd stop

Render the generated log file:

java -jar /opt/jdk/lib/bootchart.jar /home/weibullguy/tmp/bootchart.tgz

This will produce an output similar to this one.

Profile A Specific Application

To profile a specific application:

/sbin/bootchartd start devhelp

Render the generated log file:

java -jar /opt/jdk/lib/bootchart.jar /home/weibullguy/tmp/bootchart.tgz

This will produce an output similar to this one.

Personal tools