• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    // When a tracing session has one or more triggers of type CLONE_SNAPSHOT
39    // and a matching trigger is hit, the service will send this notification to
40    // the consumer after |stop_delay_ms|.
41    TYPE_CLONE_TRIGGER_HIT = 4;
42
43    // Note: internally these are used as OR flags. Next values: 4, 8, 16, ...
44
45    // TODO(eseckler): Extend this for producer & data source registrations.
46  }
47
48  enum DataSourceInstanceState {
49    // A data source is created in stopped state.
50    DATA_SOURCE_INSTANCE_STATE_STOPPED = 1;
51    DATA_SOURCE_INSTANCE_STATE_STARTED = 2;
52  }
53
54  message DataSourceInstanceStateChange {
55    optional string producer_name = 1;
56    optional string data_source_name = 2;
57    optional DataSourceInstanceState state = 3;
58  }
59
60  message CloneTriggerHit {
61    // The TracingSessionID of the original tracing session which had a
62    // CLONE_SNAPSHOT trigger defined. This is necessary just because the
63    // consumer has no idea of what is the TSID of its own tracing session and
64    // there is no other good way to plumb it.
65    optional int64 tracing_session_id = 1;
66
67    // The name of the CLONE_SNAPSHOT trigger which was hit.
68    optional string trigger_name = 2;
69    // The name of the producer that sent the CLONE_SNAPSHOT trigger.
70    optional string producer_name = 3;
71    // The uid of the producer that sent the CLONE_SNAPSHOT trigger.
72    optional uint32 producer_uid = 4;
73    // The timestamp of the CLONE_SNAPSHOT trigger which was hit.
74    optional uint64 boot_time_ns = 5;
75  }
76
77  repeated DataSourceInstanceStateChange instance_state_changes = 1;
78  optional bool all_data_sources_started = 2;
79  optional CloneTriggerHit clone_trigger_hit = 3;
80}
81