1-- Copyright 2024 The Chromium Authors 2-- Use of this source code is governed by a BSD-style license that can be 3-- found in the LICENSE file. 4 5INCLUDE PERFETTO MODULE slices.with_context; 6 7-- Top level scroll events, with metrics. 8CREATE PERFETTO TABLE chrome_scroll_interactions( 9 -- Unique id for an individual scroll. 10 id LONG, 11 -- Name of the scroll event. 12 name STRING, 13 -- Start timestamp of the scroll. 14 ts TIMESTAMP, 15 -- Duration of the scroll. 16 dur DURATION, 17 -- The total number of frames in the scroll. 18 frame_count LONG, 19 -- The total number of vsyncs in the scroll. 20 vsync_count LONG, 21 -- The maximum number of vsyncs missed during any and all janks. 22 missed_vsync_max LONG, 23 -- The total number of vsyncs missed during any and all janks. 24 missed_vsync_sum LONG, 25 -- The number of delayed frames. 26 delayed_frame_count LONG, 27 -- The number of frames that are deemed janky to the human eye after Chrome 28 -- has applied its scroll prediction algorithm. 29 predictor_janky_frame_count LONG, 30 -- The process id this event occurred on. 31 renderer_upid LONG 32) AS 33WITH scroll_metrics AS ( 34 SELECT 35 id, 36 ts, 37 dur, 38 EXTRACT_ARG(arg_set_id, 'scroll_metrics.frame_count') 39 AS frame_count, 40 EXTRACT_ARG(arg_set_id, 'scroll_metrics.vsync_count') 41 AS vsync_count, 42 EXTRACT_ARG(arg_set_id, 'scroll_metrics.missed_vsync_max') 43 AS missed_vsync_max, 44 EXTRACT_ARG(arg_set_id, 'scroll_metrics.missed_vsync_sum') 45 AS missed_vsync_sum, 46 EXTRACT_ARG(arg_set_id, 'scroll_metrics.delayed_frame_count') 47 AS delayed_frame_count, 48 EXTRACT_ARG(arg_set_id, 'scroll_metrics.predictor_janky_frame_count') 49 AS predictor_janky_frame_count, 50 upid AS renderer_upid 51 FROM process_slice 52 WHERE name = 'Scroll' 53) 54SELECT 55 id, 56 'Scroll' AS name, 57 ts, 58 dur, 59 frame_count, 60 vsync_count, 61 missed_vsync_max, 62 missed_vsync_sum, 63 delayed_frame_count, 64 predictor_janky_frame_count, 65 renderer_upid 66FROM scroll_metrics; 67