diff options
author | Devin Moore <devinmoore@google.com> | 2024-04-16 20:55:12 +0000 |
---|---|---|
committer | Devin Moore <devinmoore@google.com> | 2024-04-24 22:09:45 +0000 |
commit | 50935d862bb5f58732f353ecd6811feeb358a581 (patch) | |
tree | 4685327f222c15a5f3c9046559a2810d773ad554 | |
parent | 6e0bd99433bfa2ad5e232379ffd625807d3526b3 (diff) | |
download | libhwbinder-50935d862bb5f58732f353ecd6811feeb358a581.tar.gz |
Log when threadpool is being used/configured and HIDL is disabled
When HIDL is disabled these threads will do nothing.
Add logs so we can see if/when services are trying to use or start the
hwbinder threadpools on those devices.
Test: launch_cvd
Bug: 324326491
Change-Id: Idbd0e3c4c80eb87a35664708cd87921dd8586c6b
-rw-r--r-- | IPCThreadState.cpp | 5 | ||||
-rw-r--r-- | ProcessState.cpp | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/IPCThreadState.cpp b/IPCThreadState.cpp index e0c1ade..e7e2190 100644 --- a/IPCThreadState.cpp +++ b/IPCThreadState.cpp @@ -20,6 +20,7 @@ #include <hwbinder/Binder.h> #include <hwbinder/BpHwBinder.h> +#include <hwbinder/HidlSupport.h> #include <android-base/macros.h> #include <utils/CallStack.h> @@ -538,6 +539,10 @@ void IPCThreadState::joinThreadPool(bool isMain) { LOG_THREADPOOL("**** THREAD %p (PID %d) IS JOINING THE THREAD POOL\n", (void*)pthread_self(), getpid()); + if (!isHwbinderSupportedBlocking()) { + ALOGW("HwBinder is not supported on this device, but this process is calling joinThreadPool."); + } + mOut.writeInt32(isMain ? BC_ENTER_LOOPER : BC_REGISTER_LOOPER); status_t result; diff --git a/ProcessState.cpp b/ProcessState.cpp index ccb69a3..d02c3c0 100644 --- a/ProcessState.cpp +++ b/ProcessState.cpp @@ -106,6 +106,9 @@ sp<ProcessState> ProcessState::init(size_t mmapSize, bool requireMmapSize) { void ProcessState::startThreadPool() { + if (!isHwbinderSupportedBlocking()) { + ALOGW("HwBinder is not supported on this device but this process is calling startThreadPool"); + } AutoMutex _l(mLock); if (!mThreadPoolStarted) { mThreadPoolStarted = true; @@ -318,6 +321,10 @@ status_t ProcessState::setThreadPoolConfiguration(size_t maxThreads, bool caller LOG_ALWAYS_FATAL_IF(maxThreads == 0 && callerJoinsPool, "Binder threadpool must have a minimum of one thread if caller joins pool."); + if (!isHwbinderSupportedBlocking()) { + ALOGW("HwBinder is not supported on this device but this process is calling setThreadPoolConfiguration"); + } + size_t threadsToAllocate = maxThreads; // If the caller is going to join the pool it will contribute one thread to the threadpool. |