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">
6 This file is part of systemd.
8 Copyright 2012 Lennart Poettering
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.
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.
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/>.
24 <refentry id="systemd-analyze">
27 <title>systemd-analyze</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>systemd-analyze</refentrytitle>
42 <manvolnum>1</manvolnum>
46 <refname>systemd-analyze</refname>
47 <refpurpose>Analyze system boot-up performance</refpurpose>
52 <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> time</command>
55 <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> blame </command>
58 <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> plot <arg choice="opt">> file.svg</arg></command>
61 <command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> dot <arg choice="opt">pattern...</arg> </command>
66 <title>Description</title>
68 <para><command>systemd-analyze</command> may be used
69 to determine system boot-up performance of the current
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>
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>
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>
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>
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>
111 <para>If no command is passed <command>systemd-analyze
112 time</command> is implied.</para>
117 <title>Options</title>
119 <para>The following options are understood:</para>
123 <term><option>-h</option></term>
124 <term><option>--help</option></term>
126 <listitem><para>Prints a short help
127 text and exits.</para></listitem>
131 <term><option>--user</option></term>
133 <listitem><para>Shows performance data
134 of user sessions instead of the system
135 manager.</para></listitem>
139 <term><option>--order</option></term>
140 <term><option>--require</option></term>
142 <listitem><para>When used in
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>
165 <term><option>--from-pattern=</option></term>
166 <term><option>--to-pattern=</option></term>
168 <listitem><para>When used in
170 <command>dot</command> command (see
171 above), selects which relationships
172 are shown in the dependency graph.
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>
188 <title>Exit status</title>
190 <para>On success 0 is returned, a non-zero failure
191 code otherwise.</para>
195 <title>See Also</title>
197 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
198 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>