<xi:include href="version-info.xml" xpointer="v255"/></listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--scale-svg=<replaceable>FACTOR</replaceable></option></term>
+
+ <listitem><para>When used with the <command>plot</command> command, the x-axis of the plot
+ can be stretched by FACTOR (default: 1.0).</para>
+
+ <xi:include href="version-info.xml" xpointer="v257"/></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--detailed</option></term>
+
+ <listitem><para>When used with the <command>plot</command> command, activation timestamps
+ details can be seen in SVG plot.</para>
+
+ <xi:include href="version-info.xml" xpointer="v257"/></listitem>
+ </varlistentry>
+
<xi:include href="standard-options.xml" xpointer="help" />
<xi:include href="standard-options.xml" xpointer="version" />
<xi:include href="standard-options.xml" xpointer="no-pager" />
elif __contains_word "$verb" ${VERBS[PLOT]}; then
if [[ $cur = -* ]]; then
- comps='--help --version --system --user --global --no-pager --json=off --json=pretty --json=short --table --no-legend'
+ comps='--help --version --system --user --global --no-pager --json=off --json=pretty --json=short --table --no-legend --scale-svg --detailed'
fi
elif __contains_word "$verb" ${VERBS[ARCHITECTURES]}; then
#include "unit-def.h"
#include "version.h"
-#define SCALE_X (0.1 / 1000.0) /* pixels per us */
+#define SCALE_X (0.1 * arg_svg_timescale / 1000.0) /* pixels per us */
#define SCALE_Y (20.0)
#define svg(...) printf(__VA_ARGS__)
svg("</text>\n"); \
} while (false)
+#define svg_timestamp(b, t, y) \
+ svg_text(b, t, y, "%u.%03us", (unsigned)((t) / USEC_PER_SEC), (unsigned)(((t) % USEC_PER_SEC) / USEC_PER_MSEC))
+
typedef struct HostInfo {
char *hostname;
svg_bar("generators", boot->generators_start_time, boot->generators_finish_time, y);
svg_bar("unitsload", boot->unitsload_start_time, boot->unitsload_finish_time, y);
svg_text(true, boot->userspace_time, y, "systemd");
+ if (arg_detailed_svg)
+ svg_timestamp(false, boot->userspace_time, y);
y++;
for (; u->has_data; u++)
RecursiveErrors arg_recursive_errors = _RECURSIVE_ERRORS_INVALID;
bool arg_man = true;
bool arg_generators = false;
+double arg_svg_timescale = 1.0;
+bool arg_detailed_svg = false;
char *arg_root = NULL;
static char *arg_image = NULL;
char *arg_security_policy = NULL;
" security review of the unit(s)\n"
" --unit=UNIT Evaluate conditions and asserts of unit\n"
" --table Output plot's raw time data as a table\n"
+ " --scale-svg=FACTOR Stretch x-axis of plot by FACTOR (default: 1.0)\n"
+ " --detailed Add more details to SVG plot,\n"
+ " e.g. show activation timestamps\n"
" -h --help Show this help\n"
" --version Show package version\n"
" -q --quiet Do not emit hints\n"
ARG_TABLE,
ARG_NO_LEGEND,
ARG_TLDR,
+ ARG_SCALE_FACTOR_SVG,
+ ARG_DETAILED_SVG,
};
static const struct option options[] = {
{ "no-legend", optional_argument, NULL, ARG_NO_LEGEND },
{ "tldr", no_argument, NULL, ARG_TLDR },
{ "mask", no_argument, NULL, 'm' },
+ { "scale-svg", required_argument, NULL, ARG_SCALE_FACTOR_SVG },
+ { "detailed", no_argument, NULL, ARG_DETAILED_SVG },
{}
};
arg_capability = CAPABILITY_MASK;
break;
+ case ARG_SCALE_FACTOR_SVG:
+ arg_svg_timescale = strtod(optarg, NULL);
+ break;
+
+ case ARG_DETAILED_SVG:
+ arg_detailed_svg = true;
+ break;
+
case '?':
return -EINVAL;
extern RecursiveErrors arg_recursive_errors;
extern bool arg_man;
extern bool arg_generators;
+extern double arg_svg_timescale;
+extern bool arg_detailed_svg;
extern char *arg_root;
extern char *arg_security_policy;
extern bool arg_offline;
systemd-analyze plot --json=off --no-legend >/dev/null || :
systemd-analyze plot --table >/dev/null || :
systemd-analyze plot --table --no-legend >/dev/null || :
+systemd-analyze plot --scale-svg=1.0 >/dev/null || :
+systemd-analyze plot --scale-svg=1.0 --detailed >/dev/null || :
(! systemd-analyze plot --global)
# legacy/deprecated options (moved to systemctl, but still usable from analyze)
systemd-analyze log-level