summaryrefslogtreecommitdiff
path: root/core/java/android/util/IntArray.java
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2021-11-18 17:51:49 +0100
committerJorim Jaggi <jjaggi@google.com>2021-12-10 17:03:24 +0100
commit794720fbd24f4ad9b456cb7388c48fbe7d24de82 (patch)
tree2099bb1d5aa16503dd1d37790f6293004f3f6bb7 /core/java/android/util/IntArray.java
parent5bb7a510efa68d61cfa1ac46a0b0a194976464ae (diff)
Add cheap aidl tracing suitable for always-on-tracing (1/3)
Instead of having only one switch to enable all binder tracing, we seperate between stack tracking and tracing. Stack tracking still works as before. However, the more lightweight option, tracing using android.os.Trace, is toggleable separately and will work on the receiver side without dumping the entire stack trace. We also make the tracing more efficient by caching getTransactionName and concatting the class name. Also, enable this selectively for SysUI+Launcher, which is currently the focus of always-on-tracing effort to figure out what kind of binder calls these processes are calling which seems to contribute a huge amount of jank (long binder calls are in >= 50% of janky traces). Test: external/perfetto/tools/record_android_trace gfx view freq sched wm am aidl Test: atest aidl_unittests Bug: 202278427 Change-Id: I4d803d073cc4b69d07fa433bfef7e1c7f45132b7
Diffstat (limited to 'core/java/android/util/IntArray.java')
-rw-r--r--core/java/android/util/IntArray.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/java/android/util/IntArray.java b/core/java/android/util/IntArray.java
index b77265b0ebf6..7b28b8a607de 100644
--- a/core/java/android/util/IntArray.java
+++ b/core/java/android/util/IntArray.java
@@ -34,7 +34,7 @@ public class IntArray implements Cloneable {
private int[] mValues;
private int mSize;
- private IntArray(int[] array, int size) {
+ private IntArray(int[] array, int size) {
mValues = array;
mSize = Preconditions.checkArgumentInRange(size, 0, array.length, "size");
}
@@ -178,10 +178,8 @@ public class IntArray implements Cloneable {
}
@Override
- public IntArray clone() throws CloneNotSupportedException {
- final IntArray clone = (IntArray) super.clone();
- clone.mValues = mValues.clone();
- return clone;
+ public IntArray clone() {
+ return new IntArray(mValues.clone(), mSize);
}
/**