1 /* 2 * Copyright (C) 2017 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 17 syntax = "proto2"; 18 option optimize_for = LITE_RUNTIME; 19 20 import "perfetto/config/trace_config.proto"; 21 import "perfetto/trace/chrome/chrome_trace_event.proto"; 22 import "perfetto/trace/clock_snapshot.proto"; 23 import "perfetto/trace/filesystem/inode_file_map.proto"; 24 import "perfetto/trace/ftrace/ftrace_event_bundle.proto"; 25 import "perfetto/trace/ftrace/ftrace_stats.proto"; 26 import "perfetto/trace/ps/process_tree.proto"; 27 import "perfetto/trace/test_event.proto"; 28 import "perfetto/trace/trace_stats.proto"; 29 30 package perfetto.protos; 31 32 // The root object emitted by Perfetto. A perfetto trace is just a stream of 33 // TracePacket(s). 34 // 35 // Next id: 7. 36 message TracePacket { 37 oneof data { 38 FtraceEventBundle ftrace_events = 1; 39 ProcessTree process_tree = 2; 40 InodeFileMap inode_file_map = 4; 41 ChromeEventBundle chrome_events = 5; 42 ClockSnapshot clock_snapshot = 6; 43 44 // IDs up to 32 are reserved for events that are quite frequent because they 45 // take only one byte to encode their preamble. 46 47 TraceConfig trace_config = 33; 48 FtraceStats ftrace_stats = 34; 49 TraceStats trace_stats = 35; 50 51 // This field is only used for testing. 52 TestEvent for_testing = 536870911; // 2^29 - 1, max field id for protos. 53 } 54 // Trusted user id of the producer which generated this packet. Keep in sync 55 // with TrustedPacket.trusted_uid. 56 oneof optional_trusted_uid { int32 trusted_uid = 3; }; 57 } 58