From 280a4cfbc4540106296985029132be62fdbc8d45 Mon Sep 17 00:00:00 2001 From: Yurii Zubrytskyi Date: Tue, 15 Feb 2022 09:03:50 -0800 Subject: [PATCH] [idmap] Add logging for the service start/stop As of now it's impossible to tell what happened or is happening to idmap2d - and that's the important thing in the bug. Adding some logging to help investigating it if it happens again Bug: 219393586 Test: manual Change-Id: Ia6615f80d8a4b7ba94714f0af10e09ba9d709bb6 --- cmds/idmap2/idmap2d/Main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmds/idmap2/idmap2d/Main.cpp b/cmds/idmap2/idmap2d/Main.cpp index 2707049fa6770..dad09a0e6fbe2 100644 --- a/cmds/idmap2/idmap2d/Main.cpp +++ b/cmds/idmap2/idmap2d/Main.cpp @@ -15,14 +15,14 @@ */ #define ATRACE_TAG ATRACE_TAG_RESOURCES +#define LOG_TAG "idmap2d" +#include "android-base/logging.h" #include #include #include #include // EXIT_{FAILURE,SUCCESS} -#include -#include #include "Idmap2Service.h" #include "android-base/macros.h" @@ -35,14 +35,17 @@ using android::status_t; using android::os::Idmap2Service; int main(int argc ATTRIBUTE_UNUSED, char** argv ATTRIBUTE_UNUSED) { + LOG(INFO) << "Starting"; IPCThreadState::disableBackgroundScheduling(true); status_t ret = BinderService::publish(); if (ret != android::OK) { + LOG(ERROR) << "Failed to start: " << ret; return EXIT_FAILURE; } sp ps(ProcessState::self()); ps->startThreadPool(); ps->giveThreadPoolName(); IPCThreadState::self()->joinThreadPool(); + LOG(INFO) << "Exiting"; return EXIT_SUCCESS; }