systemd/man/systemd-bootchart.html
2015-02-17 11:22:16 +01:00

125 lines
14 KiB
HTML

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-bootchart</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</span><hr><div class="refentry"><a name="systemd-bootchart"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-bootchart — Boot performance graphing tool</p></div><div class="refsect1"><a name="idm140035128140592"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p>
<span class="command"><strong>systemd-bootchart</strong></span> is a tool, usually run at
system startup, that collects the CPU load, disk load, memory
usage, as well as per-process information from a running system.
Collected results are output as an SVG graph. Normally,
systemd-bootchart is invoked by the kernel by passing
<code class="option">init=<code class="filename">/usr/lib/systemd/systemd-bootchart</code></code>
on the kernel command line. systemd-bootchart will then fork the
real init off to resume normal system startup, while monitoring
and logging startup information in the background.
</p><p>
After collecting a certain amount of data (usually 15-30
seconds, default 20 s) the logging stops and a graph is
generated from the logged information. This graph contains vital
clues as to which resources are being used, in which order, and
where possible problems exist in the startup sequence of the
system. It is essentially a more detailed version of the
<span class="command"><strong>systemd-analyze plot</strong></span> function.
</p><p>
Of course, bootchart can also be used at any moment in time to
collect and graph some data for an amount of time. It is
recommended to use the <code class="option">--rel</code> switch in this
case.
</p><p>
Bootchart does not require root privileges, and will happily run
as a normal user.
</p><p>
Bootchart graphs are by default written time-stamped in
<code class="filename">/run/log</code> and saved to the journal with
<code class="varname">MESSAGE_ID=9f26aa562cf440c2b16c773d0479b518</code>.
Journal field <code class="varname">BOOTCHART=</code> contains the
bootchart in SVG format.
</p></div><div class="refsect1"><a name="idm140035128681840"></a><h2 id="Invocation">Invocation<a class="headerlink" title="Permalink to this headline" href="#Invocation"></a></h2><p><span class="command"><strong>systemd-bootchart</strong></span> can be invoked in several different ways:</p><div class="variablelist"><dl class="variablelist"><dt id="Kernel invocation"><span class="term"><span class="emphasis"><em>Kernel invocation</em></span></span><a class="headerlink" title="Permalink to this term" href="#Kernel%20invocation"></a></dt><dd><p>The kernel can invoke
<span class="command"><strong>systemd-bootchart</strong></span> instead of the init
process. In turn, <span class="command"><strong>systemd-bootchart</strong></span> will
invoke <span class="command"><strong>/usr/lib/systemd/systemd</strong></span>.
</p></dd><dt id="Started as a standalone program"><span class="term"><span class="emphasis"><em>Started as a standalone program</em></span></span><a class="headerlink" title="Permalink to this term" href="#Started%20as%20a%20standalone%20program"></a></dt><dd><p>One can execute
<span class="command"><strong>systemd-bootchart</strong></span> as normal application
from the command line. In this mode it is highly recommended
to pass the <code class="option">-r</code> flag in order to not graph the
time elapsed since boot and before systemd-bootchart was
started, as it may result in extremely large graphs. The time
elapsed since boot might also include any time that the system
was suspended.</p></dd></dl></div></div><div class="refsect1"><a name="idm140035127220512"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options"></a></h2><p>These options can also be set in the
<code class="filename">/etc/systemd/bootchart.conf</code> file. See
<a href="http://man7.org/linux/man-pages/man5/bootchart.conf.5.html"><span class="citerefentry"><span class="refentrytitle">bootchart.conf</span>(5)</span></a>.
</p><div class="variablelist"><dl class="variablelist"><dt id="-h"><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#-h"></a></dt><dd><p><a name="help-text"></a>Print a short help text and exit.
</p></dd><dt id="-n"><span class="term"><code class="option">-n</code>, </span><span class="term"><code class="option">--sample <em class="replaceable"><code>N</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#-n"></a></dt><dd><p>Specify the number of samples,
<em class="replaceable"><code>N</code></em>, to record. Samples will be
recorded at intervals defined with <code class="option">--freq</code>.
</p></dd><dt id="-f"><span class="term"><code class="option">-f</code>, </span><span class="term"><code class="option">--freq <em class="replaceable"><code>f</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#-f"></a></dt><dd><p>Specify the sample log frequency, a positive
real <em class="replaceable"><code>f</code></em>, in Hz. Most systems can
cope with values up to 25-50 without creating too much
overhead.</p></dd><dt id="-r"><span class="term"><code class="option">-r</code>, </span><span class="term"><code class="option">--rel</code></span><a class="headerlink" title="Permalink to this term" href="#-r"></a></dt><dd><p>Use relative times instead of absolute times.
This is useful for using bootchart at post-boot time to
profile an already booted system. Without this option the
graph would become extremely large. If set, the horizontal
axis starts at the first recorded sample instead of time
0.0.</p></dd><dt id="-F"><span class="term"><code class="option">-F</code>, </span><span class="term"><code class="option">--no-filter</code></span><a class="headerlink" title="Permalink to this term" href="#-F"></a></dt><dd><p>Disable filtering of tasks that did not
contribute significantly to the boot. Processes that are too
short-lived (only seen in one sample) or that do not consume
any significant CPU time (less than 0.001 s) will not be
displayed in the output graph. </p></dd><dt id="-C"><span class="term"><code class="option">-C</code>, </span><span class="term"><code class="option">--cmdline</code></span><a class="headerlink" title="Permalink to this term" href="#-C"></a></dt><dd><p>Display the full command line with arguments
of processes, instead of only the process name.
</p></dd><dt id="-g"><span class="term"><code class="option">-g</code>, </span><span class="term"><code class="option">--control-group</code></span><a class="headerlink" title="Permalink to this term" href="#-g"></a></dt><dd><p>Display process control group
</p></dd><dt id="-o"><span class="term"><code class="option">-o</code>, </span><span class="term"><code class="option">--output <em class="replaceable"><code>path</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#-o"></a></dt><dd><p>Specify the output directory for the graphs.
By default, bootchart writes the graphs to
<code class="filename">/run/log</code>.</p></dd><dt id="-i"><span class="term"><code class="option">-i</code>, </span><span class="term"><code class="option">--init <em class="replaceable"><code>path</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#-i"></a></dt><dd><p>Use this init binary. Defaults to
<span class="command"><strong>/usr/lib/systemd/systemd</strong></span>.
</p></dd><dt id="-p"><span class="term"><code class="option">-p</code>, </span><span class="term"><code class="option">--pss</code></span><a class="headerlink" title="Permalink to this term" href="#-p"></a></dt><dd><p>Enable logging and graphing of processes' PSS
(Proportional Set Size) memory consumption. See
<code class="filename">filesystems/proc.txt</code> in the kernel
documentation for an explanation of this field.
</p></dd><dt id="-e"><span class="term"><code class="option">-e</code>, </span><span class="term"><code class="option">--entropy</code></span><a class="headerlink" title="Permalink to this term" href="#-e"></a></dt><dd><p>Enable logging and graphing of the kernel
random entropy pool size.</p></dd><dt id="-x"><span class="term"><code class="option">-x</code>, </span><span class="term"><code class="option">--scale-x <em class="replaceable"><code>N</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#-x"></a></dt><dd><p>Horizontal scaling factor for all variable
graph components.</p></dd><dt id="-y"><span class="term"><code class="option">-y</code>, </span><span class="term"><code class="option">--scale-y <em class="replaceable"><code>N</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#-y"></a></dt><dd><p>Vertical scaling factor for all variable graph
components.</p></dd></dl></div></div><div class="refsect1"><a name="idm140035127271808"></a><h2 id="Output">Output<a class="headerlink" title="Permalink to this headline" href="#Output"></a></h2><p><span class="command"><strong>systemd-bootchart</strong></span> generates SVG graphs.
In order to render those on a graphical display any SVG capable
viewer can be used. It should be noted that the SVG render engines
in most browsers (including Chrome and Firefox) are many times
faster than dedicated graphical applications like Gimp and
Inkscape. Just point your browser at
<a class="ulink" href="file:///run/log/" target="_top">file:///run/log/</a>!
</p></div><div class="refsect1"><a name="idm140035127033392"></a><h2 id="History">History<a class="headerlink" title="Permalink to this headline" href="#History"></a></h2><p>This version of bootchart was implemented from scratch, but
is inspired by former bootchart incantations:</p><div class="variablelist"><dl class="variablelist"><dt id="Original bash"><span class="term"><span class="emphasis"><em>Original bash</em></span></span><a class="headerlink" title="Permalink to this term" href="#Original%20bash"></a></dt><dd><p>The original bash/shell code implemented
bootchart. This version created a compressed tarball for
processing with external applications. This version did not
graph anything, only generated data.</p></dd><dt id="Ubuntu C Implementation"><span class="term"><span class="emphasis"><em>Ubuntu C Implementation</em></span></span><a class="headerlink" title="Permalink to this term" href="#Ubuntu%20C%20Implementation"></a></dt><dd><p>This version replaced the shell version with a
fast and efficient data logger, but also did not graph the
data.</p></dd><dt id="Java bootchart"><span class="term"><span class="emphasis"><em>Java bootchart</em></span></span><a class="headerlink" title="Permalink to this term" href="#Java%20bootchart"></a></dt><dd><p>This was the original graphing application for
charting the data, written in java.</p></dd><dt id="pybootchartgui.py"><span class="term"><span class="emphasis"><em>pybootchartgui.py</em></span></span><a class="headerlink" title="Permalink to this term" href="#pybootchartgui.py"></a></dt><dd><p>pybootchart created a graph from the data
collected by either the bash or C version.</p></dd></dl></div><p>The version of bootchart you are using now combines both the
data collection and the charting into a single application, making
it more efficient and simpler. There are no longer any timing
issues with the data collector and the grapher, as the graphing
cannot be run until the data has been collected. Also, the data
kept in memory is reduced to the absolute minimum needed.</p></div><div class="refsect1"><a name="idm140035128089024"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
<a href="http://man7.org/linux/man-pages/man5/bootchart.conf.5.html"><span class="citerefentry"><span class="refentrytitle">bootchart.conf</span>(5)</span></a>
</p></div><div class="refsect1"><a name="idm140035126652032"></a><h2 id="Bugs">Bugs<a class="headerlink" title="Permalink to this headline" href="#Bugs"></a></h2><p>systemd-bootchart does not get the model information for the
hard drive unless the root device is specified with
<code class="code">root=/dev/sdxY</code>. Using UUIDs or PARTUUIDs will boot
fine, but the hard drive model will not be added to the
chart.</p><p>For bugs, please contact the author and current maintainer:</p><table border="0" summary="Simple list" class="simplelist"><tr><td>Auke Kok <code class="email">&lt;<a class="email" href="mailto:auke-jan.h.kok@intel.com">auke-jan.h.kok@intel.com</a>&gt;</code></td></tr></table></div></div></body></html>