This page has materials to support Tim Bird's presentation "Tools and Techniques for Reducing Bootup Time".
This presentation was first delivered at the Embedded Linux Conference, Europe, in November of 2008.

Contents

safe_to_call_sched_clock.patch

This patch was used by Tim for several kernel versions, to address problems with the
printk-times feature on ARM platforms. It is very simple, and consists of just adding a
flag to avoid calling sched_clock() too early.

This patch appears (as of kernel version 2.6.27) to be obsolete. The 2.6.27 kernel
now calls cpu_clock() for printk_times. This uses a similar mechanism to flag when it is
safe to call.

grabserial

"grabserial" is a simple program to grab and display data from a specified serial port.
It can place a timestamp on each line received, which makes it useful for reporting
timing of events seen on a booting system's serial console output.

See Grabserial for detailed information, sample output and download instructions.

Tim's quick and dirty process trace

Process trace is Tim's quick and dirty method of tracing early boot processes.
As I write this (Oct, 2008), an boot tracer is being written and is available in
the fastboot git tree on kernel.org. This will likely be mainlined, and should
supercede this work. However, this tool has worked for me.

This is really quite simple. The "system" consists of a patch which adds printks
to fork, exec and exit, and a script which parses those printks and prints information
about the reported processes.

Patch Download

Usage

To use this patch, apply it to your kernel, with something like:

cd linux_src ; patch -p1 </path/to/patch/tims_process_trace.patch

You should also increase the size of your kernel log buffer (this is
the buffer where printk messages are stored in the kernel.) I recommend
a value of 18, which is 256K. This is CONFIG_lOG_BUF_SHIFT, and is found
in the "General Setup" menu of the kernel configuration system.

Compile, build and install your kernel. Boot the kernel.

After booting, use dmesg to collect the messages. Note that you need to specify
the (increased) size of the message buffer with the '-s' option:

dmesg -s 256000 >/tmp/bootlog.txt

Now, process the bootlog with the scripts/procgraph program.

linux_src/scripts/proc_graph /tmp/bootlog.txt

This script is somewhat badly named. It does not generate a graph, but
just allows you to sort the processes by various attributes (start time,
duration, idle time, etc.) Actual graphing should be added "real soon now".