summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-07-28 23:41:57 +0200
committerLennart Poettering <lennart@poettering.net>2011-07-28 23:41:57 +0200
commit9d76d730ef2f59425c4c75cb55245c3b7777a445 (patch)
tree55f4f5b2854880499ac505033844dea4233cdd2c
parent189583d7e4e0a74e96df12f00013eef8543ac96f (diff)
main: profile unit file loading
-rw-r--r--src/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index b181447ca3..25b6e87de3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1013,6 +1013,8 @@ static void test_cgroups(void) {
int main(int argc, char *argv[]) {
Manager *m = NULL;
int r, retval = EXIT_FAILURE;
+ usec_t before_startup, after_startup;
+ char timespan[FORMAT_TIMESPAN_MAX];
FDSet *fds = NULL;
bool reexecute = false;
const char *shutdown_verb = NULL;
@@ -1227,6 +1229,8 @@ int main(int argc, char *argv[]) {
if (arg_default_controllers)
manager_set_default_controllers(m, arg_default_controllers);
+ before_startup = now(CLOCK_MONOTONIC);
+
if ((r = manager_startup(m, serialization, fds)) < 0)
log_error("Failed to fully start up daemon: %s", strerror(-r));
@@ -1294,6 +1298,10 @@ int main(int argc, char *argv[]) {
}
}
+ after_startup = now(CLOCK_MONOTONIC);
+ log_debug("Loaded units and determined initial transaction in %s.",
+ format_timespan(timespan, sizeof(timespan), after_startup - before_startup));
+
for (;;) {
if ((r = manager_loop(m)) < 0) {
log_error("Failed to run mainloop: %s", strerror(-r));