• 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
19// Java heap memory event from jvmti interface.
20message ClassInfo {
21    int32 class_id = 1;
22    string class_name = 2;
23}
24
25message AllocationInfo {
26    int32 object_id = 1;
27    int32 class_id = 2;
28    int32 object_size = 3;
29    int32 array_length = 4;
30    int32 heap_id = 5;
31    string thread_name = 6;
32
33    message StackFrameInfo {
34        int32 frame_id = 1;
35        string class_name = 2;
36        string method_name = 3;
37        string file_name = 4;
38        int32 line_number = 5;
39    }
40    // First element means stack top.
41    repeated StackFrameInfo frame_info = 7;
42}
43
44message DeallocationInfo {
45    int32 object_id = 1;
46}
47
48message AgentMemoryEvent {
49    // timestamp obtained by CLOCK_REALTIME
50    uint64 tv_sec = 1;
51    uint64 tv_nsec = 2;
52
53    oneof event {
54        ClassInfo class_data = 3;
55        AllocationInfo alloc_data = 4;
56        DeallocationInfo free_data = 5;
57    }
58}
59
60message BatchAgentMemoryEvent {
61    repeated AgentMemoryEvent events = 1;
62}
63