summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/binder/BpBinder.cpp12
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());