• 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 
16 #include "hitracechain_c_wrapper.h"
17 
18 #include "hitracechain_inner.h"
19 
HiTraceChainTracepointExWrapper(int mode,int type,const HiTraceIdStruct * pId,const char * fmt,...)20 void HiTraceChainTracepointExWrapper(int mode, int type, const HiTraceIdStruct* pId, const char* fmt, ...)
21 {
22     va_list args;
23     va_start(args, fmt);
24     HiTraceChainTracepointInner(mode, type, pId, fmt, args);
25     va_end(args);
26     return;
27 }
28 
HiTraceChainIsFlagEnabledWrapper(const HiTraceIdStruct * pId,int flag)29 int HiTraceChainIsFlagEnabledWrapper(const HiTraceIdStruct* pId, int flag)
30 {
31     return HiTraceChainIsFlagEnabled(pId, flag);
32 }
33 
HiTraceChainEnableFlagWrapper(HiTraceIdStruct * pId,int flag)34 void HiTraceChainEnableFlagWrapper(HiTraceIdStruct* pId, int flag)
35 {
36     HiTraceChainEnableFlag(pId, flag);
37 }
38 
HiTraceChainIsValidWrapper(const HiTraceIdStruct * pId)39 int HiTraceChainIsValidWrapper(const HiTraceIdStruct* pId)
40 {
41     return HiTraceChainIsValid(pId);
42 }
43 
HiTraceChainSetFlagsWrapper(HiTraceIdStruct * pId,int flags)44 void HiTraceChainSetFlagsWrapper(HiTraceIdStruct* pId, int flags)
45 {
46     HiTraceChainSetFlags(pId, flags);
47 }
48 
HiTraceChainGetFlagsWrapper(const HiTraceIdStruct * pId)49 int HiTraceChainGetFlagsWrapper(const HiTraceIdStruct* pId)
50 {
51     return HiTraceChainGetFlags(pId);
52 }
53 
HiTraceChainSetChainIdWrapper(HiTraceIdStruct * pId,uint64_t chainId)54 void HiTraceChainSetChainIdWrapper(HiTraceIdStruct* pId, uint64_t chainId)
55 {
56     HiTraceChainSetChainId(pId, chainId);
57 }
58 
HiTraceChainGetChainIdWrapper(const HiTraceIdStruct * pId)59 uint64_t HiTraceChainGetChainIdWrapper(const HiTraceIdStruct* pId)
60 {
61     return HiTraceChainGetChainId(pId);
62 }
63 
HiTraceChainSetSpanIdWrapper(HiTraceIdStruct * pId,uint64_t spanId)64 void HiTraceChainSetSpanIdWrapper(HiTraceIdStruct* pId, uint64_t spanId)
65 {
66     HiTraceChainSetSpanId(pId, spanId);
67 }
68 
HiTraceChainGetSpanIdWrapper(const HiTraceIdStruct * pId)69 uint64_t HiTraceChainGetSpanIdWrapper(const HiTraceIdStruct* pId)
70 {
71     return HiTraceChainGetSpanId(pId);
72 }
73 
HiTraceChainSetParentSpanIdWrapper(HiTraceIdStruct * pId,uint64_t parentSpanId)74 void HiTraceChainSetParentSpanIdWrapper(HiTraceIdStruct* pId, uint64_t parentSpanId)
75 {
76     HiTraceChainSetParentSpanId(pId, parentSpanId);
77 }
78 
HiTraceChainGetParentSpanIdWrapper(const HiTraceIdStruct * pId)79 uint64_t HiTraceChainGetParentSpanIdWrapper(const HiTraceIdStruct* pId)
80 {
81     return HiTraceChainGetParentSpanId(pId);
82 }
83 
HiTraceChainIdToBytesWrapper(const HiTraceIdStruct * pId,uint8_t * pIdArray,int len)84 int HiTraceChainIdToBytesWrapper(const HiTraceIdStruct* pId, uint8_t* pIdArray, int len)
85 {
86     return HiTraceChainIdToBytes(pId, pIdArray, len);
87 }
88 
HiTraceChainBytesToIdWrapper(const uint8_t * pIdArray,int len)89 HiTraceIdStruct HiTraceChainBytesToIdWrapper(const uint8_t* pIdArray, int len)
90 {
91     return HiTraceChainBytesToId(pIdArray, len);
92 }