• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17syntax = "proto2";
18
19package perfetto.protos;
20
21message IPCFrame {
22  // Client -> Host.
23  message BindService { optional string service_name = 1; }
24
25  // Host -> Client.
26  message BindServiceReply {
27    message MethodInfo {
28      optional uint32 id = 1;
29      optional string name = 2;
30    }
31    optional bool success = 1;
32    optional uint32 service_id = 2;
33    repeated MethodInfo methods = 3;
34  }
35
36  // Client -> Host.
37  message InvokeMethod {
38    optional uint32 service_id = 1;  // BindServiceReply.id.
39    optional uint32 method_id = 2;   // BindServiceReply.method.id.
40    optional bytes args_proto = 3;   // Proto-encoded request argument.
41
42    // When true the client specifies that a reply is not needed. The use case
43    // is a method with an empty, where the client doesn't care about the
44    // success/failure of the method invocation and rather prefers avoiding the
45    // IPC roundtrip + context switch associated with the reply.
46    optional bool drop_reply = 4;
47  }
48
49  // Host -> Client.
50  message InvokeMethodReply {
51    optional bool success = 1;
52    optional bool has_more = 2;      // only for streaming RPCs.
53    optional bytes reply_proto = 3;  // proto-encoded response value.
54  }
55
56  // Host -> Client.
57  message RequestError { optional string error = 1; }
58
59  // The client is expected to send requests with monotonically increasing
60  // request_id. The host will match the request_id sent from the client.
61  // In the case of a Streaming response (has_more = true) the host will send
62  // several InvokeMethodReply with the same request_id.
63  optional uint64 request_id = 2;
64
65  oneof msg {
66    BindService msg_bind_service = 3;
67    BindServiceReply msg_bind_service_reply = 4;
68    InvokeMethod msg_invoke_method = 5;
69    InvokeMethodReply msg_invoke_method_reply = 6;
70    RequestError msg_request_error = 7;
71  }
72
73  // Used only in unittests to generate a parsable message of arbitrary size.
74  repeated bytes data_for_testing = 1;
75};
76