• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 
16 #include "memory_collector_empty_impl.h"
17 
18 namespace OHOS {
19 namespace HiviewDFX {
20 namespace UCollectUtil {
Create()21 std::shared_ptr<MemoryCollector> MemoryCollector::Create()
22 {
23     return std::make_shared<MemoryCollectorEmptyImpl>();
24 }
25 
CollectProcessMemory(int32_t pid)26 CollectResult<ProcessMemory> MemoryCollectorEmptyImpl::CollectProcessMemory(int32_t pid)
27 {
28     return CollectResult<ProcessMemory>(UCollect::UcError::FEATURE_CLOSED);
29 }
30 
CollectSysMemory()31 CollectResult<SysMemory> MemoryCollectorEmptyImpl::CollectSysMemory()
32 {
33     return CollectResult<SysMemory>(UCollect::UcError::FEATURE_CLOSED);
34 }
35 
CollectRawMemInfo()36 CollectResult<std::string> MemoryCollectorEmptyImpl::CollectRawMemInfo()
37 {
38     return CollectResult<std::string>(UCollect::UcError::FEATURE_CLOSED);
39 }
40 
ExportMemView()41 CollectResult<std::string> MemoryCollectorEmptyImpl::ExportMemView()
42 {
43     return CollectResult<std::string>(UCollect::UcError::FEATURE_CLOSED);
44 }
45 
CollectAllProcessMemory()46 CollectResult<std::vector<ProcessMemory>> MemoryCollectorEmptyImpl::CollectAllProcessMemory()
47 {
48     return CollectResult<std::vector<ProcessMemory>>(UCollect::UcError::FEATURE_CLOSED);
49 }
50 
ExportAllProcessMemory()51 CollectResult<std::string> MemoryCollectorEmptyImpl::ExportAllProcessMemory()
52 {
53     return CollectResult<std::string>(UCollect::UcError::FEATURE_CLOSED);
54 }
55 
CollectRawSlabInfo()56 CollectResult<std::string> MemoryCollectorEmptyImpl::CollectRawSlabInfo()
57 {
58     return CollectResult<std::string>(UCollect::UcError::FEATURE_CLOSED);
59 }
60 
CollectRawPageTypeInfo()61 CollectResult<std::string> MemoryCollectorEmptyImpl::CollectRawPageTypeInfo()
62 {
63     return CollectResult<std::string>(UCollect::UcError::FEATURE_CLOSED);
64 }
65 
CollectRawDMA()66 CollectResult<std::string> MemoryCollectorEmptyImpl::CollectRawDMA()
67 {
68     return CollectResult<std::string>(UCollect::UcError::FEATURE_CLOSED);
69 }
70 
CollectAllAIProcess()71 CollectResult<std::vector<AIProcessMem>> MemoryCollectorEmptyImpl::CollectAllAIProcess()
72 {
73     return CollectResult<std::vector<AIProcessMem>>(UCollect::UcError::FEATURE_CLOSED);
74 }
75 
ExportAllAIProcess()76 CollectResult<std::string> MemoryCollectorEmptyImpl::ExportAllAIProcess()
77 {
78     return CollectResult<std::string>(UCollect::UcError::FEATURE_CLOSED);
79 }
80 
CollectRawSmaps(int32_t pid)81 CollectResult<std::string> MemoryCollectorEmptyImpl::CollectRawSmaps(int32_t pid)
82 {
83     return CollectResult<std::string>(UCollect::UcError::FEATURE_CLOSED);
84 }
85 
CollectHprof(int32_t pid)86 CollectResult<std::string> MemoryCollectorEmptyImpl::CollectHprof(int32_t pid)
87 {
88     return CollectResult<std::string>(UCollect::UcError::FEATURE_CLOSED);
89 }
90 
CollectProcessVss(int32_t pid)91 CollectResult<uint64_t> MemoryCollectorEmptyImpl::CollectProcessVss(int32_t pid)
92 {
93     return CollectResult<uint64_t>(UCollect::UcError::FEATURE_CLOSED);
94 }
95 
CollectMemoryLimit()96 CollectResult<MemoryLimit> MemoryCollectorEmptyImpl::CollectMemoryLimit()
97 {
98     return CollectResult<MemoryLimit>(UCollect::UcError::FEATURE_CLOSED);
99 }
100 
CollectDdrFreq()101 CollectResult<uint32_t> MemoryCollectorEmptyImpl::CollectDdrFreq()
102 {
103     return CollectResult<uint32_t>(UCollect::UcError::FEATURE_CLOSED);
104 }
105 
CollectProcessMemoryDetail(int32_t pid,GraphicMemOption option)106 CollectResult<ProcessMemoryDetail> MemoryCollectorEmptyImpl::CollectProcessMemoryDetail(int32_t pid,
107     GraphicMemOption option)
108 {
109     return CollectResult<ProcessMemoryDetail>(UCollect::UcError::FEATURE_CLOSED);
110 }
111 } // UCollectUtil
112 } // HiViewDFX
113 } // OHOS
114