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 19import "memory_plugin_common.proto"; 20 21// Data format of memory collect plug-in. 22// Various memory data count, including system level and application level. 23// Obtained from the proc file system or system service. 24message SysMeminfo { 25 SysMeminfoType key = 1; 26 uint64 value = 2; 27}; 28message SysVMeminfo { 29 SysVMeminfoType key = 1; 30 uint64 value = 2; 31}; 32 33message SmapsInfo { 34 string mapinfo = 1; 35 int32 size = 2; 36 int32 rss = 3; 37 int32 pss = 4; 38 int32 anonymous = 5; 39}; 40 41message AppSummary { 42 uint64 java_heap = 1; 43 uint64 native_heap = 2; 44 uint64 code = 3; 45 uint64 stack = 4; 46 uint64 graphics = 5; 47 uint64 private_other = 6; 48 uint64 system = 7; 49}; 50 51message ProcessMemoryInfo { 52 int32 pid = 1; 53 string name = 2; 54 // data from /proc/$pid/stat 55 uint64 vm_size_kb = 3; 56 uint64 vm_rss_kb = 4; 57 uint64 rss_anon_kb = 5; 58 uint64 rss_file_kb = 6; 59 uint64 rss_shmem_kb = 7; 60 uint64 vm_swap_kb = 8; 61 uint64 vm_locked_kb = 9; 62 uint64 vm_hwm_kb = 10; 63 int64 oom_score_adj = 11; 64 // data from /proc/$pid/smaps 65 repeated SmapsInfo smapinfo = 12; 66 AppSummary memsummary = 13; 67} 68 69message MemoryData { 70 repeated ProcessMemoryInfo processesinfo = 1; 71 repeated SysMeminfo meminfo = 2; 72 repeated SysVMeminfo vmeminfo = 3; 73} 74