Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e92c5075 authored by Pablo Gamito's avatar Pablo Gamito Committed by Android (Google) Code Review
Browse files

Merge changes from topics "component-package", "cuj-event-with-time-data",...

Merge changes from topics "component-package", "cuj-event-with-time-data", "transition-trace-update"

* changes:
  Move component related classes to own package
  Update transition tracing for FaaS usecase
  Dump elapsed time with jank events
parents 835b42e7 71d221fa
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3,8 +3,8 @@
option java_package com.android.internal.jank;

# Marks a request to start tracing a CUJ. Doesn't mean the request was executed.
37001 jank_cuj_events_begin_request (CUJ Type|1|5)
37001 jank_cuj_events_begin_request (CUJ Type|1|5),(Elapsed Time Ns|2|3),(Uptime Ns|2|3)
# Marks a request to end tracing a CUJ. Doesn't mean the request was executed.
37002 jank_cuj_events_end_request (CUJ Type|1|5)
37002 jank_cuj_events_end_request (CUJ Type|1|5),(Elapsed Time Ns|2|3),(Uptime Time Ns|2|3)
# Marks a request to cancel tracing a CUJ. Doesn't mean the request was executed.
37003 jank_cuj_events_cancel_request (CUJ Type|1|5)
37003 jank_cuj_events_cancel_request (CUJ Type|1|5),(Elapsed Time Ns|2|3),(Uptime Time Ns|2|3)
+7 −3
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ import android.os.Build;
import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.HandlerThread;
import android.os.SystemClock;
import android.provider.DeviceConfig;
import android.provider.Settings;
import android.text.TextUtils;
@@ -556,7 +557,8 @@ public class InteractionJankMonitor {
    public boolean begin(@NonNull Configuration.Builder builder) {
        try {
            final Configuration config = builder.build();
            EventLogTags.writeJankCujEventsBeginRequest(config.mCujType);
            EventLogTags.writeJankCujEventsBeginRequest(
                    config.mCujType, SystemClock.elapsedRealtimeNanos(), SystemClock.uptimeNanos());
            final TrackerResult result = new TrackerResult();
            final boolean success = config.getHandler().runWithScissors(
                    () -> result.mResult = beginInternal(config), EXECUTOR_TASK_TIMEOUT);
@@ -630,7 +632,8 @@ public class InteractionJankMonitor {
     * @return boolean true if the tracker is ended successfully, false otherwise.
     */
    public boolean end(@CujType int cujType) {
        EventLogTags.writeJankCujEventsEndRequest(cujType);
        EventLogTags.writeJankCujEventsEndRequest(cujType, SystemClock.elapsedRealtimeNanos(),
                SystemClock.uptimeNanos());
        FrameTracker tracker = getTracker(cujType);
        // Skip this call since we haven't started a trace yet.
        if (tracker == null) return false;
@@ -668,7 +671,8 @@ public class InteractionJankMonitor {
     * @return boolean true if the tracker is cancelled successfully, false otherwise.
     */
    public boolean cancel(@CujType int cujType) {
        EventLogTags.writeJankCujEventsCancelRequest(cujType);
        EventLogTags.writeJankCujEventsCancelRequest(cujType, SystemClock.elapsedRealtimeNanos(),
                SystemClock.uptimeNanos());
        return cancel(cujType, REASON_CANCEL_NORMAL);
    }

+43 −16
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

syntax = "proto3";
syntax = "proto2";

package com.android.server.wm.shell;

@@ -36,13 +36,30 @@ message TransitionTraceProto {
    MAGIC_NUMBER_H = 0x45434152;  /* RACE (little-endian ASCII) */
  }

  fixed64 magic_number = 1;  /* Must be the first field, set to value in MagicNumber */
  int64 timestamp = 2; /* The timestamp of when the trace was started. */
  repeated Transition transition = 3;
  required fixed64 magic_number = 1;  /* Must be the first field, set to value in MagicNumber */
  repeated Transition sent_transitions = 2;

  // Additional debugging info only collected and dumped when explicitly requested to trace
  repeated TransitionState transition_states = 3;
  repeated TransitionInfo transition_info = 4;
}

message Transition {
  optional int32 id = 1; // Not dumped in always on tracing
  required uint64 start_transaction_id = 2;
  required uint64 finish_transaction_id = 3;
  required int64 create_time_ns = 4;
  required int64 send_time_ns = 5;
  repeated Target targets = 6;
}

message Target {
  required int32 mode = 1;
  required int32 layer_id = 2;
  optional int32 window_id = 3;  // Not dumped in always on tracing
}

message TransitionState {
  enum State {
    COLLECTING = 0;
    PENDING = -1;
@@ -52,19 +69,29 @@ message Transition {
    FINISHED = 4;
  }

  int32 id = 1;
  int32 transition_type = 2;
  int64 timestamp = 3;
  State state = 5;
  int32 flags = 6;
  repeated ChangeInfo change = 7;
  uint64 start_transaction_id = 8;
  uint64 finish_transaction_id = 9;
  required int64 time_ns = 1;
  required int32 transition_id = 2;
  required int32 transition_type = 3;
  required State state = 4;
  required int32 flags = 5;
  repeated ChangeInfo change = 6;
  repeated com.android.server.wm.IdentifierProto participants = 7;
}

message ChangeInfo {
  com.android.server.wm.IdentifierProto window_identifier = 1;
  int32 transit_mode = 2;
  bool has_changed = 3;
  int32 change_flags = 4;
  required com.android.server.wm.IdentifierProto window_identifier = 1;
  required int32 transit_mode = 2;
  required bool has_changed = 3;
  required int32 change_flags = 4;
  required int32 windowing_mode = 5;
}

message TransitionInfo {
  required int32 transition_id = 1;
  repeated TransitionInfoChange change = 2;
}

message TransitionInfoChange {
  required int32 layer_id = 1;
  required int32 mode = 2;
}
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ import com.android.server.wm.flicker.statusBarLayerPositionAtStartAndEnd
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.taskBarLayerIsVisibleAtStartAndEnd
import com.android.server.wm.flicker.taskBarWindowIsAlwaysVisible
import com.android.server.wm.traces.common.ComponentNameMatcher
import com.android.server.wm.traces.common.component.matchers.ComponentNameMatcher
import org.junit.Assume
import org.junit.Test

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import com.android.server.wm.flicker.FlickerTest
import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.server.wm.flicker.traces.layers.LayerTraceEntrySubject
import com.android.server.wm.flicker.traces.layers.LayersTraceSubject
import com.android.server.wm.traces.common.IComponentMatcher
import com.android.server.wm.traces.common.component.matchers.IComponentMatcher
import com.android.server.wm.traces.common.region.Region
import com.android.server.wm.traces.common.service.PlatformConsts

Loading