• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) 2021-2023 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
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;
23    bytes  config_data = 4;
24    string clock = 5;
25}
26
27message ProfilerPluginState {
28    string name = 1;
29    enum State {
30        INITED = 0;
31        REGISTERED = 1; // registered to plugin service.
32        LOADED = 2;     // have created session.
33        IN_SESSION = 3; // have started session.
34    };
35    State state = 2;
36}
37
38// for FetchDataResponse
39message ProfilerPluginData {
40    string name = 1;
41    uint32 status = 2;
42    bytes data = 3;
43    enum ClockId {
44        CLOCKID_REALTIME = 0;
45        CLOCKID_MONOTONIC = 1;
46        CLOCKID_PROCESS_CPUTIME_ID = 2; // since Linux 2.6.12
47        CLOCKID_THREAD_CPUTIME_ID = 3;  // since Linux 2.6.12
48        CLOCKID_MONOTONIC_RAW = 4;      // since Linux 2.6.28; Linux-specific
49        CLOCKID_REALTIME_COARSE = 5;    // since Linux 2.6.32; Linux-specific
50        CLOCKID_MONOTONIC_COARSE = 6;   // since Linux 2.6.32; Linux-specific
51        CLOCKID_BOOTTIME = 7;           // since Linux 2.6.39; Linux-specific
52        CLOCKID_REALTIME_ALARM = 8;     // since Linux 3.0; Linux-specific
53        CLOCKID_BOOTTIME_ALARM = 9;     // since Linux 3.0; Linux-specific
54        CLOCKID_SGI_CYCLE = 10;
55        CLOCKID_TAI = 11;               // since Linux 3.10; Linux-specific
56    };
57    ClockId clock_id = 4;
58    uint64 tv_sec = 5;
59    uint64 tv_nsec = 6;
60    string version = 7; // "1.01"
61}
62