• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 "hitrace_adapter.h"
16 #ifdef HAS_HITRACE_PART
17 #include "hitrace_meter.h"
18 #endif // HAS_HITRACE_PART
19 
20 namespace OHOS {
21 namespace AccountSA {
StartTraceAdapter(const std::string & value)22 void StartTraceAdapter(const std::string &value)
23 {
24 #ifdef HAS_HITRACE_PART
25     StartTrace(HITRACE_TAG_ACCOUNT_MANAGER, value.c_str());
26 #endif // HAS_HITRACE_PART
27 }
28 
FinishTraceAdapter()29 void FinishTraceAdapter()
30 {
31 #ifdef HAS_HITRACE_PART
32     FinishTrace(HITRACE_TAG_ACCOUNT_MANAGER);
33 #endif // HAS_HITRACE_PART
34 }
35 
CountTraceAdapter(const std::string & name,int64_t count)36 void CountTraceAdapter(const std::string &name, int64_t count)
37 {
38 #ifdef HAS_HITRACE_PART
39     CountTrace(HITRACE_TAG_ACCOUNT_MANAGER, name.c_str(), count);
40 #endif // HAS_HITRACE_PART
41 }
42 
UpdateTraceLabelAdapter()43 void UpdateTraceLabelAdapter()
44 {
45 #ifdef HAS_HITRACE_PART
46     UpdateTraceLabel();
47 #endif // HAS_HITRACE_PART
48 }
49 } // AccountSA
50 } // OHOS