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 {time} from '../base/time'; 16import {Cpu} from '../base/multi_machine_trace'; 17 18export interface TraceInfo { 19 readonly traceTitle: string; // File name and size of the current trace. 20 readonly traceUrl: string; // URL of the Trace. 21 22 readonly start: time; 23 readonly end: time; 24 25 // This is the ts value at the time of the Unix epoch. 26 // Normally some large negative value, because the unix epoch is normally in 27 // the past compared to ts=0. 28 readonly realtimeOffset: time; 29 30 // This is the timestamp that we should use for our offset when in UTC mode. 31 // Usually the most recent UTC midnight compared to the trace start time. 32 readonly utcOffset: time; 33 34 // Trace TZ is like UTC but keeps into account also the timezone_off_mins 35 // recorded into the trace, to show timestamps in the device local time. 36 readonly traceTzOffset: time; 37 38 // The list of CPUs in the trace 39 readonly cpus: Cpu[]; 40 41 // The number of import/analysis errors present in the `stats` table. 42 readonly importErrors: number; 43 44 // The trace type inferred by TraceProcessor (e.g. 'proto', 'json, ...). 45 // See TraceTypeToString() in src/trace_processor/util/trace_type.cc for 46 // all the available types. 47 readonly traceType?: string; 48 49 // True if the trace contains any ftrace data (sched or other ftrace events). 50 readonly hasFtrace: boolean; 51 52 // The UUID of the trace. This is generated by TraceProcessor by either 53 // looking at the TraceUuid packet emitted by traced or, as a fallback, by 54 // hashing the first KB of the trace. This can be an empty string in rare 55 // cases (e.g., opening an empty trace). 56 readonly uuid: string; 57 58 // Wheteher the current trace has been successfully stored into cache storage. 59 readonly cached: boolean; 60 61 // Returns true if the current trace can be downloaded via getTraceFile(). 62 // The trace isn't downloadable in the following cases: 63 // - It comes from a source (e.g. HTTP+RPC) that doesn't support re-download 64 // due to technical limitations. 65 // - Download is disabled because the trace was pushed via postMessage and 66 // the caller has asked to disable downloads. 67 readonly downloadable: boolean; 68} 69