1 /*
2  * Copyright (c) 2021 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 #ifndef HKS_HITRACE_DEFINE_H
17 #define HKS_HITRACE_DEFINE_H
18 
19 #include <stdint.h>
20 
21 #ifdef HKS_CONFIG_FILE
22 #include HKS_CONFIG_FILE
23 #else
24 #include "hks_config.h"
25 #endif
26 
27 #ifdef L2_STANDARD
28 #include "hitrace/trace.h"
29 #endif
30 
31 #define HKS_HITRACE_FLAG_DEFAULT 0
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 struct HksHitraceId {
38 #ifdef L2_STANDARD
39     HiTraceIdStruct traceId;
40 #else
41     uint8_t id;
42 #endif
43 };
44 
45 struct HksHitraceId HksHitraceBegin(const char *name, int flag);
46 
47 void HksHitraceEnd(const struct HksHitraceId *hitraceId);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif  // HKS_RW_LOCK_H
54