]>
Commit | Line | Data |
---|---|---|
83fdc450 | 1 | <?xml version='1.0'?> <!--*-nxml-*--> |
83fdc450 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
681eb9cf FB |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ |
4 | <!ENTITY % entities SYSTEM "custom-entities.ent" > | |
5 | %entities; | |
6 | ]> | |
83fdc450 AK |
7 | |
8 | <!-- | |
9 | This file is part of systemd. | |
10 | ||
11 | Copyright 2012 Intel Corporation | |
12 | ||
13 | Authors: | |
14 | Auke Kok <auke-jan.h.kok@intel.com> | |
57976066 | 15 | William Giokas <1007380@gmail.com> |
83fdc450 AK |
16 | |
17 | systemd is free software; you can redistribute it and/or modify it | |
18 | under the terms of the GNU Lesser General Public License as published by | |
19 | the Free Software Foundation; either version 2.1 of the License, or | |
20 | (at your option) any later version. | |
21 | ||
22 | systemd is distributed in the hope that it will be useful, but | |
23 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
25 | Lesser General Public License for more details. | |
26 | ||
27 | You should have received a copy of the GNU Lesser General Public License | |
28 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
29 | --> | |
30 | ||
dfdebb1b | 31 | <refentry id="systemd-bootchart" conditional='ENABLE_BOOTCHART' |
798d3a52 ZJS |
32 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
33 | ||
34 | <refentryinfo> | |
35 | <title>systemd-bootchart</title> | |
36 | <productname>systemd</productname> | |
37 | ||
38 | <authorgroup> | |
39 | <author> | |
40 | <contrib>Developer</contrib> | |
41 | <firstname>Auke</firstname> | |
42 | <surname>Kok</surname> | |
43 | <email>auke-jan.h.kok@intel.com</email> | |
44 | </author> | |
45 | </authorgroup> | |
46 | </refentryinfo> | |
47 | ||
48 | <refmeta> | |
49 | <refentrytitle>systemd-bootchart</refentrytitle> | |
50 | <manvolnum>1</manvolnum> | |
51 | </refmeta> | |
52 | ||
53 | <refnamediv> | |
54 | <refname>systemd-bootchart</refname> | |
55 | <refpurpose>Boot performance graphing tool</refpurpose> | |
56 | </refnamediv> | |
57 | ||
58 | <refsect1> | |
59 | <title>Description</title> | |
60 | <para> | |
61 | <command>systemd-bootchart</command> is a tool, usually run at | |
62 | system startup, that collects the CPU load, disk load, memory | |
63 | usage, as well as per-process information from a running system. | |
64 | Collected results are output as an SVG graph. Normally, | |
65 | systemd-bootchart is invoked by the kernel by passing | |
681eb9cf | 66 | <option>init=<filename>&rootlibexecdir;/systemd-bootchart</filename></option> |
798d3a52 ZJS |
67 | on the kernel command line. systemd-bootchart will then fork the |
68 | real init off to resume normal system startup, while monitoring | |
69 | and logging startup information in the background. | |
70 | </para> | |
71 | <para> | |
72 | After collecting a certain amount of data (usually 15-30 | |
73 | seconds, default 20 s) the logging stops and a graph is | |
74 | generated from the logged information. This graph contains vital | |
75 | clues as to which resources are being used, in which order, and | |
76 | where possible problems exist in the startup sequence of the | |
77 | system. It is essentially a more detailed version of the | |
78 | <command>systemd-analyze plot</command> function. | |
79 | </para> | |
80 | <para> | |
81 | Of course, bootchart can also be used at any moment in time to | |
82 | collect and graph some data for an amount of time. It is | |
83 | recommended to use the <option>--rel</option> switch in this | |
84 | case. | |
85 | </para> | |
86 | <para> | |
87 | Bootchart does not require root privileges, and will happily run | |
88 | as a normal user. | |
89 | </para> | |
90 | <para> | |
91 | Bootchart graphs are by default written time-stamped in | |
92 | <filename>/run/log</filename> and saved to the journal with | |
93 | <varname>MESSAGE_ID=9f26aa562cf440c2b16c773d0479b518</varname>. | |
94 | Journal field <varname>BOOTCHART=</varname> contains the | |
95 | bootchart in SVG format. | |
96 | </para> | |
97 | ||
98 | </refsect1> | |
99 | ||
100 | <refsect1> | |
101 | <title>Invocation</title> | |
102 | ||
103 | <para><command>systemd-bootchart</command> can be invoked in several different ways:</para> | |
104 | ||
105 | <variablelist> | |
106 | ||
107 | <varlistentry> | |
108 | <term><emphasis>Kernel invocation</emphasis></term> | |
109 | <listitem><para>The kernel can invoke | |
110 | <command>systemd-bootchart</command> instead of the init | |
111 | process. In turn, <command>systemd-bootchart</command> will | |
681eb9cf | 112 | invoke <command>&rootlibexecdir;/systemd</command>. |
798d3a52 ZJS |
113 | </para></listitem> |
114 | </varlistentry> | |
115 | ||
116 | <varlistentry> | |
117 | <term><emphasis>Started as a standalone program</emphasis></term> | |
118 | <listitem><para>One can execute | |
119 | <command>systemd-bootchart</command> as normal application | |
120 | from the command line. In this mode it is highly recommended | |
121 | to pass the <option>-r</option> flag in order to not graph the | |
122 | time elapsed since boot and before systemd-bootchart was | |
123 | started, as it may result in extremely large graphs. The time | |
124 | elapsed since boot might also include any time that the system | |
125 | was suspended.</para></listitem> | |
126 | </varlistentry> | |
127 | </variablelist> | |
128 | </refsect1> | |
129 | ||
130 | <refsect1> | |
131 | <title>Options</title> | |
132 | ||
133 | <para>These options can also be set in the | |
681eb9cf | 134 | <filename>&pkgsysconfdir;/bootchart.conf</filename> file. See |
798d3a52 ZJS |
135 | <citerefentry project='man-pages'><refentrytitle>bootchart.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. |
136 | </para> | |
137 | ||
138 | <variablelist> | |
139 | <xi:include href="standard-options.xml" xpointer="help" /> | |
140 | ||
141 | <varlistentry> | |
142 | <term><option>-n</option></term> | |
143 | <term><option>--sample <replaceable>N</replaceable></option></term> | |
144 | <listitem><para>Specify the number of samples, | |
145 | <replaceable>N</replaceable>, to record. Samples will be | |
146 | recorded at intervals defined with <option>--freq</option>. | |
147 | </para></listitem> | |
148 | </varlistentry> | |
149 | ||
150 | <varlistentry> | |
151 | <term><option>-f</option></term> | |
152 | <term><option>--freq <replaceable>f</replaceable></option></term> | |
153 | <listitem><para>Specify the sample log frequency, a positive | |
154 | real <replaceable>f</replaceable>, in Hz. Most systems can | |
155 | cope with values up to 25-50 without creating too much | |
156 | overhead.</para></listitem> | |
157 | </varlistentry> | |
158 | ||
159 | <varlistentry> | |
160 | <term><option>-r</option></term> | |
161 | <term><option>--rel</option></term> | |
162 | <listitem><para>Use relative times instead of absolute times. | |
163 | This is useful for using bootchart at post-boot time to | |
164 | profile an already booted system. Without this option the | |
165 | graph would become extremely large. If set, the horizontal | |
166 | axis starts at the first recorded sample instead of time | |
167 | 0.0.</para></listitem> | |
168 | </varlistentry> | |
169 | ||
170 | <varlistentry> | |
171 | <term><option>-F</option></term> | |
172 | <term><option>--no-filter</option></term> | |
173 | <listitem><para>Disable filtering of tasks that did not | |
174 | contribute significantly to the boot. Processes that are too | |
175 | short-lived (only seen in one sample) or that do not consume | |
176 | any significant CPU time (less than 0.001 s) will not be | |
177 | displayed in the output graph. </para></listitem> | |
178 | </varlistentry> | |
179 | ||
180 | <varlistentry> | |
181 | <term><option>-C</option></term> | |
182 | <term><option>--cmdline</option></term> | |
183 | <listitem><para>Display the full command line with arguments | |
184 | of processes, instead of only the process name. | |
185 | </para></listitem> | |
186 | </varlistentry> | |
187 | ||
188 | <varlistentry> | |
189 | <term><option>-g</option></term> | |
190 | <term><option>--control-group</option></term> | |
191 | <listitem><para>Display process control group | |
192 | </para></listitem> | |
193 | </varlistentry> | |
194 | ||
195 | <varlistentry> | |
196 | <term><option>-o</option></term> | |
197 | <term><option>--output <replaceable>path</replaceable></option></term> | |
198 | <listitem><para>Specify the output directory for the graphs. | |
199 | By default, bootchart writes the graphs to | |
200 | <filename>/run/log</filename>.</para></listitem> | |
201 | </varlistentry> | |
202 | ||
203 | <varlistentry> | |
204 | <term><option>-i</option></term> | |
205 | <term><option>--init <replaceable>path</replaceable></option></term> | |
206 | <listitem><para>Use this init binary. Defaults to | |
681eb9cf | 207 | <command>&rootlibexecdir;/systemd</command>. |
798d3a52 ZJS |
208 | </para></listitem> |
209 | </varlistentry> | |
210 | ||
211 | <varlistentry> | |
212 | <term><option>-p</option></term> | |
213 | <term><option>--pss</option></term> | |
214 | <listitem><para>Enable logging and graphing of processes' PSS | |
215 | (Proportional Set Size) memory consumption. See | |
216 | <filename>filesystems/proc.txt</filename> in the kernel | |
217 | documentation for an explanation of this field. | |
218 | </para></listitem> | |
219 | </varlistentry> | |
220 | ||
221 | <varlistentry> | |
222 | <term><option>-e</option></term> | |
223 | <term><option>--entropy</option></term> | |
224 | <listitem><para>Enable logging and graphing of the kernel | |
225 | random entropy pool size.</para></listitem> | |
226 | </varlistentry> | |
227 | ||
228 | <varlistentry> | |
229 | <term><option>-x</option></term> | |
230 | <term><option>--scale-x <replaceable>N</replaceable></option></term> | |
231 | <listitem><para>Horizontal scaling factor for all variable | |
232 | graph components.</para></listitem> | |
233 | </varlistentry> | |
234 | ||
235 | <varlistentry> | |
236 | <term><option>-y</option></term> | |
237 | <term><option>--scale-y <replaceable>N</replaceable></option></term> | |
238 | <listitem><para>Vertical scaling factor for all variable graph | |
239 | components.</para></listitem> | |
240 | </varlistentry> | |
241 | ||
242 | </variablelist> | |
243 | ||
244 | ||
245 | </refsect1> | |
246 | ||
247 | <refsect1> | |
248 | <title>Output</title> | |
249 | ||
250 | <para><command>systemd-bootchart</command> generates SVG graphs. | |
251 | In order to render those on a graphical display any SVG capable | |
252 | viewer can be used. It should be noted that the SVG render engines | |
253 | in most browsers (including Chrome and Firefox) are many times | |
254 | faster than dedicated graphical applications like Gimp and | |
255 | Inkscape. Just point your browser at | |
256 | <ulink url="file:///run/log/" />! | |
257 | </para> | |
258 | </refsect1> | |
259 | ||
260 | <refsect1> | |
261 | <title>History</title> | |
262 | ||
263 | <para>This version of bootchart was implemented from scratch, but | |
264 | is inspired by former bootchart incantations:</para> | |
265 | ||
266 | <variablelist> | |
267 | <varlistentry> | |
268 | <term><emphasis>Original bash</emphasis></term> | |
269 | <listitem><para>The original bash/shell code implemented | |
270 | bootchart. This version created a compressed tarball for | |
271 | processing with external applications. This version did not | |
272 | graph anything, only generated data.</para></listitem> | |
273 | </varlistentry> | |
274 | ||
275 | <varlistentry> | |
276 | <term><emphasis>Ubuntu C Implementation</emphasis></term> | |
277 | <listitem><para>This version replaced the shell version with a | |
278 | fast and efficient data logger, but also did not graph the | |
279 | data.</para></listitem> | |
280 | </varlistentry> | |
281 | ||
282 | <varlistentry> | |
283 | <term><emphasis>Java bootchart</emphasis></term> | |
284 | <listitem><para>This was the original graphing application for | |
285 | charting the data, written in java.</para></listitem> | |
286 | </varlistentry> | |
287 | ||
288 | <varlistentry> | |
289 | <term><emphasis>pybootchartgui.py</emphasis></term> | |
290 | <listitem><para>pybootchart created a graph from the data | |
291 | collected by either the bash or C version.</para></listitem> | |
292 | </varlistentry> | |
293 | </variablelist> | |
294 | ||
295 | <para>The version of bootchart you are using now combines both the | |
296 | data collection and the charting into a single application, making | |
297 | it more efficient and simpler. There are no longer any timing | |
298 | issues with the data collector and the grapher, as the graphing | |
299 | cannot be run until the data has been collected. Also, the data | |
300 | kept in memory is reduced to the absolute minimum needed.</para> | |
301 | ||
302 | </refsect1> | |
303 | ||
304 | <refsect1> | |
305 | <title>See Also</title> | |
306 | ||
307 | <para> | |
308 | <citerefentry project='man-pages'><refentrytitle>bootchart.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
309 | </para> | |
310 | </refsect1> | |
311 | ||
312 | <refsect1> | |
313 | <title>Bugs</title> | |
314 | ||
315 | <para>systemd-bootchart does not get the model information for the | |
316 | hard drive unless the root device is specified with | |
317 | <code>root=/dev/sdxY</code>. Using UUIDs or PARTUUIDs will boot | |
318 | fine, but the hard drive model will not be added to the | |
319 | chart.</para> | |
320 | <para>For bugs, please contact the author and current maintainer:</para> | |
321 | <simplelist> | |
322 | <member>Auke Kok <email>auke-jan.h.kok@intel.com</email></member> | |
323 | </simplelist> | |
324 | </refsect1> | |
83fdc450 AK |
325 | |
326 | </refentry> |