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