1// Copyright (c) Huawei Technologies Co., Ltd. 2021-2023. All rights reserved. 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 16option java_package = "ohos.devtools.datasources.transport.grpc.service"; 17 18// Common message define for profiler tools, imported by profiler and plugin proto file. 19message ProfilerPluginConfig { 20 string name = 1; 21 string plugin_sha256 = 2; 22 uint32 sample_interval = 3; // Polling plugin collection interval(ms) 23 bytes config_data = 4; 24 string clock = 5; 25 bool is_protobuf_serialize = 6; // data encoding method, true is protobuf, false is protoencoder 26} 27 28message ProfilerPluginState { 29 string name = 1; 30 enum State { 31 INITED = 0; 32 REGISTERED = 1; // registered to plugin service. 33 LOADED = 2; // have created session. 34 IN_SESSION = 3; // have started session. 35 }; 36 State state = 2; 37} 38 39// for FetchDataResponse 40message ProfilerPluginData { 41 string name = 1; 42 uint32 status = 2; 43 bytes data = 3; 44 enum ClockId { 45 CLOCKID_REALTIME = 0; 46 CLOCKID_MONOTONIC = 1; 47 CLOCKID_PROCESS_CPUTIME_ID = 2; // since Linux 2.6.12 48 CLOCKID_THREAD_CPUTIME_ID = 3; // since Linux 2.6.12 49 CLOCKID_MONOTONIC_RAW = 4; // since Linux 2.6.28; Linux-specific 50 CLOCKID_REALTIME_COARSE = 5; // since Linux 2.6.32; Linux-specific 51 CLOCKID_MONOTONIC_COARSE = 6; // since Linux 2.6.32; Linux-specific 52 CLOCKID_BOOTTIME = 7; // since Linux 2.6.39; Linux-specific 53 CLOCKID_REALTIME_ALARM = 8; // since Linux 3.0; Linux-specific 54 CLOCKID_BOOTTIME_ALARM = 9; // since Linux 3.0; Linux-specific 55 CLOCKID_SGI_CYCLE = 10; 56 CLOCKID_TAI = 11; // since Linux 3.10; Linux-specific 57 }; 58 ClockId clock_id = 4; 59 uint64 tv_sec = 5; 60 uint64 tv_nsec = 6; 61 string version = 7; // "1.01" 62 uint32 sample_interval = 8; // Polling plugin collection interval(ms) 63} 64