1/*
2 * Copyright (C) 2020 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
21// Events emitted by the tracing service.
22message TracingServiceEvent {
23  oneof event_type {
24    // When each of the following booleans are set to true, they report the
25    // point in time (through TracePacket's timestamp) where the condition
26    // they describe happened.
27    // The order of the booleans below matches the timestamp ordering
28    // they would generally be expected to have.
29
30    // Emitted when we start tracing and specifically, this will be before any
31    // producer is notified about the existence of this trace. This is always
32    // emitted before the all_data_sources_started event. This event is also
33    // guaranteed to be seen (byte-offset wise) before any data packets from
34    // producers.
35    bool tracing_started = 2;
36
37    // Emitted after all data sources saw the start event and ACKed it.
38    // This identifies the point in time when it's safe to assume that all data
39    // sources have been recording events.
40    bool all_data_sources_started = 1;
41
42    // Emitted when all data sources have been flushed successfully or with an
43    // error (including timeouts). This can generally happen many times over the
44    // course of the trace.
45    bool all_data_sources_flushed = 3;
46
47    // Emitted when reading back the central tracing buffers has been completed.
48    // If |write_into_file| is specified, this can happen many times over the
49    // course of the trace.
50    bool read_tracing_buffers_completed = 4;
51
52    // Emitted after tracing has been disabled and specifically, this will be
53    // after all packets from producers have been included in the central
54    // tracing buffer.
55    bool tracing_disabled = 5;
56
57    // Emitted if perfetto --save-for-bugreport was invoked while the current
58    // tracing session was running and it had the highest bugreport_score. In
59    // this case the original consumer will see a nearly empty trace, because
60    // the contents are routed onto the bugreport file. This event flags the
61    // situation explicitly. Traces that contain this marker should be discarded
62    // by test infrastructures / pipelines.
63    bool seized_for_bugreport = 6;
64  }
65}
66