chiark / gitweb /
Spelling fixes
[elogind.git] / man / systemd-analyze.xml
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
24 <refentry id="systemd-analyze">
25
26         <refentryinfo>
27                 <title>systemd-analyze</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                         <author>
38                                 <contrib>Developer</contrib>
39                                 <firstname>Harald</firstname>
40                                 <surname>Hoyer</surname>
41                                 <email>harald@redhat.com</email>
42                         </author>
43                 </authorgroup>
44         </refentryinfo>
45
46         <refmeta>
47                 <refentrytitle>systemd-analyze</refentrytitle>
48                 <manvolnum>1</manvolnum>
49         </refmeta>
50
51         <refnamediv>
52                 <refname>systemd-analyze</refname>
53                 <refpurpose>Analyze system boot-up performance</refpurpose>
54         </refnamediv>
55
56         <refsynopsisdiv>
57                 <cmdsynopsis>
58                         <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> time</command>
59                 </cmdsynopsis>
60                 <cmdsynopsis>
61                         <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> blame </command>
62                 </cmdsynopsis>
63                 <cmdsynopsis>
64                         <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> critical-chain </command>
65                 </cmdsynopsis>
66                 <cmdsynopsis>
67                         <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> plot <arg choice="opt">&gt; file.svg</arg></command>
68                 </cmdsynopsis>
69                 <cmdsynopsis>
70                         <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> dot <arg choice="opt">pattern...</arg> </command>
71                 </cmdsynopsis>
72         </refsynopsisdiv>
73
74         <refsect1>
75                 <title>Description</title>
76
77                 <para><command>systemd-analyze</command> may be used
78                 to determine system boot-up performance of the current
79                 boot.</para>
80
81                 <para><command>systemd-analyze time</command>
82                 prints the time spent in the kernel before
83                 userspace has been reached, the time spent in the
84                 initial RAM disk (initrd) before normal system
85                 userspace has been reached and the time normal system
86                 userspace took to initialize. Note that these
87                 measurements simply measure the time passed up to the
88                 point where all system services have been spawned, but
89                 not necessarily until they fully finished
90                 initialization or the disk is idle.</para>
91
92                 <para><command>systemd-analyze blame</command> prints
93                 a list of all running units, ordered by the time they
94                 took to initialize. This information may be used to
95                 optimize boot-up times. Note that the output might be
96                 misleading as the initialization of one service might
97                 be slow simply because it waits for the initialization
98                 of another service to complete.</para>
99
100                 <para><command>systemd-analyze critical-chain</command>
101                 prints a tree of the time critical chain of units.
102                 The time after the unit is active or started is printed
103                 after the "@" character. The time the unit takes to
104                 start is printed after the "+" character.
105                 Note that the output might be misleading as the
106                 initialization of one service might depend on socket
107                 activation and because of the parallel execution
108                 of units.</para>
109
110                 <para><command>systemd-analyze plot</command> prints
111                 an SVG graphic detailing which system services have
112                 been started at what time, highlighting the time they
113                 spent on initialization.</para>
114
115                 <para><command>systemd-analyze dot</command> Generate
116                 textual dependency graph description in dot format for
117                 further processing with the GraphViz
118                 <citerefentry><refentrytitle>dot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
119                 tool. Use a command line like <command>systemd-analyze
120                 dot | dot -Tsvg > systemd.svg</command> to generate a
121                 graphical dependency tree. Unless
122                 <option>--order</option> or <option>--require</option>
123                 is passed the generated graph will show both ordering
124                 and requirement dependencies. Optional pattern
125                 globbing style specifications
126                 (e.g. <filename>*.target</filename>) may be given at
127                 the end. A unit dependency is included in the graph if
128                 any of these patterns match either the origin or
129                 destination node.</para>
130
131                 <para>If no command is passed <command>systemd-analyze
132                 time</command> is implied.</para>
133
134         </refsect1>
135
136         <refsect1>
137                 <title>Options</title>
138
139                 <para>The following options are understood:</para>
140
141                 <variablelist>
142                         <varlistentry>
143                                 <term><option>-h</option></term>
144                                 <term><option>--help</option></term>
145
146                                 <listitem><para>Prints a short help
147                                 text and exits.</para></listitem>
148                         </varlistentry>
149
150                         <varlistentry>
151                                 <term><option>--user</option></term>
152
153                                 <listitem><para>Shows performance data
154                                 of user sessions instead of the system
155                                 manager.</para></listitem>
156                         </varlistentry>
157
158                         <varlistentry>
159                                 <term><option>--order</option></term>
160                                 <term><option>--require</option></term>
161
162                                 <listitem><para>When used in
163                                 conjunction with the
164                                 <command>dot</command> command (see
165                                 above), selects which dependencies are
166                                 shown in the dependency graph. If
167                                 <option>--order</option> is passed
168                                 only dependencies of type
169                                 <varname>After=</varname> or
170                                 <varname>Before=</varname> are
171                                 shown. If <option>--require</option>
172                                 is passed only dependencies of type
173                                 <varname>Requires=</varname>,
174                                 <varname>RequiresOverridable=</varname>,
175                                 <varname>Requisite=</varname>,
176                                 <varname>RequisiteOverridable=</varname>,
177                                 <varname>Wants=</varname> and
178                                 <varname>Conflicts=</varname> are
179                                 shown. If neither is passed, shows
180                                 dependencies of all these
181                                 types.</para></listitem>
182                         </varlistentry>
183
184                         <varlistentry>
185                                 <term><option>--from-pattern=</option></term>
186                                 <term><option>--to-pattern=</option></term>
187
188                                 <listitem><para>When used in
189                                 conjunction with the
190                                 <command>dot</command> command (see
191                                 above), selects which relationships
192                                 are shown in the dependency graph.
193                                 They both require
194                                 <citerefentry><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
195                                 patterns as arguments, which are
196                                 matched against lefthand and
197                                 righthand, respectively, nodes of a
198                                 relationship. Each of these can be
199                                 used more than once which means a
200                                 unit name must match one of given
201                                 values.</para></listitem>
202                         </varlistentry>
203
204                         <varlistentry>
205                                 <term><option>--fuzz=</option><replaceable>timespan</replaceable></term>
206
207                                 <listitem><para>When used in conjunction
208                                 with the <command>critical-chain</command>
209                                 command (see above), also show units, which
210                                 finished <replaceable>timespan</replaceable> earlier, than the
211                                 latest unit in the same level. The unit of
212                                 <replaceable>timespan</replaceable> is seconds
213                                 unless specified with a different unit,
214                                 i.e. "50ms".</para></listitem>
215                         </varlistentry>
216                 </variablelist>
217
218         </refsect1>
219
220         <refsect1>
221                 <title>Exit status</title>
222
223                 <para>On success 0 is returned, a non-zero failure
224                 code otherwise.</para>
225         </refsect1>
226
227         <refsect1>
228                 <title>Examples</title>
229
230                 <para>This plots all dependencies of any unit whose
231                 name starts with "<literal>avahi-daemon.</literal>":</para>
232
233                 <programlisting>$ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg
234 $ eog avahi.svg</programlisting>
235
236                 <para>This plots the dependencies between all known target units:</para>
237
238                 <programlisting>systemd-analyze dot --to-pattern='*.target' --from-patter='*.target' | dot -Tsvg > targets.svg
239 $ eog targets.svg</programlisting>
240
241
242         </refsect1>
243
244         <refsect1>
245                 <title>See Also</title>
246                 <para>
247                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
248                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
249                 </para>
250         </refsect1>
251
252 </refentry>