1/* 2 * Copyright (C) 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 17syntax = "proto2"; 18 19package perfetto.protos; 20 21message ObservableEvents { 22 enum Type { 23 TYPE_UNSPECIFIED = 0; 24 25 // State changes of data source instances associated with the consumer's 26 // session. Note that not all data sources may support these notifications. 27 // See |will_notify_on_start/stop| in DataSourceDescriptor. 28 TYPE_DATA_SOURCES_INSTANCES = 1; 29 30 // State change triggered when all data sources are in the STARTED state. 31 // For data sources that registered with |will_notify_on_start| this happens 32 // only after the data source has acked the start. This allows the consumer 33 // to synchronize with the data sources and to perform actions (e.g. start a 34 // test binary) only after trace recording is actually started. 35 // Introduced in Android 11 (R). 36 TYPE_ALL_DATA_SOURCES_STARTED = 2; 37 38 // Note: internally these are used as OR flags. Next values: 4, 8, 16, ... 39 40 // TODO(eseckler): Extend this for producer & data source registrations. 41 } 42 43 enum DataSourceInstanceState { 44 // A data source is created in stopped state. 45 DATA_SOURCE_INSTANCE_STATE_STOPPED = 1; 46 DATA_SOURCE_INSTANCE_STATE_STARTED = 2; 47 } 48 49 message DataSourceInstanceStateChange { 50 optional string producer_name = 1; 51 optional string data_source_name = 2; 52 optional DataSourceInstanceState state = 3; 53 } 54 55 repeated DataSourceInstanceStateChange instance_state_changes = 1; 56 optional bool all_data_sources_started = 2; 57} 58