Merge "Dump proxy debug info when exceeding proxy limit." into pi-dev

am: 879d09f946

Change-Id: I02d14f682c6476b703d160dab911a3afc14af627
This commit is contained in:
Martijn Coenen
2018-05-26 02:19:18 -07:00
committed by android-build-merger
2 changed files with 19 additions and 2 deletions

View File

@@ -137,6 +137,15 @@ public class Binder implements IBinder {
sTracingEnabled = false;
}
/**
* Dump proxy debug information.
*
* @hide
*/
public static void dumpProxyDebugInfo() {
BinderProxy.dumpProxyDebugInfo();
}
/**
* Check if binder transaction tracing is enabled.
*
@@ -941,8 +950,7 @@ final class BinderProxy implements IBinder {
// about to crash.
final int totalUnclearedSize = unclearedSize();
if (totalUnclearedSize >= CRASH_AT_SIZE) {
dumpProxyInterfaceCounts();
dumpPerUidProxyCounts();
dumpProxyDebugInfo();
Runtime.getRuntime().gc();
throw new AssertionError("Binder ProxyMap has too many entries: "
+ totalSize + " (total), " + totalUnclearedSize + " (uncleared), "
@@ -1026,6 +1034,14 @@ final class BinderProxy implements IBinder {
private static ProxyMap sProxyMap = new ProxyMap();
/**
* @hide
*/
public static void dumpProxyDebugInfo() {
sProxyMap.dumpProxyInterfaceCounts();
sProxyMap.dumpPerUidProxyCounts();
}
/**
* Return a BinderProxy for IBinder.
* This method is thread-hostile! The (native) caller serializes getInstance() calls using

View File

@@ -15174,6 +15174,7 @@ public class ActivityManagerService extends IActivityManager.Stub
public void onLimitReached(int uid) {
Slog.wtf(TAG, "Uid " + uid + " sent too many Binders to uid "
+ Process.myUid());
Binder.dumpProxyDebugInfo();
if (uid == Process.SYSTEM_UID) {
Slog.i(TAG, "Skipping kill (uid is SYSTEM)");
} else {