systemd-analyze: filter dot output

Make "systemd-analyze dot" output only lines with units matching
given glob(7) patterns. Add --from-pattern and --to-pattern options.
Without any patterns all relationships are printed as before.

A relationship must match the follwing expression:

    (isempty(from) || from[0] || from[1] || .. || from[n]) &&
    (isempty(to) || to[0] || to[1] || .. || to[n]) &&
    (isempty(P) || P[0] || P[1] || ... || P[n])

where from[] and to[] are lists of patterns provided with subsequent
--from-pattern and --to-pattern respectively. P[] is a list of  additional
patterns provided after the "dot" subcommand.
This commit is contained in:
Łukasz Stelmach
2013-04-08 20:35:25 +02:00
committed by Lennart Poettering
parent b97caef538
commit e55933db18
2 changed files with 83 additions and 8 deletions
+25 -1
View File
@@ -58,7 +58,7 @@
<command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> plot <arg choice="opt">&gt; file.svg</arg></command>
</cmdsynopsis>
<cmdsynopsis>
<command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> dot </command>
<command>systemd-analyze <arg choice="opt" rep="repeat">OPTIONS</arg> dot <arg choice="opt">pattern...</arg> </command>
</cmdsynopsis>
</refsynopsisdiv>
@@ -104,6 +104,10 @@
is passed the generated graph will show both ordering
and requirement dependencies.</para>
<para>Optional patterns may be given at the end. The
relationship is printed if any of these matches either
lefthand or righthand node.</para>
<para>If no command is passed <command>systemd-analyze
time</command> is implied.</para>
@@ -156,6 +160,26 @@
dependencies of all these
types.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--from-pattern=</option></term>
<term><option>--to-pattern=</option></term>
<listitem><para>When used in
conjunction with the
<command>dot</command> command (see
above), selects which relationships
are shown in the dependency graph.
They both require
<citerefentry><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
patterns as arguments, which are
matched against lefthand and
righthand, respectively, nodes of a
relationship. Each of these can be
used more than once which means a
unit name must match one of given
values.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>