From d27b1735e67821761ba365975b53a996f965d68e Mon Sep 17 00:00:00 2001 From: Pablo Gamito Date: Wed, 5 Apr 2023 13:49:30 +0000 Subject: [PATCH] Implement Eventlog parser in Winscope Test: atest npm run build:all && npm run test:all Fixes: 258182396 Fixes: 262290862 Change-Id: I2081e462669f4d4b4e92674d397030974b7f34c4 --- tools/winscope/src/parsers/parser_eventlog.ts | 51 +++++ .../src/parsers/parser_eventlog_test.ts | 58 ++++++ tools/winscope/src/parsers/parser_factory.ts | 2 + .../test/fixtures/traces/eventlog.winscope | 187 ++++++++++++++++++ tools/winscope/src/trace/flickerlib/common.js | 17 ++ tools/winscope/src/trace/trace_type.ts | 2 + 6 files changed, 317 insertions(+) create mode 100644 tools/winscope/src/parsers/parser_eventlog.ts create mode 100644 tools/winscope/src/parsers/parser_eventlog_test.ts create mode 100644 tools/winscope/src/test/fixtures/traces/eventlog.winscope diff --git a/tools/winscope/src/parsers/parser_eventlog.ts b/tools/winscope/src/parsers/parser_eventlog.ts new file mode 100644 index 000000000..629c9435f --- /dev/null +++ b/tools/winscope/src/parsers/parser_eventlog.ts @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Event, EventLogParser} from 'trace/flickerlib/common'; +import {RealTimestamp, Timestamp, TimestampType} from 'trace/timestamp'; +import {TraceType} from 'trace/trace_type'; +import {AbstractParser} from './abstract_parser'; + +class ParserEventLog extends AbstractParser { + override getTraceType(): TraceType { + return TraceType.EVENT_LOG; + } + + override getMagicNumber(): number[] { + return ParserEventLog.MAGIC_NUMBER; + } + + override decodeTrace(buffer: Uint8Array): Event[] { + const eventLog = EventLogParser.prototype.parse(buffer); + + return eventLog.entries; + } + + override getTimestamp(type: TimestampType, entry: any): undefined | Timestamp { + if (type === TimestampType.REAL) { + return new RealTimestamp(BigInt(entry.timestamp.unixNanos)); + } + return undefined; + } + + override processDecodedEntry(index: number, timestampType: TimestampType, entry: Event): Event { + return entry; + } + + private static readonly MAGIC_NUMBER: number[] = Array.from(new TextEncoder().encode('EventLog')); +} + +export {ParserEventLog}; diff --git a/tools/winscope/src/parsers/parser_eventlog_test.ts b/tools/winscope/src/parsers/parser_eventlog_test.ts new file mode 100644 index 000000000..729006a8a --- /dev/null +++ b/tools/winscope/src/parsers/parser_eventlog_test.ts @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {assertDefined} from 'common/assert_utils'; +import {UnitTestUtils} from 'test/unit/utils'; +import { CujEvent } from 'trace/flickerlib/common'; +import {Parser} from 'trace/parser'; +import {RealTimestamp, TimestampType} from 'trace/timestamp'; +import {TraceType} from 'trace/trace_type'; + +describe('ParserEventLog', () => { + let parser: Parser; + + beforeAll(async () => { + parser = assertDefined( + await UnitTestUtils.getParser('traces/eventlog.winscope') + ) as Parser; + }); + + it('has expected trace type', () => { + expect(parser.getTraceType()).toEqual(TraceType.EVENT_LOG); + }); + + it('has expected timestamps', () => { + const timestamps = assertDefined(parser.getTimestamps(TimestampType.REAL)); + + expect(timestamps.length).toEqual(184); + + const expected = [ + new RealTimestamp(1681207047981157120n), + new RealTimestamp(1681207047991161088n), + new RealTimestamp(1681207047991310592n), + ]; + expect(timestamps.slice(0, 3)).toEqual(expected); + }); + + it("doesn't provide elapsed timestamps", () => { + expect(parser.getTimestamps(TimestampType.ELAPSED)).toEqual(undefined); + }); + + it("contains parsed jank CUJ events", () => { + const entry = parser.getEntry(18, TimestampType.REAL); + expect(entry instanceof CujEvent).toBeTrue(); + }); +}); diff --git a/tools/winscope/src/parsers/parser_factory.ts b/tools/winscope/src/parsers/parser_factory.ts index 8af78abba..fa8cbd139 100644 --- a/tools/winscope/src/parsers/parser_factory.ts +++ b/tools/winscope/src/parsers/parser_factory.ts @@ -19,6 +19,7 @@ import {Parser} from 'trace/parser'; import {TraceFile} from 'trace/trace_file'; import {TraceType} from 'trace/trace_type'; import {ParserAccessibility} from './parser_accessibility'; +import {ParserEventLog} from './parser_eventlog'; import {ParserInputMethodClients} from './parser_input_method_clients'; import {ParserInputMethodManagerService} from './parser_input_method_manager_service'; import {ParserInputMethodService} from './parser_input_method_service'; @@ -43,6 +44,7 @@ export class ParserFactory { ParserTransactions, ParserWindowManager, ParserWindowManagerDump, + ParserEventLog, ]; private parsers = new Map>(); diff --git a/tools/winscope/src/test/fixtures/traces/eventlog.winscope b/tools/winscope/src/test/fixtures/traces/eventlog.winscope new file mode 100644 index 000000000..dfd933da8 --- /dev/null +++ b/tools/winscope/src/test/fixtures/traces/eventlog.winscope @@ -0,0 +1,187 @@ +EventLog + +--------- beginning of events + 1681207047.981157174 1000 1654 1821 I input_interaction: Interaction with: 454ee48 com.google.android.gm/com.google.android.gm.welcome.WelcomeTourActivity (server), [Gesture Monitor] swipe-up (server), [Gesture Monitor] edge-swipe (server), PointerEventDispatcher0 (server), + 1681207047.991161039 1000 1654 6209 I input_cancel: [454ee48 com.google.android.gm/com.google.android.gm.welcome.WelcomeTourActivity (server),reason=input channel stole pointer stream] + 1681207047.991310494 1000 1654 6209 I input_cancel: [[Gesture Monitor] edge-swipe (server),reason=input channel stole pointer stream] + 1681207047.991408313 10212 14576 14576 I view_enqueue_input_event: [Motion - Cancel,com.google.android.gm/com.google.android.gm.welcome.WelcomeTourActivity] + 1681207047.993790312 1000 1654 1821 I input_interaction: Interaction with: [Gesture Monitor] swipe-up (server), PointerEventDispatcher0 (server), + 1681207047.999042631 1000 1654 1695 I wm_task_moved: [1,1,0,1,5] + 1681207047.999255237 1000 1654 1695 I wm_task_moved: [101,1,0,1,2147483647] + 1681207047.999270089 1000 1654 1695 I wm_task_to_front: [0,101,0] + 1681207047.999394763 10212 14576 14576 I wm_on_top_resumed_lost_called: [32607344,com.google.android.gm.welcome.WelcomeTourActivity,topStateChangedWhenResumed] + 1681207047.999401884 1000 1654 1695 I wm_focused_root_task: [0,0,1,-1,startExistingRecents] + 1681207047.999987984 1000 1654 1695 I wm_set_resumed_activity: [0,com.google.android.apps.nexuslauncher/.NexusLauncherActivity,resumeTopActivity - onActivityStateChanged] + 1681207048.000370959 1000 1654 1695 I wm_resume_activity: [0,225733613,101,com.google.android.apps.nexuslauncher/.NexusLauncherActivity] + 1681207048.007536649 10227 2806 2806 I wm_on_restart_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,performRestart,0] + 1681207048.010586902 10227 2806 2806 I wm_on_start_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,handleStartActivity,3] + 1681207048.010844674 10227 2806 2806 I wm_on_resume_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,RESUME_ACTIVITY,0] + 1681207048.011009346 10227 2806 2806 I wm_on_top_resumed_gained_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,topStateChangedWhenResumed] + 1681207048.025492501 10227 2806 3604 I jank_cuj_events_begin_request: [11,1681207048025446000,2661012770462,2661012770503,] + 1681207048.025580310 10227 2806 3604 I jank_cuj_events_begin_request: [9,1681207048025551000,2661012874914,2661012874954,] + 1681207048.025596830 10227 2806 3604 I jank_cuj_events_begin_request: [66,1681207048025580000,2661012903966,2661012904007,] + 1681207048.026301705 10227 2806 2806 I sysui_latency: [1,53] + 1681207048.031300362 1000 1654 1696 I wm_wallpaper_surface: [0,1,Window{268cd60 u0 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity}] + 1681207048.034518461 1000 1654 1692 I sysui_multi_action: [319,32,322,30,325,2660,757,761,758,9,759,5,806,com.google.android.apps.nexuslauncher,871,com.google.android.apps.nexuslauncher.NexusLauncherActivity,905,0,1320,4,1321,24] + 1681207048.037651070 1000 1654 10793 I wm_set_resumed_activity: [0,com.google.android.apps.nexuslauncher/.NexusLauncherActivity,setFocusedTask-alreadyTop] + 1681207048.039444812 1000 1654 1696 I input_focus: [Focus request recents_animation_input_consumer,reason=UpdateInputWindows] + 1681207048.054928902 1000 1654 1821 I input_focus: [Focus leaving 454ee48 com.google.android.gm/com.google.android.gm.welcome.WelcomeTourActivity (server),reason=Waiting for window because NOT_VISIBLE] + 1681207048.055058459 1000 1654 1821 I input_focus: [Focus entering recents_animation_input_consumer (server),reason=Window became focusable. Previous reason: NOT_VISIBLE] + 1681207048.055324695 10227 2806 3604 I jank_cuj_events_end_request: [65,1681207048055285000,2661042609858,2661042609980] + 1681207048.286107084 10241 2032 2153 I jank_cuj_events_end_request: [55,1681207048285762000,2661273088374,2661273088496] + 1681207048.331988147 1000 1654 1692 I sysui_latency: [8,44] + 1681207048.643178618 10227 2806 3604 I jank_cuj_events_cancel_request: [11,1681207048642792000,2661630123246,2661630123815] + 1681207048.643397652 10227 2806 3604 I jank_cuj_events_cancel_request: [66,1681207048643085000,2661630409297,2661630409541] + 1681207048.656586821 10227 2806 3604 I jank_cuj_events_end_request: [11,1681207048656469000,2661643794470,2661643794673] + 1681207048.656637521 10227 2806 3604 I jank_cuj_events_end_request: [9,1681207048656499000,2661643822871,2661643822993] + 1681207048.656670479 10227 2806 3604 I jank_cuj_events_end_request: [66,1681207048656617000,2661643941035,2661643941239] + 1681207048.658915515 1000 1654 3618 I wm_add_to_stopping: [0,32607344,com.google.android.gm/.welcome.WelcomeTourActivity,makeInvisible] + 1681207048.659206816 1000 1654 3618 I wm_pause_activity: [0,32607344,com.google.android.gm/.welcome.WelcomeTourActivity,userLeaving=true,finishTransition] + 1681207048.663365141 10212 14576 14576 I wm_on_paused_called: [32607344,com.google.android.gm.welcome.WelcomeTourActivity,performPause,3] + 1681207048.671711292 1000 1654 1696 I input_focus: [Focus request 268cd60 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity,reason=UpdateInputWindows] + 1681207048.671949939 1000 1654 1821 I input_focus: [Focus leaving recents_animation_input_consumer (server),reason=NOT_VISIBLE] + 1681207048.673020292 1000 1654 1692 I sysui_multi_action: [757,803,799,window_time_0,802,4] + 1681207048.673024728 1000 1654 1695 I wm_stop_activity: [0,32607344,com.google.android.gm/.welcome.WelcomeTourActivity] + 1681207048.687825346 10212 14576 14576 I wm_on_stop_called: [32607344,com.google.android.gm.welcome.WelcomeTourActivity,STOP_ACTIVITY_ITEM,13] + 1681207048.702757027 1000 1654 1821 I input_focus: [Focus entering 268cd60 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity (server),reason=setFocusedWindow] + 1681207048.915948881 1000 1654 1821 I input_interaction: Interaction with: 268cd60 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity (server), c61a53b com.android.systemui.wallpapers.ImageWallpaper (server), [Gesture Monitor] swipe-up (server), [Gesture Monitor] edge-swipe (server), PointerEventDispatcher0 (server), + 1681207048.916834054 10227 2806 3604 I jank_cuj_events_begin_request: [25,1681207048916587000,2661903912227,2661903912390,] + 1681207048.916890125 10227 2806 3604 I jank_cuj_events_begin_request: [67,1681207048916771000,2661904095129,2661904095210,] + 1681207048.975377958 10227 2806 3604 I jank_cuj_events_cancel_request: [25,1681207048975284000,2661962609737,2661962609940] + 1681207048.975487740 10227 2806 3604 I jank_cuj_events_cancel_request: [67,1681207048975422000,2661962746089,2661962746293] + 1681207048.997640003 1000 1654 10793 I wm_task_created: 109 + 1681207049.002909331 1000 1654 10793 I wm_task_moved: [109,109,0,1,6] + 1681207049.002936634 1000 1654 10793 I wm_task_to_front: [0,109,0] + 1681207049.003380481 1000 1654 10793 I wm_create_task: [0,109,109,0] + 1681207049.003422148 1000 1654 10793 I wm_create_activity: [0,188766343,109,com.google.android.apps.photos/.home.HomeActivity,android.intent.action.MAIN,NULL,NULL,270532608] + 1681207049.003610177 1000 1654 10793 I wm_task_moved: [109,109,0,1,6] + 1681207049.005225045 1000 1654 10793 I wm_pause_activity: [0,225733613,com.google.android.apps.nexuslauncher/.NexusLauncherActivity,userLeaving=true,pauseBackTasks] + 1681207049.008557768 10227 2806 2806 I wm_on_top_resumed_lost_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,topStateChangedWhenResumed] + 1681207049.009063790 10227 2806 2806 I wm_on_paused_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,performPause,0] + 1681207049.010960844 1000 1654 11103 I wm_add_to_stopping: [0,225733613,com.google.android.apps.nexuslauncher/.NexusLauncherActivity,makeInvisible] + 1681207049.011341297 1000 1654 11103 I wm_restart_activity: [0,188766343,109,com.google.android.apps.photos/.home.HomeActivity] + 1681207049.012786813 1000 1654 11103 I wm_set_resumed_activity: [0,com.google.android.apps.photos/.home.HomeActivity,minimalResumeActivityLocked - onActivityStateChanged] + 1681207049.014562651 1000 1654 1692 I sysui_multi_action: [757,803,799,window_time_0,802,1] + 1681207049.016519519 1000 1654 1695 I am_uid_active: 10216 + 1681207049.016556629 1000 1654 1696 I input_focus: [Requesting to set focus to null window,reason=UpdateInputWindows] + 1681207049.021999215 1000 1654 1808 I am_unfreeze: [14176,com.google.android.apps.photos] + 1681207049.036460112 10227 2806 3604 I jank_cuj_events_begin_request: [8,1681207049036390000,2662023713985,2662023714066,] + 1681207049.037569975 1000 1654 1821 I input_focus: [Focus leaving 268cd60 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity (server),reason=Waiting for window because NO_WINDOW] + 1681207049.059874012 10216 14176 14176 I wm_on_create_called: [188766343,com.google.android.apps.photos.home.HomeActivity,performCreate,20] + 1681207049.061116647 10216 14176 14176 I wm_on_start_called: [188766343,com.google.android.apps.photos.home.HomeActivity,handleStartActivity,1] + 1681207049.062957833 10216 14176 14176 I wm_on_resume_called: [188766343,com.google.android.apps.photos.home.HomeActivity,RESUME_ACTIVITY,1] + 1681207049.068858834 10216 14176 14176 I wm_on_top_resumed_gained_called: [188766343,com.google.android.apps.photos.home.HomeActivity,topStateChangedWhenResumed] + 1681207049.078810901 1000 1654 1696 I input_focus: [Focus request 2c6a168 com.google.android.apps.photos/com.google.android.apps.photos.home.HomeActivity,reason=UpdateInputWindows] + 1681207049.088823271 10241 2032 2153 I jank_cuj_events_begin_request: [39,1681207049088775000,2662076099076,2662076099117,] + 1681207049.092389962 1000 1654 1692 I sysui_multi_action: [319,44,321,40,322,100,325,2661,757,761,758,8,759,1,806,com.google.android.apps.photos,871,com.google.android.apps.photos.home.HomeActivity,904,com.google.android.apps.nexuslauncher,905,0,1320,4,1321,24] + 1681207049.093085315 1000 1654 1692 I wm_activity_launch_time: [0,188766343,com.google.android.apps.photos/.home.HomeActivity,100] + 1681207049.102520415 1000 1654 1821 I input_focus: [Focus entering 2c6a168 com.google.android.apps.photos/com.google.android.apps.photos.home.HomeActivity (server),reason=Window became focusable. Previous reason: NO_WINDOW] + 1681207049.153166248 1000 1654 1692 I sysui_multi_action: [324,1,757,1090,758,12,806,com.google.android.apps.photos,871,com.google.android.apps.photos.home.HomeActivity,1091,165] + 1681207049.454860828 10241 2032 2153 I jank_cuj_events_end_request: [39,1681207049454643000,2662441975093,2662441975297] + 1681207049.554655018 10227 2806 3604 I jank_cuj_events_end_request: [8,1681207049554479000,2662541809688,2662541810136] + 1681207049.561896025 1000 1654 1695 I wm_stop_activity: [0,225733613,com.google.android.apps.nexuslauncher/.NexusLauncherActivity] + 1681207049.574914905 1000 1654 11103 I wm_wallpaper_surface: [0,0,null] + 1681207049.579730294 10227 2806 2806 I wm_on_stop_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,STOP_ACTIVITY_ITEM,2] + 1681207049.591011300 1000 1654 1808 I am_unfreeze: [9196,com.google.process.gservices] + 1681207049.717793608 1000 1654 6209 I am_uid_active: 10167 + 1681207049.885676706 1000 1654 1821 I input_interaction: Interaction with: 2c6a168 com.google.android.apps.photos/com.google.android.apps.photos.home.HomeActivity (server), [Gesture Monitor] swipe-up (server), [Gesture Monitor] edge-swipe (server), PointerEventDispatcher0 (server), + 1681207049.899046172 1000 1654 1695 I wm_task_moved: [1,1,0,1,6] + 1681207049.899344186 1000 1654 1695 I wm_task_moved: [101,1,0,1,2147483647] + 1681207049.899370431 1000 1654 1695 I wm_task_to_front: [0,101,0] + 1681207049.899554717 1000 1654 1695 I wm_focused_root_task: [0,0,1,-1,startExistingRecents] + 1681207049.899762643 10216 14176 14176 I wm_on_top_resumed_lost_called: [188766343,com.google.android.apps.photos.home.HomeActivity,topStateChangedWhenResumed] + 1681207049.900260487 1000 1654 1695 I wm_set_resumed_activity: [0,com.google.android.apps.nexuslauncher/.NexusLauncherActivity,resumeTopActivity - onActivityStateChanged] + 1681207049.900776519 1000 1654 1695 I wm_resume_activity: [0,225733613,101,com.google.android.apps.nexuslauncher/.NexusLauncherActivity] + 1681207049.904926177 10227 2806 2806 I wm_on_restart_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,performRestart,0] + 1681207049.907580270 10227 2806 2806 I wm_on_start_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,handleStartActivity,2] + 1681207049.907795033 10227 2806 2806 I wm_on_resume_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,RESUME_ACTIVITY,0] + 1681207049.908100493 10227 2806 2806 I wm_on_top_resumed_gained_called: [225733613,com.google.android.apps.nexuslauncher.NexusLauncherActivity,topStateChangedWhenResumed] + 1681207049.913157134 1000 1654 2023 I input_cancel: [2c6a168 com.google.android.apps.photos/com.google.android.apps.photos.home.HomeActivity (server),reason=input channel stole pointer stream] + 1681207049.913244862 1000 1654 2023 I input_cancel: [[Gesture Monitor] edge-swipe (server),reason=input channel stole pointer stream] + 1681207049.913293649 10216 14176 14176 I view_enqueue_input_event: [Motion - Cancel,com.google.android.apps.photos/com.google.android.apps.photos.home.HomeActivity] + 1681207049.917973988 1000 1654 1821 I input_interaction: Interaction with: [Gesture Monitor] swipe-up (server), PointerEventDispatcher0 (server), + 1681207049.924828520 10227 2806 2806 I sysui_latency: [1,42] + 1681207049.924956287 10227 2806 3604 I jank_cuj_events_begin_request: [11,1681207049924893000,2662912216671,2662912216833,] + 1681207049.924998890 10227 2806 3604 I jank_cuj_events_begin_request: [9,1681207049924982000,2662912305375,2662912305416,] + 1681207049.925024484 10227 2806 3604 I jank_cuj_events_begin_request: [66,1681207049925003000,2662912326453,2662912326493,] + 1681207049.930600981 1000 1654 1696 I wm_wallpaper_surface: [0,1,Window{268cd60 u0 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity}] + 1681207049.931878773 1000 1654 1692 I sysui_multi_action: [319,31,322,29,325,2662,757,761,758,9,759,5,806,com.google.android.apps.nexuslauncher,871,com.google.android.apps.nexuslauncher.NexusLauncherActivity,905,0,1320,4,1321,24] + 1681207049.935776315 1000 1654 11103 I wm_set_resumed_activity: [0,com.google.android.apps.nexuslauncher/.NexusLauncherActivity,setFocusedTask-alreadyTop] + 1681207049.940226510 1000 1654 1696 I input_focus: [Focus request recents_animation_input_consumer,reason=UpdateInputWindows] + 1681207049.952110259 1000 1654 1821 I input_focus: [Focus leaving 2c6a168 com.google.android.apps.photos/com.google.android.apps.photos.home.HomeActivity (server),reason=Waiting for window because NOT_VISIBLE] + 1681207049.952171009 1000 1654 1821 I input_focus: [Focus entering recents_animation_input_consumer (server),reason=Window became focusable. Previous reason: NOT_VISIBLE] + 1681207049.965379790 10227 2806 3604 I jank_cuj_events_end_request: [65,1681207049965303000,2662952628210,2662952628414] + 1681207050.167619333 10241 2032 2153 I jank_cuj_events_end_request: [55,1681207050167531000,2663154859981,2663154860225] + 1681207050.230896758 1000 1654 1692 I sysui_latency: [8,40] + 1681207050.555624012 10227 2806 3604 I jank_cuj_events_cancel_request: [11,1681207050555494000,2663542820390,2663542820634] + 1681207050.555731678 10227 2806 3604 I jank_cuj_events_cancel_request: [66,1681207050555695000,2663543019527,2663543019812] + 1681207050.570117298 10227 2806 3604 I jank_cuj_events_end_request: [11,1681207050570020000,2663557348792,2663557349239] + 1681207050.570168487 10227 2806 3604 I jank_cuj_events_end_request: [9,1681207050570074000,2663557398434,2663557398556] + 1681207050.570319081 10227 2806 3604 I jank_cuj_events_end_request: [66,1681207050570285000,2663557609168,2663557609290] + 1681207050.573875396 1000 1654 11103 I wm_add_to_stopping: [0,188766343,com.google.android.apps.photos/.home.HomeActivity,makeInvisible] + 1681207050.574604929 1000 1654 11103 I wm_pause_activity: [0,188766343,com.google.android.apps.photos/.home.HomeActivity,userLeaving=true,finishTransition] + 1681207050.584755767 1000 1654 1696 I input_focus: [Focus request 268cd60 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity,reason=UpdateInputWindows] + 1681207050.586915028 1000 1654 1821 I input_focus: [Focus leaving recents_animation_input_consumer (server),reason=NOT_VISIBLE] + 1681207050.597062896 10216 14176 14176 I wm_on_paused_called: [188766343,com.google.android.apps.photos.home.HomeActivity,performPause,21] + 1681207050.598423329 1000 1654 1692 I sysui_multi_action: [757,803,799,window_time_0,802,1] + 1681207050.598497710 1000 1654 1695 I wm_stop_activity: [0,188766343,com.google.android.apps.photos/.home.HomeActivity] + 1681207050.619719064 1000 1654 1821 I input_focus: [Focus entering 268cd60 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity (server),reason=setFocusedWindow] + 1681207050.648848825 1000 1654 1821 I input_interaction: Interaction with: 956d30 StatusBar (server), [Gesture Monitor] swipe-up (server), [Gesture Monitor] edge-swipe (server), PointerEventDispatcher0 (server), + 1681207050.650068511 10241 2032 2032 I sysui_multi_action: [757,803,799,panel_open,802,1] + 1681207050.650466827 10241 2032 2153 I jank_cuj_events_begin_request: [0,1681207050650381000,2663637707434,2663637707678,Expand] + 1681207050.651434600 10241 2032 2032 I sysui_multi_action: [757,1328,758,4,1326,25,1327,4,1329,0] + 1681207050.702902170 10216 14176 14176 I wm_on_stop_called: [188766343,com.google.android.apps.photos.home.HomeActivity,STOP_ACTIVITY_ITEM,64] + 1681207050.704760650 1000 1654 6209 I sysui_multi_action: [757,127,758,1] + 1681207050.704790435 1000 1654 6209 I sysui_multi_action: [757,804,799,note_load,801,5,802,1] + 1681207050.704877186 1000 1654 6209 I notification_panel_revealed: 5 + 1681207050.716025827 1000 1654 1696 I input_focus: [Focus request fd59b56 NotificationShade,reason=UpdateInputWindows] + 1681207050.720782297 1000 1654 1821 I input_focus: [Focus leaving 268cd60 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity (server),reason=Waiting for window because NOT_VISIBLE] + 1681207050.723768828 1000 1654 3830 I sysui_multi_action: [757,128,758,1,793,2642524,794,0,795,2642524,796,26,798,1,806,android,857,DEVELOPER_IMPORTANT,858,4,946,ranker_group,947,0,1395,5,1500,796026,1688,1] + 1681207050.723832427 1000 1654 3830 I sysui_multi_action: [757,1501,758,1,793,2642524,794,0,795,2642524,796,26,806,android,857,DEVELOPER_IMPORTANT,858,4,946,ranker_group,947,0,1500,0,1688,1] + 1681207050.723867543 1000 1654 3830 I sysui_multi_action: [757,804,799,note_interruptive,801,0,802,1] + 1681207050.723889556 1000 1654 3830 I sysui_multi_action: [757,804,799,note_freshness,801,2642524,802,1] + 1681207050.723922474 1000 1654 3830 I notification_visibility: [-1|android|26|null|1000,1,2642524,2642524,0,1] + 1681207050.732759185 10241 2032 2153 I jank_cuj_events_begin_request: [0,1681207050732669000,2663719994178,2663719994300,Collapse] + 1681207050.736113555 1000 1654 1821 I input_focus: [Focus entering fd59b56 NotificationShade (server),reason=Window became focusable. Previous reason: NOT_VISIBLE] + 1681207051.227287302 1000 1654 3830 I sysui_multi_action: [757,128,758,1,793,2643147,794,0,795,2643147,796,54,798,2,806,android,857,DEVELOPER,858,2,946,ranker_group,947,0,1395,5,1500,796027,1688,1] + 1681207051.227472808 1000 1654 3830 I sysui_multi_action: [757,1501,758,1,793,2643147,794,0,795,2643147,796,54,806,android,857,DEVELOPER,858,2,946,ranker_group,947,0,1500,0,1688,1] + 1681207051.227528187 1000 1654 3830 I sysui_multi_action: [757,804,799,note_interruptive,801,0,802,1] + 1681207051.227574452 1000 1654 3830 I sysui_multi_action: [757,804,799,note_freshness,801,2643147,802,1] + 1681207051.227630930 1000 1654 3830 I notification_visibility: [-1|android|54|null|1000,1,2643147,2643147,0,2] + 1681207051.228475250 1000 1654 3830 I sysui_multi_action: [757,128,758,1,793,2632336,794,0,795,2632336,796,1,798,4,806,com.google.euiccpixel,857,ota_update,858,4,947,0,1395,5,1500,796027,1688,1,1745,2098068913] + 1681207051.228584014 1000 1654 3830 I sysui_multi_action: [757,1501,758,1,793,2632336,794,0,795,2632336,796,1,806,com.google.euiccpixel,857,ota_update,858,4,947,0,1500,0,1688,1,1745,2098068913] + 1681207051.228650136 1000 1654 3830 I sysui_multi_action: [757,804,799,note_interruptive,801,0,802,1] + 1681207051.228761627 1000 1654 3830 I sysui_multi_action: [757,804,799,note_freshness,801,2632336,802,1] + 1681207051.228805531 1000 1654 3830 I notification_visibility: [0|com.google.euiccpixel|1|null|10238,1,2632336,2632336,0,4] + 1681207051.229276885 1000 1654 3830 I sysui_multi_action: [757,128,758,1,793,2643141,794,0,795,2643141,796,2147483647,797,ranker_group,798,0,806,android,857,USB,858,1,946,ranker_group,947,1,1395,5,1500,2643141,1688,1] + 1681207051.229347116 1000 1654 3830 I sysui_multi_action: [757,804,799,note_freshness,801,2643141,802,1] + 1681207051.229412668 1000 1654 3830 I notification_visibility: [-1|android|2147483647|ranker_group|1000|ranker_group,1,2643141,2643141,0,0] + 1681207051.229923410 1000 1654 3830 I sysui_multi_action: [757,128,758,1,793,429394689,794,0,795,429394689,796,32,798,3,806,android,857,USB,858,1,946,ranker_group,947,0,1395,5,1500,796027,1688,1] + 1681207051.230036854 1000 1654 3830 I sysui_multi_action: [757,1501,758,1,793,429394689,794,0,795,429394689,796,32,806,android,857,USB,858,1,946,ranker_group,947,0,1500,0,1688,1] + 1681207051.230071929 1000 1654 3830 I sysui_multi_action: [757,804,799,note_interruptive,801,0,802,1] + 1681207051.230103708 1000 1654 3830 I sysui_multi_action: [757,804,799,note_freshness,801,429394689,802,1] + 1681207051.230129302 1000 1654 3830 I notification_visibility: [-1|android|32|null|1000,1,429394689,429394689,0,3] + 1681207051.423202423 10241 2032 2153 I jank_cuj_events_end_request: [0,1681207051423045000,2664410371619,2664410371741] + 1681207051.475255930 1000 1654 1821 I input_interaction: Interaction with: fd59b56 NotificationShade (server), [Gesture Monitor] swipe-up (server), [Gesture Monitor] edge-swipe (server), PointerEventDispatcher0 (server), + 1681207051.477718251 10241 2032 2153 I jank_cuj_events_begin_request: [5,1681207051477630000,2664464955441,2664464955522,] + 1681207051.478089060 10241 2032 2153 I jank_cuj_events_begin_request: [5,1681207051478052000,2664465375729,2664465375810,] + 1681207051.478207061 10241 2032 2153 I jank_cuj_events_begin_request: [0,1681207051478167000,2664465490963,2664465491045,Collapse] + 1681207051.546663035 10241 2032 2153 I jank_cuj_events_end_request: [5,1681207051546596000,2664533922034,2664533922197] + 1681207051.547048736 10241 2032 2153 I jank_cuj_events_begin_request: [0,1681207051547013000,2664534337358,2664534337480,Collapse] + 1681207051.697259592 1000 1654 1694 I commit_sys_config_file: [jobs,2] + 1681207051.736497629 1000 1654 11103 I sysui_multi_action: [757,128,758,2,793,2643656,794,509,795,2643656,796,54,798,2,806,android,857,DEVELOPER,858,2,946,ranker_group,947,0,1395,5,1500,509,1688,1] + 1681207051.736568552 1000 1654 11103 I notification_visibility: [-1|android|54|null|1000,0,2643656,2643656,0,2] + 1681207051.737020009 1000 1654 11103 I sysui_multi_action: [757,128,758,2,793,2632844,794,508,795,2632844,796,1,798,4,806,com.google.euiccpixel,857,ota_update,858,4,947,0,1395,5,1500,508,1688,1,1745,2098068913] + 1681207051.737043528 1000 1654 11103 I notification_visibility: [0|com.google.euiccpixel|1|null|10238,0,2632844,2632844,0,4] + 1681207051.737252756 1000 1654 11103 I sysui_multi_action: [757,128,758,2,793,2643649,794,508,795,2643649,796,2147483647,797,ranker_group,798,0,806,android,857,USB,858,1,946,ranker_group,947,1,1395,5,1500,2643649,1688,1] + 1681207051.737275909 1000 1654 11103 I notification_visibility: [-1|android|2147483647|ranker_group|1000|ranker_group,0,2643649,2643649,0,0] + 1681207051.737472849 1000 1654 11103 I sysui_multi_action: [757,128,758,2,793,429395197,794,508,795,429395197,796,32,798,3,806,android,857,USB,858,1,946,ranker_group,947,0,1395,5,1500,508,1688,1] + 1681207051.737495391 1000 1654 11103 I notification_visibility: [-1|android|32|null|1000,0,429395197,429395197,0,3] + 1681207051.773215077 1000 1654 11103 I sysui_multi_action: [757,128,758,2,793,2643573,794,1049,795,2643573,796,26,798,1,806,android,857,DEVELOPER_IMPORTANT,858,4,946,ranker_group,947,0,1395,5,1500,1049,1688,1] + 1681207051.773321034 1000 1654 11103 I notification_visibility: [-1|android|26|null|1000,0,2643573,2643573,0,1] + 1681207051.774938832 10241 2032 2153 I jank_cuj_events_end_request: [0,1681207051774831000,2664762157142,2664762157264] + 1681207051.786178131 1000 1654 3830 I sysui_multi_action: [757,127,758,2] + 1681207051.786332224 1000 1654 3830 I notification_panel_hidden: + 1681207051.786431549 1000 1654 1696 I input_focus: [Focus request 268cd60 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity,reason=UpdateInputWindows] + 1681207051.802442250 1000 1654 1821 I input_focus: [Focus leaving fd59b56 NotificationShade (server),reason=NOT_FOCUSABLE] + 1681207051.802530873 1000 1654 1821 I input_focus: [Focus entering 268cd60 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity (server),reason=setFocusedWindow] \ No newline at end of file diff --git a/tools/winscope/src/trace/flickerlib/common.js b/tools/winscope/src/trace/flickerlib/common.js index 05835b8b2..9b66fdb5e 100644 --- a/tools/winscope/src/trace/flickerlib/common.js +++ b/tools/winscope/src/trace/flickerlib/common.js @@ -54,6 +54,15 @@ const Transform = require('flicker').android.tools.common.traces.surfaceflinger. const Display = require('flicker').android.tools.common.traces.surfaceflinger.Display; const Region = require('flicker').android.tools.common.datatypes.Region; +// Event Log +const EventLog = require('flicker').android.tools.common.traces.events.EventLog; +const CujEvent = require('flicker').android.tools.common.traces.events.CujEvent; +const CujType = require('flicker').android.tools.common.traces.events.CujType; +const Event = require('flicker').android.tools.common.traces.events.Event; +const FlickerEvent = require('flicker').android.tools.common.traces.events.FlickerEvent; +const FocusEvent = require('flicker').android.tools.common.traces.events.FocusEvent; +const EventLogParser = require('flicker').android.tools.common.parsers.events.EventLogParser; + // Common const Size = require('flicker').android.tools.common.datatypes.Size; const ActiveBuffer = require('flicker').android.tools.common.datatypes.ActiveBuffer; @@ -285,6 +294,14 @@ export { Matrix22, Matrix33, Display, + // Eventlog + EventLog, + CujEvent, + CujType, + Event, + FlickerEvent, + FocusEvent, + EventLogParser, // Common Size, ActiveBuffer, diff --git a/tools/winscope/src/trace/trace_type.ts b/tools/winscope/src/trace/trace_type.ts index 3442f5db7..f03252053 100644 --- a/tools/winscope/src/trace/trace_type.ts +++ b/tools/winscope/src/trace/trace_type.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import {Event} from 'trace/flickerlib/common'; import {LayerTraceEntry} from './flickerlib/layers/LayerTraceEntry'; import {WindowManagerState} from './flickerlib/windows/WindowManagerState'; import {LogMessage} from './protolog'; @@ -55,6 +56,7 @@ export interface TraceEntryTypeMap { [TraceType.INPUT_METHOD_CLIENTS]: object; [TraceType.INPUT_METHOD_MANAGER_SERVICE]: object; [TraceType.INPUT_METHOD_SERVICE]: object; + [TraceType.EVENT_LOG]: Event; [TraceType.TAG]: object; [TraceType.ERROR]: object; [TraceType.TEST_TRACE_STRING]: string;