Loading apct-tests/perftests/core/src/android/os/TracePerfTest.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -147,7 +147,7 @@ public class TracePerfTest { .addField(1 /* sending_thread_name */, "foo") .addField(1 /* sending_thread_name */, "foo") .endNested() .endNested() .endProto() .endProto() .addTerminatingFlow(5) .setTerminatingFlow(5) .emit(); .emit(); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); Loading @@ -158,7 +158,7 @@ public class TracePerfTest { .addField(1 /* sending_thread_name */, "foo") .addField(1 /* sending_thread_name */, "foo") .endNested() .endNested() .endProto() .endProto() .addTerminatingFlow(5) .setTerminatingFlow(5) .emit(); .emit(); } } } } Loading core/java/android/os/CombinedMessageQueue/MessageQueue.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -223,7 +223,7 @@ public final class MessageQueue { traceMessageCount(); traceMessageCount(); PerfettoTrace.instant(PerfettoTrace.MQ_CATEGORY, "message_queue_send") PerfettoTrace.instant(PerfettoTrace.MQ_CATEGORY, "message_queue_send") .addFlow(msg.mEventId.get()) .setFlow(msg.mEventId.get()) .beginProto() .beginProto() .beginNested(2004 /* message_queue */) .beginNested(2004 /* message_queue */) .addField(2 /* receiving_thread_name */, mThread.getName()) .addField(2 /* receiving_thread_name */, mThread.getName()) Loading core/java/android/os/Looper.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -205,7 +205,7 @@ public final class Looper { .addField(1 /* sending_thread_name */, msg.mSendingThreadName) .addField(1 /* sending_thread_name */, msg.mSendingThreadName) .endNested() .endNested() .endProto() .endProto() .addTerminatingFlow(msg.mEventId.get()) .setTerminatingFlow(msg.mEventId.get()) .emit(); .emit(); // This must be in a local variabe, in case a UI event sets the logger // This must be in a local variabe, in case a UI event sets the logger Loading core/java/android/os/Message.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.util.proto.ProtoOutputStream; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; /** /** * * Loading @@ -43,7 +43,7 @@ public final class Message implements Parcelable { * * * @hide Only for use within the system server. * @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 * User-defined message code so that the recipient can identify Loading core/java/android/os/PerfettoTrackEventExtra.java +2 −38 Original line number Original line Diff line number Diff line Loading @@ -172,7 +172,6 @@ public final class PerfettoTrackEventExtra { private final Pool<FieldDouble> mFieldDoubleCache; private final Pool<FieldDouble> mFieldDoubleCache; private final Pool<FieldString> mFieldStringCache; private final Pool<FieldString> mFieldStringCache; private final Pool<FieldNested> mFieldNestedCache; private final Pool<FieldNested> mFieldNestedCache; private final Pool<Flow> mFlowCache; private final Pool<Builder> mBuilderCache; private final Pool<Builder> mBuilderCache; private Builder() { private Builder() { Loading @@ -187,7 +186,6 @@ public final class PerfettoTrackEventExtra { mFieldDoubleCache = mExtra.mFieldDoubleCache; mFieldDoubleCache = mExtra.mFieldDoubleCache; mFieldStringCache = mExtra.mFieldStringCache; mFieldStringCache = mExtra.mFieldStringCache; mFieldNestedCache = mExtra.mFieldNestedCache; mFieldNestedCache = mExtra.mFieldNestedCache; mFlowCache = mExtra.mFlowCache; mBuilderCache = mExtra.mBuilderCache; mBuilderCache = mExtra.mBuilderCache; mCounterInt64 = mExtra.getCounterInt64(); mCounterInt64 = mExtra.getCounterInt64(); Loading Loading @@ -227,7 +225,6 @@ public final class PerfettoTrackEventExtra { mFieldStringCache.reset(); mFieldStringCache.reset(); mFieldNestedCache.reset(); mFieldNestedCache.reset(); mBuilderCache.reset(); mBuilderCache.reset(); mFlowCache.reset(); mExtra.reset(); mExtra.reset(); // Reset after on init in case the thread created builders without calling emit // Reset after on init in case the thread created builders without calling emit Loading Loading @@ -325,39 +322,7 @@ public final class PerfettoTrackEventExtra { /** /** * Adds a flow with {@code id}. * Adds a flow with {@code id}. */ */ public Builder addFlow(int id) { public Builder setFlow(long 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) { if (!mIsCategoryEnabled) { if (!mIsCategoryEnabled) { return this; return this; } } Loading @@ -372,7 +337,7 @@ public final class PerfettoTrackEventExtra { /** /** * Adds a terminating flow with {@code id}. * Adds a terminating flow with {@code id}. */ */ public Builder setTerminatingFlow(int id) { public Builder setTerminatingFlow(long id) { if (!mIsCategoryEnabled) { if (!mIsCategoryEnabled) { return this; return this; } } Loading Loading @@ -670,7 +635,6 @@ public final class PerfettoTrackEventExtra { private final Pool<FieldDouble> mFieldDoubleCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE); 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<FieldString> mFieldStringCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE); private final Pool<FieldNested> mFieldNestedCache = 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 final Pool<Builder> mBuilderCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE); private static final NativeAllocationRegistry sRegistry = private static final NativeAllocationRegistry sRegistry = Loading Loading
apct-tests/perftests/core/src/android/os/TracePerfTest.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -147,7 +147,7 @@ public class TracePerfTest { .addField(1 /* sending_thread_name */, "foo") .addField(1 /* sending_thread_name */, "foo") .endNested() .endNested() .endProto() .endProto() .addTerminatingFlow(5) .setTerminatingFlow(5) .emit(); .emit(); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); Loading @@ -158,7 +158,7 @@ public class TracePerfTest { .addField(1 /* sending_thread_name */, "foo") .addField(1 /* sending_thread_name */, "foo") .endNested() .endNested() .endProto() .endProto() .addTerminatingFlow(5) .setTerminatingFlow(5) .emit(); .emit(); } } } } Loading
core/java/android/os/CombinedMessageQueue/MessageQueue.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -223,7 +223,7 @@ public final class MessageQueue { traceMessageCount(); traceMessageCount(); PerfettoTrace.instant(PerfettoTrace.MQ_CATEGORY, "message_queue_send") PerfettoTrace.instant(PerfettoTrace.MQ_CATEGORY, "message_queue_send") .addFlow(msg.mEventId.get()) .setFlow(msg.mEventId.get()) .beginProto() .beginProto() .beginNested(2004 /* message_queue */) .beginNested(2004 /* message_queue */) .addField(2 /* receiving_thread_name */, mThread.getName()) .addField(2 /* receiving_thread_name */, mThread.getName()) Loading
core/java/android/os/Looper.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -205,7 +205,7 @@ public final class Looper { .addField(1 /* sending_thread_name */, msg.mSendingThreadName) .addField(1 /* sending_thread_name */, msg.mSendingThreadName) .endNested() .endNested() .endProto() .endProto() .addTerminatingFlow(msg.mEventId.get()) .setTerminatingFlow(msg.mEventId.get()) .emit(); .emit(); // This must be in a local variabe, in case a UI event sets the logger // This must be in a local variabe, in case a UI event sets the logger Loading
core/java/android/os/Message.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.util.proto.ProtoOutputStream; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; /** /** * * Loading @@ -43,7 +43,7 @@ public final class Message implements Parcelable { * * * @hide Only for use within the system server. * @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 * User-defined message code so that the recipient can identify Loading
core/java/android/os/PerfettoTrackEventExtra.java +2 −38 Original line number Original line Diff line number Diff line Loading @@ -172,7 +172,6 @@ public final class PerfettoTrackEventExtra { private final Pool<FieldDouble> mFieldDoubleCache; private final Pool<FieldDouble> mFieldDoubleCache; private final Pool<FieldString> mFieldStringCache; private final Pool<FieldString> mFieldStringCache; private final Pool<FieldNested> mFieldNestedCache; private final Pool<FieldNested> mFieldNestedCache; private final Pool<Flow> mFlowCache; private final Pool<Builder> mBuilderCache; private final Pool<Builder> mBuilderCache; private Builder() { private Builder() { Loading @@ -187,7 +186,6 @@ public final class PerfettoTrackEventExtra { mFieldDoubleCache = mExtra.mFieldDoubleCache; mFieldDoubleCache = mExtra.mFieldDoubleCache; mFieldStringCache = mExtra.mFieldStringCache; mFieldStringCache = mExtra.mFieldStringCache; mFieldNestedCache = mExtra.mFieldNestedCache; mFieldNestedCache = mExtra.mFieldNestedCache; mFlowCache = mExtra.mFlowCache; mBuilderCache = mExtra.mBuilderCache; mBuilderCache = mExtra.mBuilderCache; mCounterInt64 = mExtra.getCounterInt64(); mCounterInt64 = mExtra.getCounterInt64(); Loading Loading @@ -227,7 +225,6 @@ public final class PerfettoTrackEventExtra { mFieldStringCache.reset(); mFieldStringCache.reset(); mFieldNestedCache.reset(); mFieldNestedCache.reset(); mBuilderCache.reset(); mBuilderCache.reset(); mFlowCache.reset(); mExtra.reset(); mExtra.reset(); // Reset after on init in case the thread created builders without calling emit // Reset after on init in case the thread created builders without calling emit Loading Loading @@ -325,39 +322,7 @@ public final class PerfettoTrackEventExtra { /** /** * Adds a flow with {@code id}. * Adds a flow with {@code id}. */ */ public Builder addFlow(int id) { public Builder setFlow(long 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) { if (!mIsCategoryEnabled) { if (!mIsCategoryEnabled) { return this; return this; } } Loading @@ -372,7 +337,7 @@ public final class PerfettoTrackEventExtra { /** /** * Adds a terminating flow with {@code id}. * Adds a terminating flow with {@code id}. */ */ public Builder setTerminatingFlow(int id) { public Builder setTerminatingFlow(long id) { if (!mIsCategoryEnabled) { if (!mIsCategoryEnabled) { return this; return this; } } Loading Loading @@ -670,7 +635,6 @@ public final class PerfettoTrackEventExtra { private final Pool<FieldDouble> mFieldDoubleCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE); 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<FieldString> mFieldStringCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE); private final Pool<FieldNested> mFieldNestedCache = 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 final Pool<Builder> mBuilderCache = new Pool(DEFAULT_EXTRA_CACHE_SIZE); private static final NativeAllocationRegistry sRegistry = private static final NativeAllocationRegistry sRegistry = Loading