1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16package ohos.hdi.memorytracker.v1_0; 17 18enum MemoryTrackerType { 19 /* muti-media related */ 20 MEMORY_TRACKER_TYPE_MM = 0, 21 /* GL related */ 22 MEMORY_TRACKER_TYPE_GL = 1, 23 /* camera related */ 24 MEMORY_TRACKER_TYPE_CAM = 2, 25 /* graphic related */ 26 MEMORY_TRACKER_TYPE_GRAPH = 3, 27 MEMORY_TRACKER_TYPE_OTHER = 4, 28 MEMORY_TRACKER_TYPE_COUNTS, 29}; 30 31enum MemoryTrackerFlag { 32 /* memory shared with other processes */ 33 FLAG_SHARED_RSS = 2, 34 /* FLAG_SHARED_RSS / counts of shared processes */ 35 FLAG_SHARED_PSS = 4, 36 /* contrary to FLAG_SHARED_RSS */ 37 FLAG_PRIVATE = 8, 38 /* memory mapped in smaps */ 39 FLAG_MAPPED = 16, 40 /* contrary to FLAG_MAPPED */ 41 FLAG_UNMAPPED = 32, 42 /* CPU secure mode related */ 43 FLAG_PROTECTED = 64, 44 /* contrary to FLAG_PROTECTED */ 45 FLAG_UNPROTECTED = 128, 46 /* managed by system */ 47 FLAG_SYSTEM = 256, 48 /* contrary to FLAG_SYSTEM */ 49 FLAG_SYSTEM_EXCEPT = 512, 50 51}; 52 53struct MemoryRecord { 54 /* MemoryTracker Flags */ 55 int flags; 56 /* in Bytes */ 57 long size; 58}; 59