]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-analyze.xml
man: xinclude --help/--version/--no-pager
[thirdparty/systemd.git] / man / systemd-analyze.xml
CommitLineData
359deb60
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<!--
6 This file is part of systemd.
7
8 Copyright 2012 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22-->
23
21ac6ff1
ZJS
24<refentry id="systemd-analyze"
25 xmlns:xi="http://www.w3.org/2001/XInclude">
359deb60
LP
26
27 <refentryinfo>
28 <title>systemd-analyze</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
bb150966
HH
38 <author>
39 <contrib>Developer</contrib>
40 <firstname>Harald</firstname>
41 <surname>Hoyer</surname>
42 <email>harald@redhat.com</email>
43 </author>
359deb60
LP
44 </authorgroup>
45 </refentryinfo>
46
47 <refmeta>
48 <refentrytitle>systemd-analyze</refentrytitle>
49 <manvolnum>1</manvolnum>
50 </refmeta>
51
52 <refnamediv>
53 <refname>systemd-analyze</refname>
54 <refpurpose>Analyze system boot-up performance</refpurpose>
55 </refnamediv>
56
57 <refsynopsisdiv>
58 <cmdsynopsis>
fa3868c6
ZJS
59 <command>systemd-analyze</command>
60 <arg choice="opt" rep="repeat">OPTIONS</arg>
61 <arg>time</arg>
359deb60
LP
62 </cmdsynopsis>
63 <cmdsynopsis>
fa3868c6
ZJS
64 <command>systemd-analyze</command>
65 <arg choice="opt" rep="repeat">OPTIONS</arg>
66 <arg choice="plain">blame</arg>
359deb60 67 </cmdsynopsis>
bb150966 68 <cmdsynopsis>
fa3868c6
ZJS
69 <command>systemd-analyze</command>
70 <arg choice="opt" rep="repeat">OPTIONS</arg>
71 <arg choice="plain">critical-chain</arg>
72 <arg choice="opt" rep="repeat"><replaceable>UNIT</replaceable></arg>
bb150966 73 </cmdsynopsis>
359deb60 74 <cmdsynopsis>
fa3868c6
ZJS
75 <command>systemd-analyze</command>
76 <arg choice="opt" rep="repeat">OPTIONS</arg>
77 <arg choice="plain">plot</arg>
78 <arg choice="opt">&gt; file.svg</arg>
359deb60 79 </cmdsynopsis>
1700761b 80 <cmdsynopsis>
fa3868c6
ZJS
81 <command>systemd-analyze</command>
82 <arg choice="opt" rep="repeat">OPTIONS</arg>
83 <arg choice="plain">dot</arg>
84 <arg choice="opt" rep="repeat"><replaceable>PATTERN</replaceable></arg>
a65615ca 85 <arg choice="opt">&gt; file.dot</arg>
1700761b 86 </cmdsynopsis>
9ea9d4cf
LP
87 <cmdsynopsis>
88 <command>systemd-analyze</command>
89 <arg choice="opt" rep="repeat">OPTIONS</arg>
90 <arg choice="plain">dump</arg>
91 </cmdsynopsis>
a65615ca
LP
92 <cmdsynopsis>
93 <command>systemd-analyze</command>
94 <arg choice="opt" rep="repeat">OPTIONS</arg>
95 <arg choice="plain">set-log-level</arg>
96 <arg choice="opt"><replaceable>LEVEL</replaceable></arg>
97 </cmdsynopsis>
359deb60
LP
98 </refsynopsisdiv>
99
100 <refsect1>
101 <title>Description</title>
102
103 <para><command>systemd-analyze</command> may be used
a65615ca
LP
104 to determine system boot-up performance statistics and
105 retrieve other state and tracing information from the
106 system and service manager.</para>
359deb60
LP
107
108 <para><command>systemd-analyze time</command>
109 prints the time spent in the kernel before
110 userspace has been reached, the time spent in the
111 initial RAM disk (initrd) before normal system
e9dd9f95 112 userspace has been reached, and the time normal system
359deb60
LP
113 userspace took to initialize. Note that these
114 measurements simply measure the time passed up to the
115 point where all system services have been spawned, but
116 not necessarily until they fully finished
117 initialization or the disk is idle.</para>
118
119 <para><command>systemd-analyze blame</command> prints
120 a list of all running units, ordered by the time they
121 took to initialize. This information may be used to
122 optimize boot-up times. Note that the output might be
123 misleading as the initialization of one service might
124 be slow simply because it waits for the initialization
125 of another service to complete.</para>
126
fa3868c6 127 <para><command>systemd-analyze critical-chain [<replaceable>UNIT...</replaceable>]</command>
e9dd9f95 128 prints a tree of the time-critical chain of units
fa3868c6
ZJS
129 (for each of the specified <replaceable>UNIT</replaceable>s
130 or for the default target otherwise).
bb150966
HH
131 The time after the unit is active or started is printed
132 after the "@" character. The time the unit takes to
133 start is printed after the "+" character.
134 Note that the output might be misleading as the
135 initialization of one service might depend on socket
136 activation and because of the parallel execution
137 of units.</para>
138
359deb60
LP
139 <para><command>systemd-analyze plot</command> prints
140 an SVG graphic detailing which system services have
141 been started at what time, highlighting the time they
142 spent on initialization.</para>
143
9ea9d4cf 144 <para><command>systemd-analyze dot</command> generates
816f25e8
LP
145 textual dependency graph description in dot format for
146 further processing with the GraphViz
1700761b
SP
147 <citerefentry><refentrytitle>dot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
148 tool. Use a command line like <command>systemd-analyze
816f25e8
LP
149 dot | dot -Tsvg > systemd.svg</command> to generate a
150 graphical dependency tree. Unless
1700761b 151 <option>--order</option> or <option>--require</option>
e9dd9f95 152 is passed, the generated graph will show both ordering
816f25e8
LP
153 and requirement dependencies. Optional pattern
154 globbing style specifications
155 (e.g. <filename>*.target</filename>) may be given at
156 the end. A unit dependency is included in the graph if
157 any of these patterns match either the origin or
158 destination node.</para>
e55933db 159
9ea9d4cf
LP
160 <para><command>systemd-analyze dump</command> outputs
161 a (usually very long) human-readable serialization of
162 the complete server state. Its format is subject to
163 change without notice and should not be parsed by
164 applications.</para>
165
a65615ca
LP
166 <para><command>systemd-analyze set-log-level
167 <replaceable>LEVEL</replaceable></command> changes the
168 current log level of the <command>systemd</command>
169 daemon to <replaceable>LEVEL</replaceable> (accepts
170 the same values as <option>--log-level=</option>
171 described in
172 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>).</para>
173
e9dd9f95 174 <para>If no command is passed, <command>systemd-analyze
359deb60
LP
175 time</command> is implied.</para>
176
177 </refsect1>
178
179 <refsect1>
180 <title>Options</title>
181
182 <para>The following options are understood:</para>
183
184 <variablelist>
359deb60
LP
185 <varlistentry>
186 <term><option>--user</option></term>
187
188 <listitem><para>Shows performance data
189 of user sessions instead of the system
190 manager.</para></listitem>
191 </varlistentry>
1700761b 192
3cd26e7c
LP
193 <varlistentry>
194 <term><option>--system</option></term>
195
196 <listitem><para>Shows performance data
197 of the system manager. This is the
198 implied default.</para></listitem>
199 </varlistentry>
200
201 <varlistentry>
202 <term><option>-H</option></term>
203 <term><option>--host=</option></term>
204
63ba209d 205 <listitem><para>Execute the operation
3cd26e7c
LP
206 remotely. Specify a hostname, or
207 username and hostname separated by
208 <literal>@</literal>, to connect
209 to. This will use SSH to talk to the
210 remote machine manager
211 instance.</para></listitem>
212 </varlistentry>
213
214 <varlistentry>
215 <term><option>-M</option></term>
216 <term><option>--machine=</option></term>
217
63ba209d 218 <listitem><para>Execute the operation on a
3cd26e7c
LP
219 local container. Specify a container
220 name to connect to.</para></listitem>
221 </varlistentry>
222
1700761b
SP
223 <varlistentry>
224 <term><option>--order</option></term>
225 <term><option>--require</option></term>
226
227 <listitem><para>When used in
228 conjunction with the
229 <command>dot</command> command (see
230 above), selects which dependencies are
231 shown in the dependency graph. If
79640424 232 <option>--order</option> is passed,
1700761b
SP
233 only dependencies of type
234 <varname>After=</varname> or
235 <varname>Before=</varname> are
236 shown. If <option>--require</option>
79640424 237 is passed, only dependencies of type
1700761b
SP
238 <varname>Requires=</varname>,
239 <varname>RequiresOverridable=</varname>,
240 <varname>Requisite=</varname>,
241 <varname>RequisiteOverridable=</varname>,
242 <varname>Wants=</varname> and
243 <varname>Conflicts=</varname> are
e9dd9f95 244 shown. If neither is passed, this shows
1700761b
SP
245 dependencies of all these
246 types.</para></listitem>
247 </varlistentry>
e55933db
ŁS
248
249 <varlistentry>
250 <term><option>--from-pattern=</option></term>
251 <term><option>--to-pattern=</option></term>
252
253 <listitem><para>When used in
254 conjunction with the
255 <command>dot</command> command (see
e9dd9f95 256 above), this selects which relationships
e55933db
ŁS
257 are shown in the dependency graph.
258 They both require
259 <citerefentry><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
260 patterns as arguments, which are
e9dd9f95
JSJ
261 matched against left-hand and
262 right-hand, respectively, nodes of a
e55933db 263 relationship. Each of these can be
e9dd9f95
JSJ
264 used more than once, which means a
265 unit name must match one of the given
e55933db
ŁS
266 values.</para></listitem>
267 </varlistentry>
bb150966
HH
268
269 <varlistentry>
270 <term><option>--fuzz=</option><replaceable>timespan</replaceable></term>
271
272 <listitem><para>When used in conjunction
273 with the <command>critical-chain</command>
274 command (see above), also show units, which
275 finished <replaceable>timespan</replaceable> earlier, than the
276 latest unit in the same level. The unit of
277 <replaceable>timespan</replaceable> is seconds
278 unless specified with a different unit,
e9dd9f95 279 e.g. "50ms".</para></listitem>
bb150966 280 </varlistentry>
9ea9d4cf 281
dfdebb1b
ZJS
282 <xi:include href="standard-options.xml" xpointer="help" />
283 <xi:include href="standard-options.xml" xpointer="version" />
284 <xi:include href="standard-options.xml" xpointer="no-pager" />
359deb60
LP
285 </variablelist>
286
287 </refsect1>
288
289 <refsect1>
290 <title>Exit status</title>
291
b040723e 292 <para>On success, 0 is returned, a non-zero failure
359deb60
LP
293 code otherwise.</para>
294 </refsect1>
295
816f25e8
LP
296 <refsect1>
297 <title>Examples</title>
298
299 <para>This plots all dependencies of any unit whose
909f413d 300 name starts with <literal>avahi-daemon.</literal>:</para>
816f25e8
LP
301
302 <programlisting>$ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg
303$ eog avahi.svg</programlisting>
304
305 <para>This plots the dependencies between all known target units:</para>
306
d83c224d 307 <programlisting>systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg
816f25e8
LP
308$ eog targets.svg</programlisting>
309
310
311 </refsect1>
312
21ac6ff1 313 <xi:include href="less-variables.xml" />
9ea9d4cf 314
359deb60
LP
315 <refsect1>
316 <title>See Also</title>
317 <para>
318 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
319 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
320 </para>
321 </refsect1>
322
323</refentry>