1// Copyright (C) 2024 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15import {Utid} from '../../components/sql_utils/core_types'; 16import {DatasetSliceTrack} from '../../components/tracks/dataset_slice_track'; 17import {Trace} from '../../public/trace'; 18import {ChromeTasksDetailsPanel} from './details'; 19import {LONG, NUM, STR} from '../../trace_processor/query_result'; 20import {SourceDataset} from '../../trace_processor/dataset'; 21 22export function createChromeTasksThreadTrack( 23 trace: Trace, 24 uri: string, 25 utid: Utid, 26) { 27 return new DatasetSliceTrack({ 28 trace, 29 uri, 30 dataset: new SourceDataset({ 31 schema: { 32 id: NUM, 33 ts: LONG, 34 dur: LONG, 35 name: STR, 36 }, 37 src: 'chrome_tasks', 38 filter: { 39 col: 'utid', 40 eq: utid, 41 }, 42 }), 43 detailsPanel: (row) => new ChromeTasksDetailsPanel(trace, row.id), 44 }); 45} 46