From 883da85ea4e84ba6577c6103bad05251b3e10083 Mon Sep 17 00:00:00 2001 From: Pablo Gamito Date: Wed, 5 Apr 2023 13:14:53 +0000 Subject: [PATCH] Support transition trace capturing in Winscope Test: npm run build:all && npm run test:all Bug: 265791162 Change-Id: Ie1d8604bbb362ee1940dc46291446cdbbeeeecda --- tools/winscope/src/adb/winscope_proxy.py | 5 +++++ tools/winscope/src/app/trace_info.ts | 6 ++++++ .../src/trace_collection/trace_collection_utils.ts | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/tools/winscope/src/adb/winscope_proxy.py b/tools/winscope/src/adb/winscope_proxy.py index c5866829c..c0a2f750e 100644 --- a/tools/winscope/src/adb/winscope_proxy.py +++ b/tools/winscope/src/adb/winscope_proxy.py @@ -196,6 +196,11 @@ TRACE_TARGETS = { WinscopeFileMatcher("/data/local/tmp", "eventlog", "eventlog"), 'rm -f /data/local/tmp/eventlog.winscope && EVENT_LOG_TRACING_START_TIME=$EPOCHREALTIME\necho "Event Log trace started."', 'echo "EventLog\\n" > /data/local/tmp/eventlog.winscope && su root logcat -b events -v threadtime -v printable -v uid -v nsec -v epoch -b events -t $EVENT_LOG_TRACING_START_TIME >> /data/local/tmp/eventlog.winscope', + ), + "transition_trace": TraceTarget( + WinscopeFileMatcher(WINSCOPE_DIR, "transition_trace", "transition_trace"), + 'su root cmd window shell tracing start\necho "WMShell Transition trace started."', + 'su root cmd window shell tracing stop >/dev/null 2>&1' ) } diff --git a/tools/winscope/src/app/trace_info.ts b/tools/winscope/src/app/trace_info.ts index ec2295761..71420881c 100644 --- a/tools/winscope/src/app/trace_info.ts +++ b/tools/winscope/src/app/trace_info.ts @@ -29,6 +29,7 @@ const ACCESSIBILITY_ICON = "accessibility_new"; const TAG_ICON = "details"; const TRACE_ERROR_ICON = "warning"; const EVENT_LOG_ICON = "description"; +const TRANSITION_ICON = "animation"; interface TraceInfoMap { [key: number]: { @@ -123,5 +124,10 @@ export const TRACE_INFO: TraceInfoMap = { name: "Event Log", icon: EVENT_LOG_ICON, color: "#fdd663", + }, + [TraceType.TRANSITION]: { + name: "Transition Trace", + icon: TRANSITION_ICON, + color: "#EC407A", } }; diff --git a/tools/winscope/src/trace_collection/trace_collection_utils.ts b/tools/winscope/src/trace_collection/trace_collection_utils.ts index bc960483b..518f9b0ad 100644 --- a/tools/winscope/src/trace_collection/trace_collection_utils.ts +++ b/tools/winscope/src/trace_collection/trace_collection_utils.ts @@ -208,6 +208,12 @@ export const traceConfigurations: TraceConfigurationMap = { run: false, config: undefined, }, + transition_trace: { + name: "Shell Transitions", + isTraceCollection: undefined, + run: false, + config: undefined, + }, }; export const TRACES: {[key: string]: TraceConfigurationMap} = { @@ -220,6 +226,7 @@ export const TRACES: {[key: string]: TraceConfigurationMap} = { screen_recording: traceConfigurations['screen_recording'], ime_tracing: traceConfigurations['ime_tracing'], eventlog: traceConfigurations["eventlog"], + transition_trace: traceConfigurations["transition_trace"], }, arc: { wayland_trace: traceConfigurations['wayland_trace'],