diff options
author | Wei Wang <wvw@google.com> | 2019-07-31 11:35:18 -0700 |
---|---|---|
committer | Wei Wang <wvw@google.com> | 2019-07-31 11:53:18 -0700 |
commit | f7c2bfee083e9c9477255feb62d9307f97199f85 (patch) | |
tree | f88a98695678ff64ed6fcbaf6ec1ca78cc41f85b /init/sigchld_handler.cpp | |
parent | ae898442d1e612be4c5991ab5c75bc3efcf28bab (diff) |
init: add timing log for oneshot and exec_background services
Bug: 136523746
Bug: 138732985
Test: boot
Change-Id: I713edd2ba8a391d5afbea796c6d58ffac9477436
Diffstat (limited to 'init/sigchld_handler.cpp')
-rw-r--r-- | init/sigchld_handler.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/init/sigchld_handler.cpp b/init/sigchld_handler.cpp index c9a09cd89..984235de0 100644 --- a/init/sigchld_handler.cpp +++ b/init/sigchld_handler.cpp @@ -73,6 +73,13 @@ static bool ReapOneProcess() { 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); |