diff options
| author | 2024-05-21 20:08:17 +0000 | |
|---|---|---|
| committer | 2024-05-21 20:08:17 +0000 | |
| commit | feac85897a8291f88f21c537a81754e3a733ac58 (patch) | |
| tree | 41905d7104c7ecb13bbc47fbf8bd65ecac8e0373 | |
| parent | 7f1bf8c6158a565d200edf59bb546739e390af44 (diff) | |
| parent | 91f0294c09279c59deb5d6f7a2d728e19238d9da (diff) | |
Merge "binder: add tracing for binder proxies" into main am: 91f0294c09
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3091830
Change-Id: Id5c40bf9543ea3da69d0268ed3d268ceadb3aa45
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/binder/BpBinder.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp index 54457fc568..7a855e1c5b 100644 --- a/libs/binder/BpBinder.cpp +++ b/libs/binder/BpBinder.cpp @@ -15,6 +15,7 @@ */ #define LOG_TAG "BpBinder" +#define ATRACE_TAG ATRACE_TAG_AIDL //#define LOG_NDEBUG 0 #include <binder/BpBinder.h> @@ -26,6 +27,12 @@ #include <stdio.h> +#ifndef __TRUSTY__ +#include <cutils/trace.h> +#else +#define ATRACE_INT(...) +#endif + #include "BuildFlags.h" #include "file.h" @@ -209,6 +216,7 @@ sp<BpBinder> BpBinder::create(int32_t handle) { sTrackingMap[trackedUid]++; } uint32_t numProxies = sBinderProxyCount.fetch_add(1, std::memory_order_relaxed); + ATRACE_INT("binder_proxies", numProxies); uint32_t numLastWarned = sBinderProxyCountWarned.load(std::memory_order_relaxed); uint32_t numNextWarn = numLastWarned + kBinderProxyCountWarnInterval; if (numProxies >= numNextWarn) { @@ -632,8 +640,8 @@ BpBinder::~BpBinder() { } } } - --sBinderProxyCount; - + [[maybe_unused]] uint32_t numProxies = --sBinderProxyCount; + ATRACE_INT("binder_proxies", numProxies); if (ipc) { ipc->expungeHandle(binderHandle(), this); ipc->decWeakHandle(binderHandle()); |