• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) 2021 Huawei Device Co., Ltd.
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6//     http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14syntax = "proto3";
15
16import "common_types.proto";
17
18// Message define for IPC interface, imported by plugin service proto file.
19// for RegisterPlugin API
20
21enum ResponseStatus {
22    STATUS_UNSPECIFIED = 0;
23    OK = 1;
24    ERR = 2;
25}
26
27message RegisterPluginRequest {
28    uint32 request_id = 1;
29    string path = 2;
30    string sha256 = 3;
31
32    string name = 4;
33    uint32 buffer_size_hint = 5;
34
35    bool is_standalone_data = 6;
36    string out_file_name = 7;
37    string plugin_version = 8;
38}
39
40message RegisterPluginResponse {
41    ResponseStatus status = 1;
42    uint32 plugin_id = 2;
43}
44
45// for UnregisterPlugin API
46message UnregisterPluginRequest {
47    uint32 request_id = 1;
48    uint32 plugin_id = 2;
49}
50
51message UnregisterPluginResponse {
52    ResponseStatus status = 1;
53}
54
55// for GetCommand API
56message GetCommandRequest {
57    uint32 request_id = 1;
58}
59
60message CreateSessionCmd {
61    repeated uint32 buffer_sizes = 1;
62    repeated ProfilerPluginConfig plugin_configs = 2;
63}
64
65message DestroySessionCmd {
66    repeated uint32 plugin_ids = 1;
67}
68
69message StartSessionCmd {
70    repeated uint32 plugin_ids = 1;
71    repeated ProfilerPluginConfig plugin_configs = 2;
72}
73
74message StopSessionCmd {
75    repeated uint32 plugin_ids = 1;
76}
77
78message RefreshSessionCmd {
79    repeated uint32 plugin_ids = 1;
80}
81
82message GetCommandResponse {
83    ResponseStatus status = 1;
84    bool has_more = 2;
85    uint32 command_id = 3;
86    oneof command {
87        CreateSessionCmd create_session_cmd = 10;
88        DestroySessionCmd destroy_session_cmd = 11;
89        StartSessionCmd start_session_cmd = 12;
90        StopSessionCmd stop_session_cmd = 13;
91        RefreshSessionCmd refresh_session_cmd = 14;
92    }
93}
94
95// for NotifyResult API
96message BufferDescriptor {
97    int32 buffer_id = 1;
98    uint32 offset = 2;
99    uint32 length = 3;
100}
101
102message PluginResult {
103    uint32 plugin_id = 1;
104    oneof descriptor {
105        bytes data = 2;
106        BufferDescriptor buffer = 3;
107    };
108    ProfilerPluginState status = 10;
109    string out_file_name = 11; // The standalone plugin needs to add the output file name in the response of startSession
110}
111
112message NotifyResultRequest {
113    uint32 request_id = 1;
114    uint32 command_id = 2;
115    repeated PluginResult result = 3;
116}
117
118message NotifyResultResponse {
119    ResponseStatus status = 1;
120}
121