chiark / gitweb /
systemd-analyze: filter dot output
[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                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>systemd-analyze</refentrytitle>
42                 <manvolnum>1</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd-analyze</refname>
47                 <refpurpose>Analyze system boot-up performance</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <cmdsynopsis>
52                         <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> time</command>
53                 </cmdsynopsis>
54                 <cmdsynopsis>
55                         <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> blame </command>
56                 </cmdsynopsis>
57                 <cmdsynopsis>
58                         <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> plot <arg choice="opt">&gt; file.svg</arg></command>
59                 </cmdsynopsis>
60                 <cmdsynopsis>
61                         <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> dot <arg choice="opt">pattern...</arg> </command>
62                 </cmdsynopsis>
63         </refsynopsisdiv>
64
65         <refsect1>
66                 <title>Description</title>
67
68                 <para><command>systemd-analyze</command> may be used
69                 to determine system boot-up performance of the current
70                 boot.</para>
71
72                 <para><command>systemd-analyze time</command>
73                 prints the time spent in the kernel before
74                 userspace has been reached, the time spent in the
75                 initial RAM disk (initrd) before normal system
76                 userspace has been reached and the time normal system
77                 userspace took to initialize. Note that these
78                 measurements simply measure the time passed up to the
79                 point where all system services have been spawned, but
80                 not necessarily until they fully finished
81                 initialization or the disk is idle.</para>
82
83                 <para><command>systemd-analyze blame</command> prints
84                 a list of all running units, ordered by the time they
85                 took to initialize. This information may be used to
86                 optimize boot-up times. Note that the output might be
87                 misleading as the initialization of one service might
88                 be slow simply because it waits for the initialization
89                 of another service to complete.</para>
90
91                 <para><command>systemd-analyze plot</command> prints
92                 an SVG graphic detailing which system services have
93                 been started at what time, highlighting the time they
94                 spent on initialization.</para>
95
96                 <para><command>systemd-analyze dot</command>
97                 Generate textual dependency graph description in dot
98                 format for further processing with the GraphViz
99                 <citerefentry><refentrytitle>dot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
100                 tool. Use a command line like <command>systemd-analyze
101                 dot | dot -Tsvg > systemd.svg</command> to generate
102                 a graphical dependency tree. Unless
103                 <option>--order</option> or <option>--require</option>
104                 is passed the generated graph will show both ordering
105                 and requirement dependencies.</para>
106
107                 <para>Optional patterns may be given at the end. The
108                 relationship is printed if any of these matches either
109                 lefthand or righthand node.</para>
110
111                 <para>If no command is passed <command>systemd-analyze
112                 time</command> is implied.</para>
113
114         </refsect1>
115
116         <refsect1>
117                 <title>Options</title>
118
119                 <para>The following options are understood:</para>
120
121                 <variablelist>
122                         <varlistentry>
123                                 <term><option>-h</option></term>
124                                 <term><option>--help</option></term>
125
126                                 <listitem><para>Prints a short help
127                                 text and exits.</para></listitem>
128                         </varlistentry>
129
130                         <varlistentry>
131                                 <term><option>--user</option></term>
132
133                                 <listitem><para>Shows performance data
134                                 of user sessions instead of the system
135                                 manager.</para></listitem>
136                         </varlistentry>
137
138                         <varlistentry>
139                                 <term><option>--order</option></term>
140                                 <term><option>--require</option></term>
141
142                                 <listitem><para>When used in
143                                 conjunction with the
144                                 <command>dot</command> command (see
145                                 above), selects which dependencies are
146                                 shown in the dependency graph. If
147                                 <option>--order</option> is passed
148                                 only dependencies of type
149                                 <varname>After=</varname> or
150                                 <varname>Before=</varname> are
151                                 shown. If <option>--require</option>
152                                 is passed only dependencies of type
153                                 <varname>Requires=</varname>,
154                                 <varname>RequiresOverridable=</varname>,
155                                 <varname>Requisite=</varname>,
156                                 <varname>RequisiteOverridable=</varname>,
157                                 <varname>Wants=</varname> and
158                                 <varname>Conflicts=</varname> are
159                                 shown. If neither is passed, shows
160                                 dependencies of all these
161                                 types.</para></listitem>
162                         </varlistentry>
163
164                         <varlistentry>
165                                 <term><option>--from-pattern=</option></term>
166                                 <term><option>--to-pattern=</option></term>
167
168                                 <listitem><para>When used in
169                                 conjunction with the
170                                 <command>dot</command> command (see
171                                 above), selects which relationships
172                                 are shown in the dependency graph.
173                                 They both require
174                                 <citerefentry><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
175                                 patterns as arguments, which are
176                                 matched against lefthand and
177                                 righthand, respectively, nodes of a
178                                 relationship. Each of these can be
179                                 used more than once which means a
180                                 unit name must match one of given
181                                 values.</para></listitem>
182                         </varlistentry>
183                 </variablelist>
184
185         </refsect1>
186
187         <refsect1>
188                 <title>Exit status</title>
189
190                 <para>On success 0 is returned, a non-zero failure
191                 code otherwise.</para>
192         </refsect1>
193
194         <refsect1>
195                 <title>See Also</title>
196                 <para>
197                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
198                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
199                 </para>
200         </refsect1>
201
202 </refentry>