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 "trace_collector_empty_impl.h"
17
18 namespace OHOS {
19 namespace HiviewDFX {
20 namespace UCollectUtil {
Create()21 std::shared_ptr<TraceCollector> TraceCollector::Create()
22 {
23 return std::make_shared<TraceCollectorEmptyImpl>();
24 }
25
DumpTraceWithDuration(UCollect::TraceCaller caller,uint32_t timeLimit,uint64_t happenTime)26 CollectResult<std::vector<std::string>> TraceCollectorEmptyImpl::DumpTraceWithDuration(
27 UCollect::TraceCaller caller, uint32_t timeLimit, uint64_t happenTime)
28 {
29 return {UCollect::UcError::FEATURE_CLOSED};
30 }
31
DumpTrace(UCollect::TraceCaller caller)32 CollectResult<std::vector<std::string>> TraceCollectorEmptyImpl::DumpTrace(UCollect::TraceCaller caller)
33 {
34 return {UCollect::UcError::FEATURE_CLOSED};
35 }
36
DumpTraceWithFilter(UCollect::TeleModule module,uint32_t timeLimit,uint64_t happenTime)37 CollectResult<std::vector<std::string>> TraceCollectorEmptyImpl::DumpTraceWithFilter(UCollect::TeleModule module,
38 uint32_t timeLimit, uint64_t happenTime)
39 {
40 return {UCollect::UcError::FEATURE_CLOSED};
41 }
42
FilterTraceOn(UCollect::TeleModule module,uint64_t postTime)43 CollectResult<int32_t> TraceCollectorEmptyImpl::FilterTraceOn(UCollect::TeleModule module, uint64_t postTime)
44 {
45 return {UCollect::UcError::FEATURE_CLOSED};
46 }
47
FilterTraceOff(UCollect::TeleModule module)48 CollectResult<int32_t> TraceCollectorEmptyImpl::FilterTraceOff(UCollect::TeleModule module)
49 {
50 return {UCollect::UcError::FEATURE_CLOSED};
51 }
52
RecoverTmpTrace()53 bool TraceCollectorEmptyImpl::RecoverTmpTrace()
54 {
55 return false;
56 }
57 } // UCollectUtil
58 } // HiViewDFX
59 } // OHOS
60