Merge "init: add timing log for oneshot and exec_background services"
am: 81e25f5e32
Change-Id: Idc3aad50c9fc1c1437fa9bfa18cb62c0b6fd189a
diff --git a/init/sigchld_handler.cpp b/init/sigchld_handler.cpp
index c9a09cd..984235d 100644
--- a/init/sigchld_handler.cpp
+++ b/init/sigchld_handler.cpp
@@ -73,6 +73,13 @@
auto exec_duration_ms =
std::chrono::duration_cast<std::chrono::milliseconds>(exec_duration).count();
wait_string = StringPrintf(" waiting took %f seconds", exec_duration_ms / 1000.0f);
+ } else if (service->flags() & SVC_ONESHOT) {
+ auto exec_duration = boot_clock::now() - service->time_started();
+ auto exec_duration_ms =
+ std::chrono::duration_cast<std::chrono::milliseconds>(exec_duration)
+ .count();
+ wait_string = StringPrintf(" oneshot service took %f seconds in background",
+ exec_duration_ms / 1000.0f);
}
} else {
name = StringPrintf("Untracked pid %d", pid);