Loading libs/binder/Binder.cpp +3 −2 Original line number Original line Diff line number Diff line Loading @@ -411,8 +411,9 @@ status_t BBinder::transact( if (reply != nullptr) { if (reply != nullptr) { reply->setDataPosition(0); reply->setDataPosition(0); if (reply->dataSize() > binder::kLogTransactionsOverBytes) { if (reply->dataSize() > binder::kLogTransactionsOverBytes) { ALOGW("Large reply transaction of %zu bytes, interface descriptor %s, code %d", ALOGW("Large reply transaction of %zu bytes, interface descriptor %s, code %d, flags " reply->dataSize(), String8(getInterfaceDescriptor()).c_str(), code); "%d", reply->dataSize(), String8(getInterfaceDescriptor()).c_str(), code, flags); } } } } Loading libs/binder/BpBinder.cpp +17 −5 Original line number Original line Diff line number Diff line Loading @@ -292,8 +292,20 @@ std::optional<int32_t> BpBinder::getDebugBinderHandle() const { } } } } // Macro makes this simpler to call, since we need to allocate, and // we return something with a temporary lifetime. // // If you are missing an interface descriptor, try adding: // 'if (getpid() > 500) getInterfaceDescriptor();' in onFirstRef #define BPBINDER_BEST_DESCRIPTOR_LOCKED \ (isDescriptorCachedLocked() ? String8(mDescriptorCache).c_str() : "(not cached)") bool BpBinder::isDescriptorCached() const { bool BpBinder::isDescriptorCached() const { RpcMutexUniqueLock _l(mLock); RpcMutexUniqueLock _l(mLock); return isDescriptorCachedLocked(); } bool BpBinder::isDescriptorCachedLocked() const { return mDescriptorCache.c_str() != kDescriptorUninit.c_str(); return mDescriptorCache.c_str() != kDescriptorUninit.c_str(); } } Loading Loading @@ -404,9 +416,9 @@ status_t BpBinder::transact( if (data.dataSize() > binder::kLogTransactionsOverBytes) { if (data.dataSize() > binder::kLogTransactionsOverBytes) { RpcMutexUniqueLock _l(mLock); RpcMutexUniqueLock _l(mLock); ALOGW("Large outgoing transaction of %zu bytes, interface descriptor %s, code %d was " ALOGW("Large outgoing transaction of %zu bytes, interface descriptor '%s', code %d, " "sent", "flags %d was sent", data.dataSize(), String8(mDescriptorCache).c_str(), code); data.dataSize(), BPBINDER_BEST_DESCRIPTOR_LOCKED, code, flags); } } if (status == DEAD_OBJECT) mAlive = 0; if (status == DEAD_OBJECT) mAlive = 0; Loading Loading @@ -802,8 +814,8 @@ void BpBinder::onLastStrongRef(const void* /*id*/) { Vector<Obituary>* obits = mObituaries; Vector<Obituary>* obits = mObituaries; if(obits != nullptr) { if(obits != nullptr) { if (!obits->isEmpty()) { if (!obits->isEmpty()) { ALOGI("onLastStrongRef automatically unlinking death recipients: %s", ALOGI("onLastStrongRef automatically unlinking death recipients for descriptor: '%s'", String8(mDescriptorCache).c_str()); BPBINDER_BEST_DESCRIPTOR_LOCKED); } } if (ipc) ipc->clearDeathNotification(binderHandle(), this); if (ipc) ipc->clearDeathNotification(binderHandle(), this); Loading libs/binder/include/binder/BpBinder.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -217,6 +217,7 @@ private: void reportOneDeath(const Obituary& obit); void reportOneDeath(const Obituary& obit); bool isDescriptorCached() const; bool isDescriptorCached() const; bool isDescriptorCachedLocked() const; mutable RpcMutex mLock; mutable RpcMutex mLock; volatile int32_t mAlive; volatile int32_t mAlive; Loading Loading
libs/binder/Binder.cpp +3 −2 Original line number Original line Diff line number Diff line Loading @@ -411,8 +411,9 @@ status_t BBinder::transact( if (reply != nullptr) { if (reply != nullptr) { reply->setDataPosition(0); reply->setDataPosition(0); if (reply->dataSize() > binder::kLogTransactionsOverBytes) { if (reply->dataSize() > binder::kLogTransactionsOverBytes) { ALOGW("Large reply transaction of %zu bytes, interface descriptor %s, code %d", ALOGW("Large reply transaction of %zu bytes, interface descriptor %s, code %d, flags " reply->dataSize(), String8(getInterfaceDescriptor()).c_str(), code); "%d", reply->dataSize(), String8(getInterfaceDescriptor()).c_str(), code, flags); } } } } Loading
libs/binder/BpBinder.cpp +17 −5 Original line number Original line Diff line number Diff line Loading @@ -292,8 +292,20 @@ std::optional<int32_t> BpBinder::getDebugBinderHandle() const { } } } } // Macro makes this simpler to call, since we need to allocate, and // we return something with a temporary lifetime. // // If you are missing an interface descriptor, try adding: // 'if (getpid() > 500) getInterfaceDescriptor();' in onFirstRef #define BPBINDER_BEST_DESCRIPTOR_LOCKED \ (isDescriptorCachedLocked() ? String8(mDescriptorCache).c_str() : "(not cached)") bool BpBinder::isDescriptorCached() const { bool BpBinder::isDescriptorCached() const { RpcMutexUniqueLock _l(mLock); RpcMutexUniqueLock _l(mLock); return isDescriptorCachedLocked(); } bool BpBinder::isDescriptorCachedLocked() const { return mDescriptorCache.c_str() != kDescriptorUninit.c_str(); return mDescriptorCache.c_str() != kDescriptorUninit.c_str(); } } Loading Loading @@ -404,9 +416,9 @@ status_t BpBinder::transact( if (data.dataSize() > binder::kLogTransactionsOverBytes) { if (data.dataSize() > binder::kLogTransactionsOverBytes) { RpcMutexUniqueLock _l(mLock); RpcMutexUniqueLock _l(mLock); ALOGW("Large outgoing transaction of %zu bytes, interface descriptor %s, code %d was " ALOGW("Large outgoing transaction of %zu bytes, interface descriptor '%s', code %d, " "sent", "flags %d was sent", data.dataSize(), String8(mDescriptorCache).c_str(), code); data.dataSize(), BPBINDER_BEST_DESCRIPTOR_LOCKED, code, flags); } } if (status == DEAD_OBJECT) mAlive = 0; if (status == DEAD_OBJECT) mAlive = 0; Loading Loading @@ -802,8 +814,8 @@ void BpBinder::onLastStrongRef(const void* /*id*/) { Vector<Obituary>* obits = mObituaries; Vector<Obituary>* obits = mObituaries; if(obits != nullptr) { if(obits != nullptr) { if (!obits->isEmpty()) { if (!obits->isEmpty()) { ALOGI("onLastStrongRef automatically unlinking death recipients: %s", ALOGI("onLastStrongRef automatically unlinking death recipients for descriptor: '%s'", String8(mDescriptorCache).c_str()); BPBINDER_BEST_DESCRIPTOR_LOCKED); } } if (ipc) ipc->clearDeathNotification(binderHandle(), this); if (ipc) ipc->clearDeathNotification(binderHandle(), this); Loading
libs/binder/include/binder/BpBinder.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -217,6 +217,7 @@ private: void reportOneDeath(const Obituary& obit); void reportOneDeath(const Obituary& obit); bool isDescriptorCached() const; bool isDescriptorCached() const; bool isDescriptorCachedLocked() const; mutable RpcMutex mLock; mutable RpcMutex mLock; volatile int32_t mAlive; volatile int32_t mAlive; Loading