|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From e12919e8be5c80efe09a57f642bbd2411b313ced Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Lennart Poettering <lennart@poettering.net>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Fri, 22 Aug 2014 16:41:00 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] core: print 'startup finished' messages even if we log to
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
console
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/manager.c | 55 ++++++++++++++++++++++++++----------------------------
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 26 insertions(+), 29 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/core/manager.c b/src/core/manager.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 1bb0c9025f..7508fefaef 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/core/manager.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/core/manager.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -2539,44 +2539,41 @@ void manager_check_finished(Manager *m) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
kernel_usec = m->initrd_timestamp.monotonic - m->kernel_timestamp.monotonic;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
initrd_usec = m->userspace_timestamp.monotonic - m->initrd_timestamp.monotonic;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (!log_on_console())
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- log_struct(LOG_INFO,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- "KERNEL_USEC="USEC_FMT, kernel_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- "INITRD_USEC="USEC_FMT, initrd_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- "USERSPACE_USEC="USEC_FMT, userspace_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- "MESSAGE=Startup finished in %s (kernel) + %s (initrd) + %s (userspace) = %s.",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- format_timespan(initrd, sizeof(initrd), initrd_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_struct(LOG_INFO,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ "KERNEL_USEC="USEC_FMT, kernel_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ "INITRD_USEC="USEC_FMT, initrd_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ "USERSPACE_USEC="USEC_FMT, userspace_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ "MESSAGE=Startup finished in %s (kernel) + %s (initrd) + %s (userspace) = %s.",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ format_timespan(initrd, sizeof(initrd), initrd_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
} else {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
kernel_usec = m->userspace_timestamp.monotonic - m->kernel_timestamp.monotonic;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
initrd_usec = 0;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (!log_on_console())
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- log_struct(LOG_INFO,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- "KERNEL_USEC="USEC_FMT, kernel_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- "USERSPACE_USEC="USEC_FMT, userspace_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- "MESSAGE=Startup finished in %s (kernel) + %s (userspace) = %s.",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- }
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- } else {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- firmware_usec = loader_usec = initrd_usec = kernel_usec = 0;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- total_usec = userspace_usec = m->finish_timestamp.monotonic - m->userspace_timestamp.monotonic;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (!log_on_console())
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
log_struct(LOG_INFO,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ "KERNEL_USEC="USEC_FMT, kernel_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
"USERSPACE_USEC="USEC_FMT, userspace_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- "MESSAGE=Startup finished in %s.",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ "MESSAGE=Startup finished in %s (kernel) + %s (userspace) = %s.",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ } else {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ firmware_usec = loader_usec = initrd_usec = kernel_usec = 0;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ total_usec = userspace_usec = m->finish_timestamp.monotonic - m->userspace_timestamp.monotonic;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_struct(LOG_INFO,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ "USERSPACE_USEC="USEC_FMT, userspace_usec,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ "MESSAGE=Startup finished in %s.",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
SET_FOREACH(u, m->startup_units, i)
|