1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
7 This file is part of systemd.
9 Copyright 2012 Intel Corporation
12 Auke Kok <auke-jan.h.kok@intel.com>
13 William Giokas <1007380@gmail.com>
15 systemd is free software; you can redistribute it and/or modify it
16 under the terms of the GNU Lesser General Public License as published by
17 the Free Software Foundation; either version 2.1 of the License, or
18 (at your option) any later version.
20 systemd is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 Lesser General Public License for more details.
25 You should have received a copy of the GNU Lesser General Public License
26 along with systemd; If not, see <http://www.gnu.org/licenses/>.
29 <refentry id="systemd-bootchart" conditional='ENABLE_BOOTCHART'>
31 <title>systemd-bootchart</title>
32 <productname>systemd</productname>
36 <contrib>Developer</contrib>
37 <firstname>Auke</firstname>
38 <surname>Kok</surname>
39 <email>auke-jan.h.kok@intel.com</email>
45 <refentrytitle>systemd-bootchart</refentrytitle>
46 <manvolnum>1</manvolnum>
50 <refname>systemd-bootchart</refname>
51 <refpurpose>Boot performance analysis graphing tool</refpurpose>
55 <title>Description</title>
57 <para>systemd-bootchart is a tool used to analyze a boot sequence.
58 It collects system information pertaining to the CPU and disk load, as
59 well as per-process information, and then creates a chart with this
60 information. Usually it is invoked by setting the init to
61 <filename>systemd-bootchart</filename> on the kernel command line. It
62 be run after boot to analyze running processes, though it is recommended
63 to use the <option>--rel</option> switch when doing this.</para>
65 <para>After collecting a certain amount of data (default: 20 seconds) it
66 will write the SVG chart to <filename>/run/log</filename>. This chart
67 can be used to find problems in the start up sequence and where these
68 problems exist. It is essentially a more detailed version of the
69 systemd-analyze plot function.</para>
74 <title>Invocation</title>
76 <para>systemd-bootchart can be invoked in several different ways:</para>
81 <term><emphasis>Kernel invocation</emphasis></term>
82 <listitem><para>The kernel can invoke systemd-bootchart
83 instead of the init process. In itself, systemd-bootchart
84 will invoke <filename>/sbin/init</filename> if invoked in
85 this manner.</para></listitem>
89 <term><emphasis>Started as a standalone program</emphasis></term>
90 <listitem><para>One can execute systemd-bootchart as
91 normal application from the commandline. In this mode
92 it is highly recommended to pass the "-r" flag in order
93 to not graph the time elapsed since boot and before
94 systemd-bootchart was started, as it may result in
95 extremely large graphs.
102 <title>Options</title>
104 <para>These options can be set globally in the <filename>/etc/systemd/bootchart.conf</filename>
110 <term><option>-n</option></term>
111 <term><option>--sample N</option></term>
112 <listitem><para>Specify the amount of samples, N, to
113 record total before bootchart exits. Each sample will
114 record at intervals defined by --freq.</para></listitem>
118 <term><option>-f</option></term>
119 <term><option>--freq N</option></term>
120 <listitem><para>Specify the sample log frequency, N.
121 This can be a fractional number, but must be larger than
122 0.0. Most systems can cope with values under 25-50 without
123 creating too much overhead.</para></listitem>
127 <term><option>-r</option></term>
128 <term><option>--rel</option></term>
129 <listitem><para>Use relative times instead of absolute
130 times. This is useful for using bootchart at post-boot
131 time to profile an already booted system, otherwise the
132 graph would become extremely large. If set, the
133 horizontal axis starts at the first recorded sample
134 instead of time=0.0.</para></listitem>
138 <term><option>-F</option></term>
139 <term><option>--filter</option></term>
140 <listitem><para>Disable filtering of tasks tasks that
141 did not contribute significantly to the boot. Processes
142 that are too short-lived (only seen in one sample) or
143 that do not consume any significant CPU time (less than
144 0.001sec) will not be displayed in the output graph.
149 <term><option>-o</option></term>
150 <term><option>--output [path]</option></term>
151 <listitem><para>Configures the output folder for writing
152 the graphs. By default, bootchart writes the graphs to
153 <filename>/run/log</filename>.</para></listitem>
157 <term><option>-i</option></term>
158 <term><option>--init [path]</option></term>
159 <listitem><para>Set init binary to run. Defaults to
160 <filename>/sbin/init</filename>.
165 <term><option>-p</option></term>
166 <term><option>--pss</option></term>
167 <listitem><para>Enable logging and graphing
168 of processes PSS memory consumption.</para></listitem>
172 <term><option>-e</option></term>
173 <term><option>--entropy</option></term>
174 <listitem><para>Enable logging and graphing
175 of the kernel random entropy pool size.</para></listitem>
179 <term><option>-x</option></term>
180 <term><option>--scale-x N</option></term>
181 <listitem><para>Horizontal scaling factor for all variable
182 graph components.</para></listitem>
186 <term><option>-y</option></term>
187 <term><option>--scale-y N</option></term>
188 <listitem><para>Vertical scaling factor for all variable
189 graph components.</para></listitem>
198 <title>Output</title>
200 <para>systemd-bootchart generates SVG graphs. In order to render these
201 on a graphical display any SVG capable viewer can be used. It should be
202 noted that the SVG render engines in most browsers (including Chrome
203 and Firefox) are many times faster than dedicated graphical applications
204 like Gimp and Inkscape. Just point your browser at "file:///run/log"!
209 <title>History</title>
211 <para>This version of bootchart was implemented from scratch, but inspired
212 by former bootchart incantations:</para>
216 <term><emphasis>Original bash</emphasis></term>
217 <listitem><para>The original bash/shell code implemented
218 bootchart. This version created a compressed tarball for
219 processing with external applications. This version did
220 not graph anything, only generated data.</para></listitem>
224 <term><emphasis>Ubuntu C Implementation</emphasis></term>
225 <listitem><para>This version replaced the shell version with
226 a fast and efficient data logger, but also did not graph
227 the data.</para></listitem>
231 <term><emphasis>Java bootchart</emphasis></term>
232 <listitem><para>This was the original graphing application
233 for charting the data, written in java.</para></listitem>
237 <term><emphasis>pybootchartgui.py</emphasis></term>
238 <listitem><para>pybootchart created a graph from the data
239 collected by either the bash or C version.</para></listitem>
243 <para>The version of bootchart you are using now combines both the data
244 collection and the charting into a single application, making it more
245 efficient and simpler. There are no longer any timing issues with the data
246 collector and the grapher, as the graphing cannot be run until the data
247 has been collected. Also, the data kept in memory is reduced to the absolute
248 minimum needed.</para>
254 <title>See Also</title>
256 <citerefentry><refentrytitle>bootchart.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
262 <para>For bugs, please contact the author or current maintainer:</para>
264 <term>Auke Kok</term>
265 <term><emphasis>auke-jan.h.kok@intel.com</emphasis></term>