core: print 'startup finished' messages even if we log to console
This commit is contained in:
parent
2928b0a863
commit
e12919e8be
|
@ -2539,44 +2539,41 @@ void manager_check_finished(Manager *m) {
|
|||
kernel_usec = m->initrd_timestamp.monotonic - m->kernel_timestamp.monotonic;
|
||||
initrd_usec = m->userspace_timestamp.monotonic - m->initrd_timestamp.monotonic;
|
||||
|
||||
if (!log_on_console())
|
||||
log_struct(LOG_INFO,
|
||||
MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
||||
"KERNEL_USEC="USEC_FMT, kernel_usec,
|
||||
"INITRD_USEC="USEC_FMT, initrd_usec,
|
||||
"USERSPACE_USEC="USEC_FMT, userspace_usec,
|
||||
"MESSAGE=Startup finished in %s (kernel) + %s (initrd) + %s (userspace) = %s.",
|
||||
format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
|
||||
format_timespan(initrd, sizeof(initrd), initrd_usec, USEC_PER_MSEC),
|
||||
format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
|
||||
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
||||
NULL);
|
||||
log_struct(LOG_INFO,
|
||||
MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
||||
"KERNEL_USEC="USEC_FMT, kernel_usec,
|
||||
"INITRD_USEC="USEC_FMT, initrd_usec,
|
||||
"USERSPACE_USEC="USEC_FMT, userspace_usec,
|
||||
"MESSAGE=Startup finished in %s (kernel) + %s (initrd) + %s (userspace) = %s.",
|
||||
format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
|
||||
format_timespan(initrd, sizeof(initrd), initrd_usec, USEC_PER_MSEC),
|
||||
format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
|
||||
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
||||
NULL);
|
||||
} else {
|
||||
kernel_usec = m->userspace_timestamp.monotonic - m->kernel_timestamp.monotonic;
|
||||
initrd_usec = 0;
|
||||
|
||||
if (!log_on_console())
|
||||
log_struct(LOG_INFO,
|
||||
MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
||||
"KERNEL_USEC="USEC_FMT, kernel_usec,
|
||||
"USERSPACE_USEC="USEC_FMT, userspace_usec,
|
||||
"MESSAGE=Startup finished in %s (kernel) + %s (userspace) = %s.",
|
||||
format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
|
||||
format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
|
||||
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
||||
NULL);
|
||||
log_struct(LOG_INFO,
|
||||
MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
||||
"KERNEL_USEC="USEC_FMT, kernel_usec,
|
||||
"USERSPACE_USEC="USEC_FMT, userspace_usec,
|
||||
"MESSAGE=Startup finished in %s (kernel) + %s (userspace) = %s.",
|
||||
format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
|
||||
format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
|
||||
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
||||
NULL);
|
||||
}
|
||||
} else {
|
||||
firmware_usec = loader_usec = initrd_usec = kernel_usec = 0;
|
||||
total_usec = userspace_usec = m->finish_timestamp.monotonic - m->userspace_timestamp.monotonic;
|
||||
|
||||
if (!log_on_console())
|
||||
log_struct(LOG_INFO,
|
||||
MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
||||
"USERSPACE_USEC="USEC_FMT, userspace_usec,
|
||||
"MESSAGE=Startup finished in %s.",
|
||||
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
||||
NULL);
|
||||
log_struct(LOG_INFO,
|
||||
MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
||||
"USERSPACE_USEC="USEC_FMT, userspace_usec,
|
||||
"MESSAGE=Startup finished in %s.",
|
||||
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
||||
NULL);
|
||||
}
|
||||
|
||||
SET_FOREACH(u, m->startup_units, i)
|
||||
|
|
Loading…
Reference in New Issue