summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apct-tests/perftests/core/src/android/os/TracePerfTest.java4
-rw-r--r--core/java/android/os/CombinedMessageQueue/MessageQueue.java2
-rw-r--r--core/java/android/os/Looper.java2
-rw-r--r--core/java/android/os/Message.java4
-rw-r--r--core/java/android/os/PerfettoTrackEventExtra.java40
5 files changed, 8 insertions, 44 deletions
diff --git a/apct-tests/perftests/core/src/android/os/TracePerfTest.java b/apct-tests/perftests/core/src/android/os/TracePerfTest.java
index d9051240d399..00e1c1fdbf4b 100644
--- a/apct-tests/perftests/core/src/android/os/TracePerfTest.java
+++ b/apct-tests/perftests/core/src/android/os/TracePerfTest.java
@@ -147,7 +147,7 @@ public class TracePerfTest {
.addField(1 /* sending_thread_name */, "foo")
.endNested()
.endProto()
- .addTerminatingFlow(5)
+ .setTerminatingFlow(5)
.emit();
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
@@ -158,7 +158,7 @@ public class TracePerfTest {
.addField(1 /* sending_thread_name */, "foo")
.endNested()
.endProto()
- .addTerminatingFlow(5)
+ .setTerminatingFlow(5)
.emit();
}
}
diff --git a/core/java/android/os/CombinedMessageQueue/MessageQueue.java b/core/java/android/os/CombinedMessageQueue/MessageQueue.java
index 74972346bf2e..33efb914e24f 100644
--- a/core/java/android/os/CombinedMessageQueue/MessageQueue.java
+++ b/core/java/android/os/CombinedMessageQueue/MessageQueue.java
@@ -223,7 +223,7 @@ public final class MessageQueue {
traceMessageCount();
PerfettoTrace.instant(PerfettoTrace.MQ_CATEGORY, "message_queue_send")
- .addFlow(msg.mEventId.get())
+ .setFlow(msg.mEventId.get())
.beginProto()
.beginNested(2004 /* message_queue */)
.addField(2 /* receiving_thread_name */, mThread.getName())
diff --git a/core/java/android/os/Looper.java b/core/java/android/os/Looper.java
index 1329b90538bb..3ff6e052335e 100644
--- a/core/java/android/os/Looper.java
+++ b/core/java/android/os/Looper.java
@@ -205,7 +205,7 @@ public final class Looper {
.addField(1 /* sending_thread_name */, msg.mSendingThreadName)
.endNested()
.endProto()
- .addTerminatingFlow(msg.mEventId.get())
+ .setTerminatingFlow(msg.mEventId.get())
.emit();
// This must be in a local variabe, in case a UI event sets the logger
diff --git a/core/java/android/os/Message.java b/core/java/android/os/Message.java
index b22d1774d967..69e84e3b097a 100644
--- a/core/java/android/os/Message.java
+++ b/core/java/android/os/Message.java
@@ -23,7 +23,7 @@ import android.util.proto.ProtoOutputStream;
import com.android.internal.annotations.VisibleForTesting;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
/**
*
@@ -43,7 +43,7 @@ public final class Message implements Parcelable {
*
* @hide Only for use within the system server.
*/
- public final AtomicInteger mEventId = new AtomicInteger();
+ public final AtomicLong mEventId = new AtomicLong();
/**
* User-defined message code so that the recipient can identify
diff --git a/core/java/android/os/PerfettoTrackEventExtra.java b/core/java/android/os/PerfettoTrackEventExtra.java
index f4b5dfe76f88..2848bcb8ad34 100644
--- a/core/java/android/os/PerfettoTrackEventExtra.java
+++ b/core/java/android/os/PerfettoTrackEventExtra.java
@@ -172,7 +172,6 @@ public final class PerfettoTrackEventExtra {
private final Pool<FieldDouble> mFieldDoubleCache;
private final Pool<FieldString> mFieldStringCache;
private final Pool<FieldNested> mFieldNestedCache;
- private final Pool<Flow> mFlowCache;
private final Pool<Builder> mBuilderCache;
private Builder() {
@@ -187,7 +186,6 @@ public final class PerfettoTrackEventExtra {
mFieldDoubleCache = mExtra.mFieldDoubleCache;
mFieldStringCache = mExtra.mFieldStringCache;
mFieldNestedCache = mExtra.mFieldNestedCache;
- mFlowCache = mExtra.mFlowCache;
mBuilderCache = mExtra.mBuilderCache;
mCounterInt64 = mExtra.getCounterInt64();
@@ -227,7 +225,6 @@ public final class PerfettoTrackEventExtra {
mFieldStringCache.reset();
mFieldNestedCache.reset();
mBuilderCache.reset();
- mFlowCache.reset();
mExtra.reset();
// Reset after on init in case the thread created builders without calling emit
@@ -325,39 +322,7 @@ public final class PerfettoTrackEventExtra {
/**
* Adds a flow with {@code id}.
*/
- public Builder addFlow(int id) {
- if (!mIsCategoryEnabled) {
- return this;
- }
- if (DEBUG) {
- checkParent();
- }
- Flow flow = mFlowCache.get(sFlowSupplier);
- flow.setProcessFlow(id);
- mExtra.addPerfettoPointer(flow);
- return this;
- }
-
- /**
- * Adds a terminating flow with {@code id}.
- */
- public Builder addTerminatingFlow(int id) {
- if (!mIsCategoryEnabled) {
- return this;
- }
- if (DEBUG) {
- checkParent();
- }
- Flow flow = mFlowCache.get(sFlowSupplier);
- flow.setProcessTerminatingFlow(id);
- mExtra.addPerfettoPointer(flow);
- return this;
- }
-
- /**
- * Adds a flow with {@code id}.
- */
- public Builder setFlow(int id) {
+ public Builder setFlow(long id) {
if (!mIsCategoryEnabled) {
return this;
}
@@ -372,7 +337,7 @@ public final class PerfettoTrackEventExtra {
/**
* Adds a terminating flow with {@code id}.
*/
- public Builder setTerminatingFlow(int id) {
+ public Builder setTerminatingFlow(long id) {
if (!mIsCategoryEnabled) {
return this;
}
@@ -670,7 +635,6 @@ public final class PerfettoTrackEventExtra {
private final Pool<FieldDouble> mFieldDoubleCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE);
private final Pool<FieldString> mFieldStringCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE);
private final Pool<FieldNested> mFieldNestedCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE);
- private final Pool<Flow> mFlowCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE);
private final Pool<Builder> mBuilderCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE);
private static final NativeAllocationRegistry sRegistry =