1/* 2 * Copyright 2019, 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 * http://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 */ 16 17import {transform, nanos_to_string, get_visible_chip} from './transform.js' 18 19function transform_launcher(launcher) { 20 return transform({ 21 obj: launcher, 22 kind: 'launcher', 23 name: 'launcher', 24 children: [] 25 }); 26} 27 28function transform_entry(entry) { 29 return transform({ 30 obj: entry, 31 kind: 'entry', 32 name: nanos_to_string(entry.elapsedRealtimeNanos), 33 children: [ 34 [[entry.launcher], transform_launcher] 35 ], 36 timestamp: entry.elapsedRealtimeNanos, 37 stableId: 'entry' 38 }); 39} 40 41function transform_launcher_trace(entries) { 42 return transform({ 43 obj: entries, 44 kind: 'entries', 45 name: 'entries', 46 children: [ 47 [entries.entry, transform_entry], 48 ], 49 }); 50} 51 52export {transform_launcher_trace}; 53