1 /* 2 * Copyright (c) 2024-2025 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 #include "perf_collector_empty_impl.h" 16 17 namespace OHOS { 18 namespace HiviewDFX { 19 namespace UCollectUtil { SetSelectPids(const std::vector<pid_t> & selectPids)20void PerfCollectorEmptyImpl::SetSelectPids(const std::vector<pid_t> &selectPids) 21 {} 22 SetTargetSystemWide(bool enable)23void PerfCollectorEmptyImpl::SetTargetSystemWide(bool enable) 24 {} 25 SetTimeStopSec(int timeStopSec)26void PerfCollectorEmptyImpl::SetTimeStopSec(int timeStopSec) 27 {} 28 SetFrequency(int frequency)29void PerfCollectorEmptyImpl::SetFrequency(int frequency) 30 {} 31 SetOffCPU(bool offCPU)32void PerfCollectorEmptyImpl::SetOffCPU(bool offCPU) 33 {} 34 SetOutputFilename(const std::string & outputFilename)35void PerfCollectorEmptyImpl::SetOutputFilename(const std::string &outputFilename) 36 {} 37 SetCallGraph(const std::string & sampleTypes)38void PerfCollectorEmptyImpl::SetCallGraph(const std::string &sampleTypes) 39 {} 40 SetSelectEvents(const std::vector<std::string> & selectEvents)41void PerfCollectorEmptyImpl::SetSelectEvents(const std::vector<std::string> &selectEvents) 42 {} 43 SetCpuPercent(int cpuPercent)44void PerfCollectorEmptyImpl::SetCpuPercent(int cpuPercent) 45 {} 46 SetReport(bool enable)47void PerfCollectorEmptyImpl::SetReport(bool enable) 48 {} 49 Create(PerfCaller)50std::shared_ptr<PerfCollector> PerfCollector::Create(PerfCaller /* perfCaller */) 51 { 52 return std::make_shared<PerfCollectorEmptyImpl>(); 53 } 54 StartPerf(const std::string & logDir)55CollectResult<bool> PerfCollectorEmptyImpl::StartPerf(const std::string &logDir) 56 { 57 return CollectResult<bool>(UCollect::UcError::FEATURE_CLOSED); 58 } 59 Prepare(const std::string & logDir)60CollectResult<bool> PerfCollectorEmptyImpl::Prepare(const std::string &logDir) 61 { 62 return CollectResult<bool>(UCollect::UcError::FEATURE_CLOSED); 63 } 64 StartRun()65CollectResult<bool> PerfCollectorEmptyImpl::StartRun() 66 { 67 return CollectResult<bool>(UCollect::UcError::FEATURE_CLOSED); 68 } 69 Pause()70CollectResult<bool> PerfCollectorEmptyImpl::Pause() 71 { 72 return CollectResult<bool>(UCollect::UcError::FEATURE_CLOSED); 73 } 74 Resume()75CollectResult<bool> PerfCollectorEmptyImpl::Resume() 76 { 77 return CollectResult<bool>(UCollect::UcError::FEATURE_CLOSED); 78 } 79 Stop()80CollectResult<bool> PerfCollectorEmptyImpl::Stop() 81 { 82 return CollectResult<bool>(UCollect::UcError::FEATURE_CLOSED); 83 } 84 } // UCollectUtil 85 } // HivewDFX 86 } // OHOS 87