1/*
2 * Copyright (C) 2022 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 = "proto3";
18import "perfetto_trace.proto";
19
20package tracing_vm_proto;
21
22// zero is invalid session id and indicates an error.
23message TracingSessionIdentifier {
24    uint64 session_id = 1;
25}
26
27message StartTracingRequest {
28    perfetto.protos.TraceConfig host_config = 1;
29}
30
31message RequestStatus {
32    bool is_ok = 1;
33    string error_str = 2;
34    TracingSessionIdentifier session_id = 3;
35}
36
37message TracingFileBuffer {
38    bytes buffer = 1;
39}
40
41service TracingServer {
42    rpc StartTracing(StartTracingRequest) returns (RequestStatus) {}
43
44    rpc StopTracing(TracingSessionIdentifier) returns (RequestStatus) {}
45
46    rpc GetTracingFile(TracingSessionIdentifier) returns (stream TracingFileBuffer) {}
47}
48