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 36message RegisterPluginResponse { 37 ResponseStatus status = 1; 38 uint32 plugin_id = 2; 39} 40 41// for UnregisterPlugin API 42message UnregisterPluginRequest { 43 uint32 request_id = 1; 44 uint32 plugin_id = 2; 45} 46 47message UnregisterPluginResponse { 48 ResponseStatus status = 1; 49} 50 51// for GetCommand API 52message GetCommandRequest { 53 uint32 request_id = 1; 54} 55 56message CreateSessionCmd { 57 repeated uint32 buffer_sizes = 1; 58 repeated ProfilerPluginConfig plugin_configs = 2; 59} 60 61message DestroySessionCmd { 62 repeated uint32 plugin_ids = 1; 63} 64 65message StartSessionCmd { 66 repeated uint32 plugin_ids = 1; 67 repeated ProfilerPluginConfig plugin_configs = 2; 68} 69 70message StopSessionCmd { 71 repeated uint32 plugin_ids = 1; 72} 73 74message GetCommandResponse { 75 ResponseStatus status = 1; 76 bool has_more = 2; 77 uint32 command_id = 3; 78 oneof command { 79 CreateSessionCmd create_session_cmd = 10; 80 DestroySessionCmd destroy_session_cmd = 11; 81 StartSessionCmd start_session_cmd = 12; 82 StopSessionCmd stop_session_cmd = 13; 83 } 84} 85 86// for NotifyResult API 87message BufferDescriptor { 88 int32 buffer_id = 1; 89 uint32 offset = 2; 90 uint32 length = 3; 91} 92 93message PluginResult { 94 uint32 plugin_id = 1; 95 oneof descriptor { 96 bytes data = 2; 97 BufferDescriptor buffer = 3; 98 }; 99 ProfilerPluginState status = 10; 100} 101 102message NotifyResultRequest { 103 uint32 request_id = 1; 104 uint32 command_id = 2; 105 repeated PluginResult result = 3; 106} 107 108message NotifyResultResponse { 109 ResponseStatus status = 1; 110} 111