• 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
16option java_package = "ohos.devtools.datasources.transport.grpc.service";
17option optimize_for = LITE_RUNTIME;
18
19message SampleTimeStamp {
20    uint64 tv_sec = 1;
21    uint64 tv_nsec = 2;
22}
23
24message CpuCoreFrequency {
25  int32 min_frequency_khz = 1;
26  int32 max_frequency_khz = 2;
27  int32 cur_frequency_khz = 3;
28}
29
30message CpuCoreUsageInfo {
31    int32 cpu_core = 1;
32    int64 prev_system_cpu_time_ms = 2;
33    int64 prev_system_boot_time_ms = 3;
34    int64 system_cpu_time_ms = 4;
35    int64 system_boot_time_ms = 5;
36    CpuCoreFrequency frequency = 6;
37    bool is_little_core = 7;
38}
39
40message CpuUsageInfo {
41    int64 prev_process_cpu_time_ms = 1;
42    int64 prev_system_cpu_time_ms = 2;
43    int64 prev_system_boot_time_ms = 3;
44    int64 process_cpu_time_ms = 4;
45    int64 system_cpu_time_ms = 5;
46    int64 system_boot_time_ms = 6;
47    repeated CpuCoreUsageInfo cores = 7;
48    SampleTimeStamp timestamp = 8;
49}
50
51enum ThreadState {
52    THREAD_UNSPECIFIED = 0;
53    THREAD_RUNNING = 1;
54    THREAD_SLEEPING = 2;
55    THREAD_STOPPED = 3;
56    THREAD_WAITING = 4;
57}
58
59message ThreadInfo {
60    int32 tid = 1;
61    string thread_name = 2;
62    ThreadState thread_state = 3;
63    int64 prev_thread_cpu_time_ms = 4;
64    int64 thread_cpu_time_ms = 5;
65    SampleTimeStamp timestamp = 6;
66}
67
68message CpuData {
69    CpuUsageInfo cpu_usage_info = 1;
70    repeated ThreadInfo thread_info = 2;
71}
72