1-- 2-- Copyright 2023 The Android Open Source Project 3-- 4-- Licensed under the Apache License, Version 2.0 (the "License"); 5-- you may not use this file except in compliance with the License. 6-- You may obtain a copy of the License at 7-- 8-- https://www.apache.org/licenses/LICENSE-2.0 9-- 10-- Unless required by applicable law or agreed to in writing, software 11-- distributed under the License is distributed on an "AS IS" BASIS, 12-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13-- See the License for the specific language governing permissions and 14-- limitations under the License. 15 16INCLUDE PERFETTO MODULE android.slices; 17 18-- Table of ShadeListBuilder.buildList slices 19DROP TABLE IF EXISTS shade_list_builder_build_list_slices; 20CREATE PERFETTO TABLE shade_list_builder_build_list_slices AS 21SELECT 22 s.name name, 23 dur, 24 s.id id 25FROM slice s 26 JOIN thread_track ON thread_track.id = s.track_id 27 JOIN thread USING (utid) 28WHERE 29 thread.is_main_thread AND 30 s.dur > 0 AND ( 31 s.name GLOB 'ShadeListBuilder.buildList' 32 ); 33 34-- Table of ShadeListBuilder.buildList slices with the descendants 35DROP TABLE IF EXISTS slices_and_descendants; 36CREATE PERFETTO TABLE slices_and_descendants AS 37SELECT 38 parent.name name, 39 descendant.name descendant_name, 40 parent.dur dur_ns, 41 parent.id id 42FROM shade_list_builder_build_list_slices parent 43LEFT JOIN descendant_slice(parent.id) AS descendant;