summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorChris Down <chris@chrisdown.name>2018-10-15 12:55:35 +0100
committerLennart Poettering <lennart@poettering.net>2018-10-23 14:26:51 +0200
commit3f1c1287a96dfc146ce894bd6bfff388cba0ab55 (patch)
tree15282aa532acccdb64d3165238311a7144879578 /man
parentf402ce827daf8556dc5ec058889c031a9dfd55a5 (diff)
downloadsystemd-3f1c1287a96dfc146ce894bd6bfff388cba0ab55.tar.gz
systemd-3f1c1287a96dfc146ce894bd6bfff388cba0ab55.tar.bz2
systemd-3f1c1287a96dfc146ce894bd6bfff388cba0ab55.zip
analyze: Add "timespan" command to dump time span in usec
This is useful for a couple of cases, I'm mostly interested in case #1: 1. Verifying "reasonable" values in a trivially scriptable way 2. Debugging unexpected time span parsing directly Test Plan: ``` % build/systemd-analyze timespan 20 Original: 20 μs: 20 Human: 20us % build/systemd-analyze timespan 20ms Original: 20ms μs: 20000 Human: 20ms % build/systemd-analyze timespan 20z Failed to parse time span '20z': Invalid argument ```
Diffstat (limited to 'man')
-rw-r--r--man/systemd-analyze.xml10
-rw-r--r--man/systemd.time.xml4
2 files changed, 14 insertions, 0 deletions
diff --git a/man/systemd-analyze.xml b/man/systemd-analyze.xml
index 7aa10fc68e..15e95b0c8f 100644
--- a/man/systemd-analyze.xml
+++ b/man/systemd-analyze.xml
@@ -106,6 +106,12 @@
<arg choice="plain">service-watchdogs</arg>
<arg choice="opt"><replaceable>BOOL</replaceable></arg>
</cmdsynopsis>
+ <cmdsynopsis>
+ <command>systemd-analyze</command>
+ <arg choice="opt" rep="repeat">OPTIONS</arg>
+ <arg choice="plain">timespan</arg>
+ <arg choice="plain" rep="repeat"><replaceable>SPAN</replaceable></arg>
+ </cmdsynopsis>
</refsynopsisdiv>
<refsect1>
@@ -253,6 +259,10 @@ NAutoVTs=8
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
The hardware watchdog is not affected by this setting.</para>
+ <para><command>systemd-analyze timespan</command> parses a time span and outputs the equivalent value in microseconds, and as a reformatted timespan.
+ The time span should adhere to the same syntax documented in <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
+ Values without associated magnitudes are parsed as seconds.</para>
+
<para>If no command is passed, <command>systemd-analyze
time</command> is implied.</para>
diff --git a/man/systemd.time.xml b/man/systemd.time.xml
index 15e1680b8d..24df5ab942 100644
--- a/man/systemd.time.xml
+++ b/man/systemd.time.xml
@@ -74,6 +74,10 @@
1y 12month
55s500ms
300ms20s 5day</programlisting>
+
+ <para>One can use the <command>timespan</command> command of
+ <citerefentry><refentrytitle>systemd-analyze</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ to normalise a textual time span for testing and validation purposes.</para>
</refsect1>
<refsect1>