strempty(host->virtualization));
svg("<g transform=\"translate(%.3f,100)\">\n", 20.0 + (SCALE_X * boot->firmware_time));
- svg_graph_box(m, -(double) boot->firmware_time, boot->finish_time);
+ if (timestamp_is_set(boot->softreboot_start_time))
+ svg_graph_box(m, 0, boot->finish_time);
+ else
+ svg_graph_box(m, -(double) boot->firmware_time, boot->finish_time);
if (timestamp_is_set(boot->firmware_time)) {
svg_bar("firmware", -(double) boot->firmware_time, -(double) boot->loader_time, y);
svg_text(true, boot->initrd_time, y, "initrd");
y++;
}
+ if (timestamp_is_set(boot->softreboot_start_time)) {
+ svg_bar("soft-reboot", 0, boot->userspace_time, y);
+ svg_text(true, 0, y, "soft-reboot");
+ y++;
+ }
for (u = times; u->has_data; u++) {
if (u->activating >= boot->userspace_time)
if (require_finished && times.finish_time <= 0)
return log_not_finished(times.finish_time);
- if (arg_runtime_scope == RUNTIME_SCOPE_SYSTEM && times.softreboot_start_time > 0)
+ if (arg_runtime_scope == RUNTIME_SCOPE_SYSTEM && timestamp_is_set(times.softreboot_start_time)) {
/* On soft-reboot ignore kernel/firmware/initrd times as they are from the previous boot */
times.firmware_time = times.loader_time = times.kernel_time = times.initrd_time = 0;
- else if (arg_runtime_scope == RUNTIME_SCOPE_SYSTEM && times.security_start_time > 0) {
+ times.reverse_offset = times.softreboot_start_time;
+
+ /* Clamp all timestamps to avoid showing huge graphs */
+ if (timestamp_is_set(times.finish_time))
+ subtract_timestamp(×.finish_time, times.reverse_offset);
+ subtract_timestamp(×.userspace_time, times.reverse_offset);
+
+ subtract_timestamp(×.generators_start_time, times.reverse_offset);
+ subtract_timestamp(×.generators_finish_time, times.reverse_offset);
+
+ subtract_timestamp(×.unitsload_start_time, times.reverse_offset);
+ subtract_timestamp(×.unitsload_finish_time, times.reverse_offset);
+ } else if (arg_runtime_scope == RUNTIME_SCOPE_SYSTEM && timestamp_is_set(times.security_start_time)) {
/* security_start_time is set when systemd is not running under container environment. */
if (times.initrd_time > 0)
times.kernel_done_time = times.initrd_time;
return log_oom();
if (timestamp_is_set(t->initrd_time) && !strextend(&text, FORMAT_TIMESPAN(t->userspace_time - t->initrd_time, USEC_PER_MSEC), " (initrd) + "))
return log_oom();
- if (timestamp_is_set(t->softreboot_start_time) && !strextend(&text, FORMAT_TIMESPAN(t->userspace_time - t->softreboot_start_time, USEC_PER_MSEC), " (soft reboot) + "))
+ if (timestamp_is_set(t->softreboot_start_time) && !strextend(&text, FORMAT_TIMESPAN(t->userspace_time, USEC_PER_MSEC), " (soft reboot) + "))
return log_oom();
if (!strextend(&text, FORMAT_TIMESPAN(t->finish_time - t->userspace_time, USEC_PER_MSEC), " (userspace) "))
return log_oom();
if (unit_id && timestamp_is_set(activated_time)) {
- usec_t base = timestamp_is_set(t->userspace_time) ? t->userspace_time : t->reverse_offset;
+ usec_t base;
+
+ /* On soft-reboot times are clamped to avoid showing huge graphs */
+ if (timestamp_is_set(t->softreboot_start_time) && timestamp_is_set(t->userspace_time))
+ base = t->userspace_time + t->reverse_offset;
+ else
+ base = timestamp_is_set(t->userspace_time) ? t->userspace_time : t->reverse_offset;
if (!strextend(&text, "\n", unit_id, " reached after ", FORMAT_TIMESPAN(activated_time - base, USEC_PER_MSEC), " in userspace."))
return log_oom();
return log_error_errno(r, "Failed to get timestamp properties of unit %s: %s",
u.id, bus_error_message(&error, r));
+ /* Activated in the previous soft-reboot iteration? Ignore it, we want new activations */
+ if ((t->activated > 0 && t->activated < boot_times->softreboot_start_time) ||
+ (t->activating > 0 && t->activating < boot_times->softreboot_start_time))
+ continue;
+
subtract_timestamp(&t->activating, boot_times->reverse_offset);
subtract_timestamp(&t->activated, boot_times->reverse_offset);
- subtract_timestamp(&t->deactivating, boot_times->reverse_offset);
- subtract_timestamp(&t->deactivated, boot_times->reverse_offset);
+
+ /* If the last deactivation was in the previous soft-reboot, ignore it */
+ if (timestamp_is_set(boot_times->softreboot_start_time)) {
+ if (t->deactivating < boot_times->reverse_offset)
+ t->deactivating = 0;
+ else
+ subtract_timestamp(&t->deactivating, boot_times->reverse_offset);
+ if (t->deactivated < boot_times->reverse_offset)
+ t->deactivated = 0;
+ else
+ subtract_timestamp(&t->deactivated, boot_times->reverse_offset);
+ } else {
+ subtract_timestamp(&t->deactivating, boot_times->reverse_offset);
+ subtract_timestamp(&t->deactivated, boot_times->reverse_offset);
+ }
if (t->activated >= t->activating)
t->time = t->activated - t->activating;