Important: You are required to change your passwords used for Gentoo services and set an email address for your Wiki account if you haven't done so. See the full announcement and Wiki email policy change for more information.

Bootchart2

From Gentoo Wiki
Jump to: navigation, search

This script is run instead of init during the boot process after the kernel is loaded and measures the time during this process. It generates nice charts which show when each daemon started and stopped.

Installation

You can install app-benchmarks/bootchart2 with the following command:

root # emerge --ask app-benchmarks/bootchart2

Then add the daemon to the default runlevel. This is needed to stop the bootchart process and generate the image:

root # rc-update add bootchart2 default

USE Flags

→ Information about USE flags
USE flag Default Recommended Description
svg No Adds support for SVG (Scalable Vector Graphics)

Kernel

To get more verbose information:

Kernel configurationenable proc events

Device Drivers --->
    <*> Connector - unified userspace <-> kernelspace linker  --->
        [*]   Report process events to userspace
General setup  --->
    CPU/Task time and stats accounting -->
        -*- Export task/process statistics through netlink (EXPERIMENTAL)

Usage

How to enable bootchart2 during boot and access the generated charts.

Bootloader

  • For any GRUB based bootloader, the kernel commandline can be changed during boot by pressing e in the boot menu, then edit the kernel commandline and press F10 to boot with changed parameters. The following options should be added:
'initcall_debug' - append timing data to each initcall
'printk.time=y' - append timing data to each message during initialization
'init=/sbin/bootchartd' - replace the default command for initialization with /sbin/bootchartd to start our benchmark
Note
to use genkernel, replace init= with real_init=
  • To change the entry static for GRUB2 (bootchart on every boot):

In GRUB2 the parameters can be added to the variable GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.

Codekernel commandline

... initcall_debug printk.time=y init=/sbin/bootchartd ...

Then run:

root # grub2-mkconfig -o /boot/grub2/grub.cfg

pybootchartgui

Those are the options to view the chart. Per default the images are stored in /var/log/bootchart.tgz as a compressed tarball.

Codepybootchartgui --help

Usage: pybootchartgui [options] PATH, ..., PATH

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -i, --interactive     start in active mode
  -f FORMAT, --format=FORMAT
                        image format (png, svg, pdf); default format png
  -o PATH, --output=PATH
                        output path (file or directory) where charts are
                        stored
  -n, --no-prune        do not prune the process tree
  -q, --quiet           suppress informational messages
  -t, --boot-time       only display the boot time of the boot in text format
                        (stdout)
  --very-quiet          suppress all messages except errors
  --verbose             print all messages
  --profile             profile rendering of chart (only useful when in batch
                        mode indicated by -f)
  --show-pid            show process ids in the bootchart as 'processname
                        [pid]'
  --show-all            show all process information in the bootchart as
                        '/process/path/exe [pid] [args]'
  --crop-after=PROCESS  crop chart when idle after PROCESS is started
  --annotate=PROCESS    annotate position where PROCESS is started; can be
                        specified multiple times. To create a single
                        annotation when any one of a set of processes is
                        started, use commas to separate the names
  --annotate-file=FILENAME
                        filename to write annotation points to

Just running it without any arguments will generate a .png image of the bootchart in the current directory.

External resources