]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-analyze.xml
dbus-manager.c: log error, why switch-root is refused
[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
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>
1700761b 60 <cmdsynopsis>
e55933db 61 <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> dot <arg choice="opt">pattern...</arg> </command>
1700761b 62 </cmdsynopsis>
359deb60
LP
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
816f25e8
LP
96 <para><command>systemd-analyze dot</command> Generate
97 textual dependency graph description in dot format for
98 further processing with the GraphViz
1700761b
SP
99 <citerefentry><refentrytitle>dot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
100 tool. Use a command line like <command>systemd-analyze
816f25e8
LP
101 dot | dot -Tsvg > systemd.svg</command> to generate a
102 graphical dependency tree. Unless
1700761b
SP
103 <option>--order</option> or <option>--require</option>
104 is passed the generated graph will show both ordering
816f25e8
LP
105 and requirement dependencies. Optional pattern
106 globbing style specifications
107 (e.g. <filename>*.target</filename>) may be given at
108 the end. A unit dependency is included in the graph if
109 any of these patterns match either the origin or
110 destination node.</para>
e55933db 111
359deb60
LP
112 <para>If no command is passed <command>systemd-analyze
113 time</command> is implied.</para>
114
115 </refsect1>
116
117 <refsect1>
118 <title>Options</title>
119
120 <para>The following options are understood:</para>
121
122 <variablelist>
123 <varlistentry>
ecbd4565 124 <term><option>-h</option></term>
359deb60
LP
125 <term><option>--help</option></term>
126
127 <listitem><para>Prints a short help
128 text and exits.</para></listitem>
129 </varlistentry>
130
131 <varlistentry>
132 <term><option>--user</option></term>
133
134 <listitem><para>Shows performance data
135 of user sessions instead of the system
136 manager.</para></listitem>
137 </varlistentry>
1700761b
SP
138
139 <varlistentry>
140 <term><option>--order</option></term>
141 <term><option>--require</option></term>
142
143 <listitem><para>When used in
144 conjunction with the
145 <command>dot</command> command (see
146 above), selects which dependencies are
147 shown in the dependency graph. If
148 <option>--order</option> is passed
149 only dependencies of type
150 <varname>After=</varname> or
151 <varname>Before=</varname> are
152 shown. If <option>--require</option>
153 is passed only dependencies of type
154 <varname>Requires=</varname>,
155 <varname>RequiresOverridable=</varname>,
156 <varname>Requisite=</varname>,
157 <varname>RequisiteOverridable=</varname>,
158 <varname>Wants=</varname> and
159 <varname>Conflicts=</varname> are
160 shown. If neither is passed, shows
161 dependencies of all these
162 types.</para></listitem>
163 </varlistentry>
e55933db
ŁS
164
165 <varlistentry>
166 <term><option>--from-pattern=</option></term>
167 <term><option>--to-pattern=</option></term>
168
169 <listitem><para>When used in
170 conjunction with the
171 <command>dot</command> command (see
172 above), selects which relationships
173 are shown in the dependency graph.
174 They both require
175 <citerefentry><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
176 patterns as arguments, which are
177 matched against lefthand and
178 righthand, respectively, nodes of a
179 relationship. Each of these can be
180 used more than once which means a
181 unit name must match one of given
182 values.</para></listitem>
183 </varlistentry>
359deb60
LP
184 </variablelist>
185
186 </refsect1>
187
188 <refsect1>
189 <title>Exit status</title>
190
191 <para>On success 0 is returned, a non-zero failure
192 code otherwise.</para>
193 </refsect1>
194
816f25e8
LP
195 <refsect1>
196 <title>Examples</title>
197
198 <para>This plots all dependencies of any unit whose
199 name starts with "<literal>avahi-daemon.</literal>":</para>
200
201 <programlisting>$ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg
202$ eog avahi.svg</programlisting>
203
204 <para>This plots the dependencies between all known target units:</para>
205
206 <programlisting>systemd-analyze dot --to-pattern='*.target' --from-patter='*.target' | dot -Tsvg > targets.svg
207$ eog targets.svg</programlisting>
208
209
210 </refsect1>
211
359deb60
LP
212 <refsect1>
213 <title>See Also</title>
214 <para>
215 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
216 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
217 </para>
218 </refsect1>
219
220</refentry>