Loading cmds/statsd/src/external/StatsPullerManager.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -174,10 +174,16 @@ const std::map<int, PullAtomInfo> StatsPullerManager::kAllPullAtomInfo = { {android::util::TEMPERATURE, {{}, {}, 1, new ResourceThermalManagerPuller()}}, // binder_calls {android::util::BINDER_CALLS, {{4, 5, 6, 8}, {2, 3, 7, 9, 10, 11}, {{4, 5, 6, 8, 12}, {2, 3, 7, 9, 10, 11, 13}, 1 * NS_PER_SEC, new StatsCompanionServicePuller(android::util::BINDER_CALLS)}} new StatsCompanionServicePuller(android::util::BINDER_CALLS)}}, // binder_calls_exceptions {android::util::BINDER_CALLS_EXCEPTIONS, {{}, {}, 1 * NS_PER_SEC, new StatsCompanionServicePuller(android::util::BINDER_CALLS_EXCEPTIONS)}} }; StatsPullerManager::StatsPullerManager() : mNextPullTimeNs(NO_ALARM_UPDATE) { Loading core/java/com/android/internal/os/BinderCallsStats.java +8 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,13 @@ public class BinderCallsStats implements BinderInternal.Observer { return resultCallStats; } /** @hide */ public ArrayMap<String, Integer> getExportedExceptionStats() { synchronized (mLock) { return new ArrayMap(mExceptionCounts); } } public void dump(PrintWriter pw, Map<Integer,String> appIdToPkgNameMap, boolean verbose) { synchronized (mLock) { dumpLocked(pw, appIdToPkgNameMap, verbose); Loading Loading @@ -351,6 +358,7 @@ public class BinderCallsStats implements BinderInternal.Observer { public int uid; public String className; public String methodName; public boolean screenInteractive; public long cpuTimeMicros; public long maxCpuTimeMicros; public long latencyMicros; Loading services/core/java/com/android/server/BinderCallsStatsService.java +5 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.os.RemoteException; import android.os.SystemProperties; import android.os.UserHandle; import android.provider.Settings; import android.util.ArrayMap; import android.util.KeyValueListParser; import android.util.Slog; Loading Loading @@ -122,6 +123,10 @@ public class BinderCallsStatsService extends Binder { public ArrayList<BinderCallsStats.ExportedCallStat> getExportedCallStats() { return mBinderCallsStats.getExportedCallStats(); } public ArrayMap<String, Integer> getExportedExceptionStats() { return mBinderCallsStats.getExportedExceptionStats(); } } public static class LifeCycle extends SystemService { Loading services/core/java/com/android/server/stats/StatsCompanionService.java +21 −1 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; Loading Loading @@ -900,7 +901,7 @@ public class StatsCompanionService extends IStatsCompanionService.Stub { List<ExportedCallStat> callStats = binderStats.getExportedCallStats(); long elapsedNanos = SystemClock.elapsedRealtimeNanos(); for (ExportedCallStat callStat : callStats) { StatsLogEventWrapper e = new StatsLogEventWrapper(elapsedNanos, tagId, 11 /* fields */); StatsLogEventWrapper e = new StatsLogEventWrapper(elapsedNanos, tagId, 13 /* fields */); e.writeInt(callStat.uid); e.writeString(callStat.className); e.writeString(callStat.methodName); Loading @@ -912,6 +913,21 @@ public class StatsCompanionService extends IStatsCompanionService.Stub { e.writeLong(callStat.maxCpuTimeMicros); e.writeLong(callStat.maxReplySizeBytes); e.writeLong(callStat.maxRequestSizeBytes); e.writeLong(callStat.recordedCallCount); e.writeInt(callStat.screenInteractive ? 1 : 0); pulledData.add(e); } } private void pullBinderCallsStatsExceptions(int tagId, List<StatsLogEventWrapper> pulledData) { BinderCallsStatsService.Internal binderStats = LocalServices.getService(BinderCallsStatsService.Internal.class); ArrayMap<String, Integer> exceptionStats = binderStats.getExportedExceptionStats(); long elapsedNanos = SystemClock.elapsedRealtimeNanos(); for (Entry<String, Integer> entry : exceptionStats.entrySet()) { StatsLogEventWrapper e = new StatsLogEventWrapper(elapsedNanos, tagId, 2 /* fields */); e.writeString(entry.getKey()); e.writeInt(entry.getValue()); pulledData.add(e); } } Loading Loading @@ -1002,6 +1018,10 @@ public class StatsCompanionService extends IStatsCompanionService.Stub { pullBinderCallsStats(tagId, ret); break; } case StatsLog.BINDER_CALLS_EXCEPTIONS: { pullBinderCallsStatsExceptions(tagId, ret); break; } default: Slog.w(TAG, "No such tagId data as " + tagId); return null; Loading Loading
cmds/statsd/src/external/StatsPullerManager.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -174,10 +174,16 @@ const std::map<int, PullAtomInfo> StatsPullerManager::kAllPullAtomInfo = { {android::util::TEMPERATURE, {{}, {}, 1, new ResourceThermalManagerPuller()}}, // binder_calls {android::util::BINDER_CALLS, {{4, 5, 6, 8}, {2, 3, 7, 9, 10, 11}, {{4, 5, 6, 8, 12}, {2, 3, 7, 9, 10, 11, 13}, 1 * NS_PER_SEC, new StatsCompanionServicePuller(android::util::BINDER_CALLS)}} new StatsCompanionServicePuller(android::util::BINDER_CALLS)}}, // binder_calls_exceptions {android::util::BINDER_CALLS_EXCEPTIONS, {{}, {}, 1 * NS_PER_SEC, new StatsCompanionServicePuller(android::util::BINDER_CALLS_EXCEPTIONS)}} }; StatsPullerManager::StatsPullerManager() : mNextPullTimeNs(NO_ALARM_UPDATE) { Loading
core/java/com/android/internal/os/BinderCallsStats.java +8 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,13 @@ public class BinderCallsStats implements BinderInternal.Observer { return resultCallStats; } /** @hide */ public ArrayMap<String, Integer> getExportedExceptionStats() { synchronized (mLock) { return new ArrayMap(mExceptionCounts); } } public void dump(PrintWriter pw, Map<Integer,String> appIdToPkgNameMap, boolean verbose) { synchronized (mLock) { dumpLocked(pw, appIdToPkgNameMap, verbose); Loading Loading @@ -351,6 +358,7 @@ public class BinderCallsStats implements BinderInternal.Observer { public int uid; public String className; public String methodName; public boolean screenInteractive; public long cpuTimeMicros; public long maxCpuTimeMicros; public long latencyMicros; Loading
services/core/java/com/android/server/BinderCallsStatsService.java +5 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.os.RemoteException; import android.os.SystemProperties; import android.os.UserHandle; import android.provider.Settings; import android.util.ArrayMap; import android.util.KeyValueListParser; import android.util.Slog; Loading Loading @@ -122,6 +123,10 @@ public class BinderCallsStatsService extends Binder { public ArrayList<BinderCallsStats.ExportedCallStat> getExportedCallStats() { return mBinderCallsStats.getExportedCallStats(); } public ArrayMap<String, Integer> getExportedExceptionStats() { return mBinderCallsStats.getExportedExceptionStats(); } } public static class LifeCycle extends SystemService { Loading
services/core/java/com/android/server/stats/StatsCompanionService.java +21 −1 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; Loading Loading @@ -900,7 +901,7 @@ public class StatsCompanionService extends IStatsCompanionService.Stub { List<ExportedCallStat> callStats = binderStats.getExportedCallStats(); long elapsedNanos = SystemClock.elapsedRealtimeNanos(); for (ExportedCallStat callStat : callStats) { StatsLogEventWrapper e = new StatsLogEventWrapper(elapsedNanos, tagId, 11 /* fields */); StatsLogEventWrapper e = new StatsLogEventWrapper(elapsedNanos, tagId, 13 /* fields */); e.writeInt(callStat.uid); e.writeString(callStat.className); e.writeString(callStat.methodName); Loading @@ -912,6 +913,21 @@ public class StatsCompanionService extends IStatsCompanionService.Stub { e.writeLong(callStat.maxCpuTimeMicros); e.writeLong(callStat.maxReplySizeBytes); e.writeLong(callStat.maxRequestSizeBytes); e.writeLong(callStat.recordedCallCount); e.writeInt(callStat.screenInteractive ? 1 : 0); pulledData.add(e); } } private void pullBinderCallsStatsExceptions(int tagId, List<StatsLogEventWrapper> pulledData) { BinderCallsStatsService.Internal binderStats = LocalServices.getService(BinderCallsStatsService.Internal.class); ArrayMap<String, Integer> exceptionStats = binderStats.getExportedExceptionStats(); long elapsedNanos = SystemClock.elapsedRealtimeNanos(); for (Entry<String, Integer> entry : exceptionStats.entrySet()) { StatsLogEventWrapper e = new StatsLogEventWrapper(elapsedNanos, tagId, 2 /* fields */); e.writeString(entry.getKey()); e.writeInt(entry.getValue()); pulledData.add(e); } } Loading Loading @@ -1002,6 +1018,10 @@ public class StatsCompanionService extends IStatsCompanionService.Stub { pullBinderCallsStats(tagId, ret); break; } case StatsLog.BINDER_CALLS_EXCEPTIONS: { pullBinderCallsStatsExceptions(tagId, ret); break; } default: Slog.w(TAG, "No such tagId data as " + tagId); return null; Loading