commit | d75cbc78c4df3e989d5cc713407fa3b9d366e08f | [log] [tgz] |
---|---|---|
author | Siim Sammul <siims@google.com> | Mon Jul 26 19:19:05 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Jul 26 19:19:05 2021 +0000 |
tree | de530c84504224e7e5516cb3a98cab3d96bd4246 | |
parent | b4467c0ff4cce1e24148e10af0c5bf35cd170b4d [diff] | |
parent | b77fb085060bfef29149084ce57d1845a91420f3 [diff] |
Merge "Do not make a getThreadTimeMicro() call when it is not needed. This was accidentally changed with https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080830" into sc-dev am: 6c852aeabc am: b77fb08506 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15346904 Change-Id: I6552265f9258ea772b1774d00bd884cc2d530202
diff --git a/core/java/com/android/internal/os/BinderCallsStats.java b/core/java/com/android/internal/os/BinderCallsStats.java index 6ce7cea..be91aac 100644 --- a/core/java/com/android/internal/os/BinderCallsStats.java +++ b/core/java/com/android/internal/os/BinderCallsStats.java
@@ -220,8 +220,9 @@ public CallSession callStarted(Binder binder, int code, int workSourceUid) { noteNativeThreadId(); + boolean collectCpu = canCollect(); // We always want to collect data for latency if it's enabled, regardless of device state. - if (!mCollectLatencyData && !canCollect()) { + if (!mCollectLatencyData && !collectCpu) { return null; } @@ -233,7 +234,7 @@ s.timeStarted = -1; s.recordedCall = shouldRecordDetailedData(); - if (mRecordingAllTransactionsForUid || s.recordedCall) { + if (collectCpu && (mRecordingAllTransactionsForUid || s.recordedCall)) { s.cpuTimeStarted = getThreadTimeMicro(); s.timeStarted = getElapsedRealtimeMicro(); } else if (mCollectLatencyData) {