Difference between revisions of "Bootchart"

From eLinux.org
Jump to: navigation, search
m (move image from page 'Using_bootchartd_on_SH7785LCR_Board')
 
(19 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[http://www.bootchart.org/ Bootchart] is a tool for performance analysis and visualization of the Linux boot process. Resource utilization and  process information are collected during the user-space portion of the boot process and are later rendered in a PNG, SVG or EPS encoded chart.
+
[http://www.bootchart.org/ Bootchart] is a tool for performance analysis and visualization of the Linux boot process. Resource utilization and  process information are collected during the user-space portion of the boot process and are later rendered in a PNG, SVG or EPS encoded chart.  For embedded systems several developers have tried to use bootchart to analyze boot time, but problems arose.  There have been several efforts to modify bootchart to make it more useful for embedded development.
  
== Embedded use of Bootchart ==
+
== Research & Presentations ==
Several embedded developers have tried to use bootchart to analyze the boot time of embedded products, but
+
=== Timechart ===
there are some problems with using bootchart this way, and there have been several efforts to modify bootchart
+
to make it more useful for embedded situations.
+
  
See the following presentations on the topic:
+
* Tool introduced on [http://blog.fenrus.org/?p=5 Arjan Van de Ven's blog]
* [http://tree.celinuxforum.org/CelfPubWiki/JapanTechnicalJamboree16?action=AttachFile&do=get&target=bootchart-lite-en.pdf bootchart-lite-en.pdf] Presentation by Shuuji Miyake of Fujitsu Software Technologies Limited, about bootchart deficiencies in the embedded space, and some ideas for fixing them.
+
* Now available in the mainline Linux kernel. It uses the 'perf' infrastructure. Hence, you need a recent enough kernel (2.6.32 or later).
** also, a call for collaboration on a new project
+
* See [http://lxr.free-electrons.com/source/tools/perf/builtin-timechart.c tools/perf/builtin-timechart.c] and [http://lxr.free-electrons.com/source/tools/perf/Documentation/perf-timechart.txt tools/perf/Documentation/perf-timechart.txt] in the kernel sources for details.
* [http://tree.celinuxforum.org/CelfPubWiki/ELC2006Presentations?action=AttachFile&do=get&target=VisualizingResUsageDuringBoot.pdf Visualizing Resource Usage During Boot] Presentation on 'embootchart' by Matthew Klahn of Motorola, about bootchart deficiencies in the embedded space, and a program (unfortunately never published) to fix them.
+
 
 +
=== Bootchart-Lite ===
 +
* [http://tree.celinuxforum.org/CelfPubWiki/JapanTechnicalJamboree16?action=AttachFile&do=get&target=bootchart-lite-en.pdf bootchart-lite-en.pdf] Presentation by Shuuji Miyake of Fujitsu Software Technologies Limited, about bootchart deficiencies in the embedded space and ideas for fixing them.
 +
** Not sure this is related to bootchart-lite project on Google Code, below--that was [http://kerneltrap.org/mailarchive/openmoko-devel/2008/7/7/2372584/thread created by Fred Chien of OpenMoko].
 +
* [http://code.google.com/p/bootchart-lite/ Bootchart-lite Project Home]
 +
* <code> # Non-members may check out a read-only working copy anonymously over HTTP.<br/>
 +
svn checkout http://bootchart-lite.googlecode.com/svn/trunk/ bootchart-lite-read-only</code>
 +
 
 +
=== ubootchart ===
 +
 
 +
Like Bootchart Lite, an implementation of the ideas from "embootchart".
 +
 
 +
* [http://code.google.com/p/ubootchart/ ubootchart Project Home]
 +
* [http://roblog.sixbynine.org/?p=19 Initial blog post]
 +
 
 +
=== EmBootchart ===
 +
* [[Media:VisualizingResUsageDuringBoot.pdf|Visualizing Resource Usage During Boot]] - Presentation on 'embootchart' by Matthew Klahn and Moosa Muhammad of Motorola about bootchart deficiencies in the embedded space, and a program (unfortunately never published) to fix them.
 +
 
 +
=== BusyBox ===
 +
 
 +
Busybox has a C implementation of bootchartd. It compiles to less than 40k (static uclibc i386 build). It will be available in the busybox-1.17.0 release. Please send bug reports, improvements to busybox mailing list.
 +
 
 +
* [http://busybox.net/ Busybox Project Home]
 +
* [http://git.busybox.net/busybox/tree/init/bootchartd.c bootchartd applet code]
 +
 
 +
Usage: bootchartd start [PROG ARGS]|stop|init
 +
 +
Options:
 +
start: start background logging; with PROG, run PROG, then kill logging with USR1
 +
stop: send USR1 to all bootchartd processes
 +
init: start background logging; stop when getty/xdm is seen (for init scripts)
 +
Under PID 1: start background logging, then execute $bootchart_init, /init, /sbin/init
 +
This makes it possible to start bootchartd even before init by booting kernel with:
 +
init=/sbin/bootchartd bootchart_init=/path/to/regular/init
 +
 
 +
Note that if you're using an initramfs, you'll need
 +
rdinit=/sbin/bootchartd
 +
instead of
 +
init=/sbin/bootchartd
 +
 
 +
Note also that bootchartd tries to create a gzipped tarball, so you either need a full tar with gz support, or you need to enable FEATURE_SEAMLESS_GZ in busybox. If 'tar -z' is not working, bootchartd will not produce output.
 +
 
 +
==== To use ====
 +
To use this, capture the bootchart information using bootchartd, then transfer the information to your
 +
host machine, and use bootchart to produce a graphic chart of the boot sequence.
 +
 
 +
The host 'bootchart' provided by Ubuntu-based hosts uses [http://code.google.com/p/pybootchartgui/ pybootchartgui] to generate a graph from the collected data. However, that version of pybootchartgui does not work well with the data generated by busybox bootchartd. A newer project [https://github.com/mmeeks/bootchart bootchart2] has improved pybootchartgui and included it in their sources, and this works fine with busybox bootchartd data.
 +
 
 +
After downloading bootchart2 and running 'make', you can generate a graph (bootchart.png) with:
 +
  /path/to/bootchart2/pybootchartgui.py bootlog.tgz
 +
 
 +
An example graph, generated in a different way, is shown below:
 +
 
 +
[[File:Bootchart.png]]
  
 
== Related projects ==
 
== Related projects ==
 +
=== SystemTap Scripts ===
 
A related project is a set of [[System Tap]] scripts to provide information about boot time.
 
A related project is a set of [[System Tap]] scripts to provide information about boot time.
 
See [http://people.redhat.com/berrange/systemtap/bootprobe/ Bootprobe]
 
See [http://people.redhat.com/berrange/systemtap/bootprobe/ Bootprobe]
  
[[Category:Categories]]
+
=== Updated Fork ===
 +
 
 +
Bootchart has been forked and updated and can be found on github https://github.com/mmeeks/bootchart (Main changes: no java, better visualization)
 +
 
 +
Another fork (the same?) can be found here: [http://foo-projects.org/~sofar/bootchart/ Updated Bootchart]
 +
 
 +
[[Category:Boot Time]]
 +
[[Category:Measuring]]
 +
[[Category:Linux]]
 +
[[Category:Bootchart]]

Latest revision as of 17:22, 27 October 2013

Bootchart is a tool for performance analysis and visualization of the Linux boot process. Resource utilization and process information are collected during the user-space portion of the boot process and are later rendered in a PNG, SVG or EPS encoded chart. For embedded systems several developers have tried to use bootchart to analyze boot time, but problems arose. There have been several efforts to modify bootchart to make it more useful for embedded development.

Research & Presentations

Timechart

Bootchart-Lite

svn checkout http://bootchart-lite.googlecode.com/svn/trunk/ bootchart-lite-read-only

ubootchart

Like Bootchart Lite, an implementation of the ideas from "embootchart".

EmBootchart

  • Visualizing Resource Usage During Boot - Presentation on 'embootchart' by Matthew Klahn and Moosa Muhammad of Motorola about bootchart deficiencies in the embedded space, and a program (unfortunately never published) to fix them.

BusyBox

Busybox has a C implementation of bootchartd. It compiles to less than 40k (static uclibc i386 build). It will be available in the busybox-1.17.0 release. Please send bug reports, improvements to busybox mailing list.

Usage: bootchartd start [PROG ARGS]|stop|init

Options:
start: start background logging; with PROG, run PROG, then kill logging with USR1
stop: send USR1 to all bootchartd processes
init: start background logging; stop when getty/xdm is seen (for init scripts)
Under PID 1: start background logging, then execute $bootchart_init, /init, /sbin/init
This makes it possible to start bootchartd even before init by booting kernel with:
init=/sbin/bootchartd bootchart_init=/path/to/regular/init

Note that if you're using an initramfs, you'll need

rdinit=/sbin/bootchartd

instead of

init=/sbin/bootchartd

Note also that bootchartd tries to create a gzipped tarball, so you either need a full tar with gz support, or you need to enable FEATURE_SEAMLESS_GZ in busybox. If 'tar -z' is not working, bootchartd will not produce output.

To use

To use this, capture the bootchart information using bootchartd, then transfer the information to your host machine, and use bootchart to produce a graphic chart of the boot sequence.

The host 'bootchart' provided by Ubuntu-based hosts uses pybootchartgui to generate a graph from the collected data. However, that version of pybootchartgui does not work well with the data generated by busybox bootchartd. A newer project bootchart2 has improved pybootchartgui and included it in their sources, and this works fine with busybox bootchartd data.

After downloading bootchart2 and running 'make', you can generate a graph (bootchart.png) with:

 /path/to/bootchart2/pybootchartgui.py bootlog.tgz

An example graph, generated in a different way, is shown below:

Bootchart.png

Related projects

SystemTap Scripts

A related project is a set of System Tap scripts to provide information about boot time. See Bootprobe

Updated Fork

Bootchart has been forked and updated and can be found on github https://github.com/mmeeks/bootchart (Main changes: no java, better visualization)

Another fork (the same?) can be found here: Updated Bootchart