Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
communication_ipc
提交
b6d9595d
C
communication_ipc
项目概览
OpenHarmony
/
communication_ipc
大约 1 年 前同步成功
通知
20
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
communication_ipc
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b6d9595d
编写于
10月 09, 2022
作者:
X
xuyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename HiTrace to HiTraceChain
Signed-off-by:
N
xuyong
<
xuyong59@huawei.com
>
上级
a50910db
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
48 addition
and
48 deletion
+48
-48
interfaces/innerkits/ipc_core/BUILD.gn
interfaces/innerkits/ipc_core/BUILD.gn
+1
-1
interfaces/innerkits/ipc_single/BUILD.gn
interfaces/innerkits/ipc_single/BUILD.gn
+1
-1
ipc/native/src/mock/include/dbinder_base_invoker.h
ipc/native/src/mock/include/dbinder_base_invoker.h
+1
-1
ipc/native/src/mock/source/binder_invoker.cpp
ipc/native/src/mock/source/binder_invoker.cpp
+1
-1
ipc/native/src/mock/source/hitrace_invoker.cpp
ipc/native/src/mock/source/hitrace_invoker.cpp
+11
-11
ipc/native/test/unittest/common/BUILD.gn
ipc/native/test/unittest/common/BUILD.gn
+1
-1
ipc/native/test/unittest/common/ipc_hitrace_unittest.cpp
ipc/native/test/unittest/common/ipc_hitrace_unittest.cpp
+30
-30
services/dbinder/test/distributedtest/src/dbinder_distributed_test.cpp
...der/test/distributedtest/src/dbinder_distributed_test.cpp
+1
-1
services/dbinder/test/distributedtest/src/dbinder_test_service_skeleton.cpp
...est/distributedtest/src/dbinder_test_service_skeleton.cpp
+1
-1
未找到文件。
interfaces/innerkits/ipc_core/BUILD.gn
浏览文件 @
b6d9595d
...
@@ -74,7 +74,7 @@ ohos_shared_library("ipc_core") {
...
@@ -74,7 +74,7 @@ ohos_shared_library("ipc_core") {
"access_token:libaccesstoken_sdk",
"access_token:libaccesstoken_sdk",
"c_utils:utils",
"c_utils:utils",
"dsoftbus:softbus_client",
"dsoftbus:softbus_client",
"hitrace_native:libhitrace",
"hitrace_native:libhitrace
chain
",
"hiviewdfx_hilog_native:libhilog",
"hiviewdfx_hilog_native:libhilog",
]
]
...
...
interfaces/innerkits/ipc_single/BUILD.gn
浏览文件 @
b6d9595d
...
@@ -59,7 +59,7 @@ ohos_shared_library("ipc_single") {
...
@@ -59,7 +59,7 @@ ohos_shared_library("ipc_single") {
external_deps = [
external_deps = [
"c_utils:utils",
"c_utils:utils",
"hitrace_native:libhitrace",
"hitrace_native:libhitrace
chain
",
"hiviewdfx_hilog_native:libhilog",
"hiviewdfx_hilog_native:libhilog",
]
]
...
...
ipc/native/src/mock/include/dbinder_base_invoker.h
浏览文件 @
b6d9595d
...
@@ -701,7 +701,7 @@ int DBinderBaseInvoker<T>::SendRequest(int32_t handle, uint32_t code, MessagePar
...
@@ -701,7 +701,7 @@ int DBinderBaseInvoker<T>::SendRequest(int32_t handle, uint32_t code, MessagePar
int
userWaitTime
=
option
.
GetWaitTime
();
int
userWaitTime
=
option
.
GetWaitTime
();
MessageParcel
&
newData
=
const_cast
<
MessageParcel
&>
(
data
);
MessageParcel
&
newData
=
const_cast
<
MessageParcel
&>
(
data
);
size_t
oldWritePosition
=
newData
.
GetWritePosition
();
size_t
oldWritePosition
=
newData
.
GetWritePosition
();
HiTraceId
traceId
=
HiTrace
::
GetId
();
HiTraceId
traceId
=
HiTrace
Chain
::
GetId
();
// set client send trace point if trace is enabled
// set client send trace point if trace is enabled
HiTraceId
childId
=
HitraceInvoker
::
TraceClientSend
(
handle
,
code
,
newData
,
flags
,
traceId
);
HiTraceId
childId
=
HitraceInvoker
::
TraceClientSend
(
handle
,
code
,
newData
,
flags
,
traceId
);
std
::
shared_ptr
<
T
>
session
=
WriteTransaction
(
BC_TRANSACTION
,
flags
,
handle
,
0
,
code
,
data
,
seqNumber
,
0
);
std
::
shared_ptr
<
T
>
session
=
WriteTransaction
(
BC_TRANSACTION
,
flags
,
handle
,
0
,
code
,
data
,
seqNumber
,
0
);
...
...
ipc/native/src/mock/source/binder_invoker.cpp
浏览文件 @
b6d9595d
...
@@ -100,7 +100,7 @@ int BinderInvoker::SendRequest(int handle, uint32_t code, MessageParcel &data, M
...
@@ -100,7 +100,7 @@ int BinderInvoker::SendRequest(int handle, uint32_t code, MessageParcel &data, M
ZLOGD
(
LABEL
,
"%{public}s: handle=%d ,flags:%u"
,
__func__
,
handle
,
flags
);
ZLOGD
(
LABEL
,
"%{public}s: handle=%d ,flags:%u"
,
__func__
,
handle
,
flags
);
MessageParcel
&
newData
=
const_cast
<
MessageParcel
&>
(
data
);
MessageParcel
&
newData
=
const_cast
<
MessageParcel
&>
(
data
);
size_t
oldWritePosition
=
newData
.
GetWritePosition
();
size_t
oldWritePosition
=
newData
.
GetWritePosition
();
HiTraceId
traceId
=
HiTrace
::
GetId
();
HiTraceId
traceId
=
HiTrace
Chain
::
GetId
();
// set client send trace point if trace is enabled
// set client send trace point if trace is enabled
HiTraceId
childId
=
HitraceInvoker
::
TraceClientSend
(
handle
,
code
,
newData
,
flags
,
traceId
);
HiTraceId
childId
=
HitraceInvoker
::
TraceClientSend
(
handle
,
code
,
newData
,
flags
,
traceId
);
if
(
!
WriteTransaction
(
BC_TRANSACTION
,
flags
,
handle
,
code
,
data
,
nullptr
))
{
if
(
!
WriteTransaction
(
BC_TRANSACTION
,
flags
,
handle
,
code
,
data
,
nullptr
))
{
...
...
ipc/native/src/mock/source/hitrace_invoker.cpp
浏览文件 @
b6d9595d
...
@@ -20,9 +20,7 @@
...
@@ -20,9 +20,7 @@
#include "hilog/log_c.h"
#include "hilog/log_c.h"
#include "hilog/log_cpp.h"
#include "hilog/log_cpp.h"
#include "hitrace/hitrace.h"
#include "hitrace/trace.h"
#include "hitrace/hitracec.h"
#include "hitrace/hitraceid.h"
#include "ipc_debug.h"
#include "ipc_debug.h"
#include "log_tags.h"
#include "log_tags.h"
#include "parcel.h"
#include "parcel.h"
...
@@ -45,7 +43,7 @@ HiTraceId HitraceInvoker::TraceClientSend(int32_t handle, uint32_t code, Parcel
...
@@ -45,7 +43,7 @@ HiTraceId HitraceInvoker::TraceClientSend(int32_t handle, uint32_t code, Parcel
HiTraceId
childId
=
traceId
;
HiTraceId
childId
=
traceId
;
bool
isClientTraced
=
IsClientTraced
(
handle
,
flags
,
traceId
);
bool
isClientTraced
=
IsClientTraced
(
handle
,
flags
,
traceId
);
if
(
isClientTraced
)
{
if
(
isClientTraced
)
{
childId
=
HiTrace
::
CreateSpan
();
childId
=
HiTrace
Chain
::
CreateSpan
();
// add childid to parcel data
// add childid to parcel data
uint8_t
idBytes
[
HITRACE_ID_LEN
];
uint8_t
idBytes
[
HITRACE_ID_LEN
];
size_t
idLen
=
(
size_t
)(
childId
.
ToBytes
(
idBytes
,
HITRACE_ID_LEN
));
size_t
idLen
=
(
size_t
)(
childId
.
ToBytes
(
idBytes
,
HITRACE_ID_LEN
));
...
@@ -70,7 +68,8 @@ HiTraceId HitraceInvoker::TraceClientSend(int32_t handle, uint32_t code, Parcel
...
@@ -70,7 +68,8 @@ HiTraceId HitraceInvoker::TraceClientSend(int32_t handle, uint32_t code, Parcel
return
childId
;
return
childId
;
}
}
// tracepoint: CS(Client Send)
// tracepoint: CS(Client Send)
HiTrace
::
Tracepoint
(
HITRACE_TP_CS
,
childId
,
"%s handle=%d,code=%u"
,
(
flags
&
TF_ONE_WAY
)
?
"ASYNC"
:
"SYNC"
,
HiTraceChain
::
Tracepoint
(
HITRACE_TP_CS
,
childId
,
"%s handle=%d,code=%u"
,
(
flags
&
TF_ONE_WAY
)
?
"ASYNC"
:
"SYNC"
,
handle
,
code
);
handle
,
code
);
flags
|=
TF_HITRACE
;
flags
|=
TF_HITRACE
;
}
}
...
@@ -87,9 +86,9 @@ void HitraceInvoker::TraceClientReceieve(int32_t handle, uint32_t code, uint32_t
...
@@ -87,9 +86,9 @@ void HitraceInvoker::TraceClientReceieve(int32_t handle, uint32_t code, uint32_t
if
(
isClientTraced
)
{
if
(
isClientTraced
)
{
if
(
!
(
flags
&
TF_ONE_WAY
))
{
if
(
!
(
flags
&
TF_ONE_WAY
))
{
// restore thread trace id
// restore thread trace id
HiTrace
::
SetId
(
traceId
);
HiTrace
Chain
::
SetId
(
traceId
);
// tracepoint: CR(Client Receive)
// tracepoint: CR(Client Receive)
HiTrace
::
Tracepoint
(
HITRACE_TP_CR
,
childId
,
"%s handle=%d,code=%u"
,
"SYNC"
,
handle
,
code
);
HiTrace
Chain
::
Tracepoint
(
HITRACE_TP_CR
,
childId
,
"%s handle=%d,code=%u"
,
"SYNC"
,
handle
,
code
);
}
}
}
}
}
}
...
@@ -123,9 +122,10 @@ bool HitraceInvoker::TraceServerReceieve(int32_t handle, uint32_t code, Parcel &
...
@@ -123,9 +122,10 @@ bool HitraceInvoker::TraceServerReceieve(int32_t handle, uint32_t code, Parcel &
return
isServerTraced
;
return
isServerTraced
;
}
}
HiTraceId
traceId
(
idBytes
,
sizeof
(
HiTraceIdStruct
));
HiTraceId
traceId
(
idBytes
,
sizeof
(
HiTraceIdStruct
));
HiTrace
::
SetId
(
traceId
);
HiTrace
Chain
::
SetId
(
traceId
);
// tracepoint: SR(Server Receive)
// tracepoint: SR(Server Receive)
HiTrace
::
Tracepoint
(
HITRACE_TP_SR
,
traceId
,
"%s handle=%d,code=%u"
,
(
flags
&
TF_ONE_WAY
)
?
"ASYNC"
:
"SYNC"
,
HiTraceChain
::
Tracepoint
(
HITRACE_TP_SR
,
traceId
,
"%s handle=%d,code=%u"
,
(
flags
&
TF_ONE_WAY
)
?
"ASYNC"
:
"SYNC"
,
handle
,
code
);
handle
,
code
);
}
}
...
@@ -138,9 +138,9 @@ void HitraceInvoker::TraceServerSend(int32_t handle, uint32_t code, bool isServe
...
@@ -138,9 +138,9 @@ void HitraceInvoker::TraceServerSend(int32_t handle, uint32_t code, bool isServe
{
{
if
(
isServerTraced
)
{
if
(
isServerTraced
)
{
// tracepoint: SS(Server Send)
// tracepoint: SS(Server Send)
HiTrace
::
Tracepoint
(
HITRACE_TP_SS
,
HiTrace
::
GetId
(),
"%s handle=%d,code=%u"
,
HiTrace
Chain
::
Tracepoint
(
HITRACE_TP_SS
,
HiTraceChain
::
GetId
(),
"%s handle=%d,code=%u"
,
(
flags
&
TF_ONE_WAY
)
?
"ASYNC"
:
"SYNC"
,
handle
,
code
);
(
flags
&
TF_ONE_WAY
)
?
"ASYNC"
:
"SYNC"
,
handle
,
code
);
}
}
HiTrace
::
ClearId
();
HiTrace
Chain
::
ClearId
();
}
}
}
// namespace OHOS
}
// namespace OHOS
ipc/native/test/unittest/common/BUILD.gn
浏览文件 @
b6d9595d
...
@@ -88,7 +88,7 @@ ohos_unittest("IPCHiTraceUnitTest") {
...
@@ -88,7 +88,7 @@ ohos_unittest("IPCHiTraceUnitTest") {
external_deps = [
external_deps = [
"c_utils:utils",
"c_utils:utils",
"hitrace_native:libhitrace",
"hitrace_native:libhitrace
chain
",
"hiviewdfx_hilog_native:libhilog",
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_core",
"ipc:ipc_core",
"samgr:samgr_proxy",
"samgr:samgr_proxy",
...
...
ipc/native/test/unittest/common/ipc_hitrace_unittest.cpp
浏览文件 @
b6d9595d
...
@@ -154,9 +154,9 @@ static std::string PrintTagLog(const std::string &tag)
...
@@ -154,9 +154,9 @@ static std::string PrintTagLog(const std::string &tag)
HWTEST_F
(
BinderTraceTest
,
Sync001
,
TestSize
.
Level1
)
HWTEST_F
(
BinderTraceTest
,
Sync001
,
TestSize
.
Level1
)
{
{
HiTraceId
getId
=
HiTrace
::
GetId
();
HiTraceId
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
HiTraceId
traceId
=
HiTrace
::
Begin
(
"ipc hitrace"
,
0
);
HiTraceId
traceId
=
HiTrace
Chain
::
Begin
(
"ipc hitrace"
,
0
);
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
IPCTestHelper
helper
;
IPCTestHelper
helper
;
...
@@ -185,10 +185,10 @@ HWTEST_F(BinderTraceTest, Sync001, TestSize.Level1)
...
@@ -185,10 +185,10 @@ HWTEST_F(BinderTraceTest, Sync001, TestSize.Level1)
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
}
}
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
1
,
getId
.
IsValid
());
EXPECT_EQ
(
1
,
getId
.
IsValid
());
HiTrace
::
End
(
traceId
);
HiTrace
Chain
::
End
(
traceId
);
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
std
::
string
remainLogMsgs
=
BinderTraceGetRemainLog
(
logTag
);
std
::
string
remainLogMsgs
=
BinderTraceGetRemainLog
(
logTag
);
EXPECT_EQ
(
0
,
BinderTraceCheckLog
(
remainLogMsgs
,
"HITRACE_TP_CS"
,
chainId
));
EXPECT_EQ
(
0
,
BinderTraceCheckLog
(
remainLogMsgs
,
"HITRACE_TP_CS"
,
chainId
));
...
@@ -207,9 +207,9 @@ HWTEST_F(BinderTraceTest, Sync002, TestSize.Level1)
...
@@ -207,9 +207,9 @@ HWTEST_F(BinderTraceTest, Sync002, TestSize.Level1)
"
\\
[[a-f0-9]{1,16}, [a-f0-9]{1,16}, 0
\\
] <HITRACE_TP_SS,chain=[0-9a-f]{1,16},span=[0-9a-f]{1,16},pspan="
;
"
\\
[[a-f0-9]{1,16}, [a-f0-9]{1,16}, 0
\\
] <HITRACE_TP_SS,chain=[0-9a-f]{1,16},span=[0-9a-f]{1,16},pspan="
;
const
std
::
string
HITRACE_TP_CR_LOG
=
const
std
::
string
HITRACE_TP_CR_LOG
=
"
\\
[[a-f0-9]{1,16}, 0, 0
\\
] <HITRACE_TP_CR,chain=[0-9a-f]{1,16},span=[0-9a-f]{1,16},pspan="
;
"
\\
[[a-f0-9]{1,16}, 0, 0
\\
] <HITRACE_TP_CR,chain=[0-9a-f]{1,16},span=[0-9a-f]{1,16},pspan="
;
HiTraceId
getId
=
HiTrace
::
GetId
();
HiTraceId
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
HiTraceId
traceId
=
HiTrace
::
Begin
(
"ipc hitrace"
,
HITRACE_FLAG_TP_INFO
);
HiTraceId
traceId
=
HiTrace
Chain
::
Begin
(
"ipc hitrace"
,
HITRACE_FLAG_TP_INFO
);
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
IPCTestHelper
helper
;
IPCTestHelper
helper
;
...
@@ -238,10 +238,10 @@ HWTEST_F(BinderTraceTest, Sync002, TestSize.Level1)
...
@@ -238,10 +238,10 @@ HWTEST_F(BinderTraceTest, Sync002, TestSize.Level1)
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
}
}
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
1
,
getId
.
IsValid
());
EXPECT_EQ
(
1
,
getId
.
IsValid
());
HiTrace
::
End
(
traceId
);
HiTrace
Chain
::
End
(
traceId
);
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
}
}
...
@@ -251,9 +251,9 @@ HWTEST_F(BinderTraceTest, Sync003, TestSize.Level1)
...
@@ -251,9 +251,9 @@ HWTEST_F(BinderTraceTest, Sync003, TestSize.Level1)
const
std
::
string
HITRACE_TP_SR_LOG
=
"
\\
[[a-f0-9]{1,16}
\\
] <HITRACE_TP_SR,chain=[0-9a-f]{1,16},span=0,pspan="
;
const
std
::
string
HITRACE_TP_SR_LOG
=
"
\\
[[a-f0-9]{1,16}
\\
] <HITRACE_TP_SR,chain=[0-9a-f]{1,16},span=0,pspan="
;
const
std
::
string
HITRACE_TP_SS_LOG
=
"
\\
[[a-f0-9]{1,16}
\\
] <HITRACE_TP_SS,chain=[0-9a-f]{1,16},span=0,pspan="
;
const
std
::
string
HITRACE_TP_SS_LOG
=
"
\\
[[a-f0-9]{1,16}
\\
] <HITRACE_TP_SS,chain=[0-9a-f]{1,16},span=0,pspan="
;
const
std
::
string
HITRACE_TP_CR_LOG
=
"
\\
[[a-f0-9]{1,16}
\\
] <HITRACE_TP_CR,chain=[0-9a-f]{1,16},span=0,pspan="
;
const
std
::
string
HITRACE_TP_CR_LOG
=
"
\\
[[a-f0-9]{1,16}
\\
] <HITRACE_TP_CR,chain=[0-9a-f]{1,16},span=0,pspan="
;
HiTraceId
getId
=
HiTrace
::
GetId
();
HiTraceId
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
HiTraceId
traceId
=
HiTrace
::
Begin
(
"ipc hitrace"
,
HITRACE_FLAG_TP_INFO
|
HITRACE_FLAG_DONOT_CREATE_SPAN
);
HiTraceId
traceId
=
HiTrace
Chain
::
Begin
(
"ipc hitrace"
,
HITRACE_FLAG_TP_INFO
|
HITRACE_FLAG_DONOT_CREATE_SPAN
);
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
IPCTestHelper
helper
;
IPCTestHelper
helper
;
...
@@ -280,18 +280,18 @@ HWTEST_F(BinderTraceTest, Sync003, TestSize.Level1)
...
@@ -280,18 +280,18 @@ HWTEST_F(BinderTraceTest, Sync003, TestSize.Level1)
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
}
}
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
1
,
getId
.
IsValid
());
EXPECT_EQ
(
1
,
getId
.
IsValid
());
HiTrace
::
End
(
traceId
);
HiTrace
Chain
::
End
(
traceId
);
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
}
}
HWTEST_F
(
BinderTraceTest
,
Async001
,
TestSize
.
Level1
)
HWTEST_F
(
BinderTraceTest
,
Async001
,
TestSize
.
Level1
)
{
{
HiTraceId
getId
=
HiTrace
::
GetId
();
HiTraceId
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
HiTraceId
traceId
=
HiTrace
::
Begin
(
"ipc hitrace"
,
HITRACE_FLAG_INCLUDE_ASYNC
);
HiTraceId
traceId
=
HiTrace
Chain
::
Begin
(
"ipc hitrace"
,
HITRACE_FLAG_INCLUDE_ASYNC
);
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
IPCTestHelper
helper
;
IPCTestHelper
helper
;
...
@@ -318,10 +318,10 @@ HWTEST_F(BinderTraceTest, Async001, TestSize.Level1)
...
@@ -318,10 +318,10 @@ HWTEST_F(BinderTraceTest, Async001, TestSize.Level1)
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
}
}
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
1
,
getId
.
IsValid
());
EXPECT_EQ
(
1
,
getId
.
IsValid
());
HiTrace
::
End
(
traceId
);
HiTrace
Chain
::
End
(
traceId
);
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
std
::
string
remainLogMsgs
=
BinderTraceGetRemainLog
(
logTag
);
std
::
string
remainLogMsgs
=
BinderTraceGetRemainLog
(
logTag
);
EXPECT_EQ
(
0
,
BinderTraceCheckLog
(
remainLogMsgs
,
"HITRACE_TP_CS"
,
chainId
));
EXPECT_EQ
(
0
,
BinderTraceCheckLog
(
remainLogMsgs
,
"HITRACE_TP_CS"
,
chainId
));
...
@@ -336,9 +336,9 @@ HWTEST_F(BinderTraceTest, Async002, TestSize.Level1)
...
@@ -336,9 +336,9 @@ HWTEST_F(BinderTraceTest, Async002, TestSize.Level1)
"
\\
[[a-f0-9]{1,16}, 0, 0
\\
] <HITRACE_TP_CS,chain=[0-9a-f]{1,16},span=[0-9a-f]{1,16},pspan="
;
"
\\
[[a-f0-9]{1,16}, 0, 0
\\
] <HITRACE_TP_CS,chain=[0-9a-f]{1,16},span=[0-9a-f]{1,16},pspan="
;
const
std
::
string
HITRACE_TP_SR_LOG
=
const
std
::
string
HITRACE_TP_SR_LOG
=
"
\\
[[a-f0-9]{1,16}, [a-f0-9]{1,16}, 0
\\
] <HITRACE_TP_SR,chain=[0-9a-f]{1,16},span=[0-9a-f]{1,16},pspan="
;
"
\\
[[a-f0-9]{1,16}, [a-f0-9]{1,16}, 0
\\
] <HITRACE_TP_SR,chain=[0-9a-f]{1,16},span=[0-9a-f]{1,16},pspan="
;
HiTraceId
getId
=
HiTrace
::
GetId
();
HiTraceId
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
HiTraceId
traceId
=
HiTrace
::
Begin
(
"ipc hitrace"
,
HITRACE_FLAG_TP_INFO
|
HITRACE_FLAG_INCLUDE_ASYNC
);
HiTraceId
traceId
=
HiTrace
Chain
::
Begin
(
"ipc hitrace"
,
HITRACE_FLAG_TP_INFO
|
HITRACE_FLAG_INCLUDE_ASYNC
);
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
IPCTestHelper
helper
;
IPCTestHelper
helper
;
...
@@ -365,10 +365,10 @@ HWTEST_F(BinderTraceTest, Async002, TestSize.Level1)
...
@@ -365,10 +365,10 @@ HWTEST_F(BinderTraceTest, Async002, TestSize.Level1)
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
}
}
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
1
,
getId
.
IsValid
());
EXPECT_EQ
(
1
,
getId
.
IsValid
());
HiTrace
::
End
(
traceId
);
HiTrace
Chain
::
End
(
traceId
);
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
}
}
...
@@ -376,9 +376,9 @@ HWTEST_F(BinderTraceTest, Async003, TestSize.Level1)
...
@@ -376,9 +376,9 @@ HWTEST_F(BinderTraceTest, Async003, TestSize.Level1)
{
{
const
std
::
string
HITRACE_TP_CS_LOG
=
"
\\
[[a-f0-9]{1,16}
\\
] <HITRACE_TP_CS,chain=[0-9a-f]{1,16},span=0,pspan="
;
const
std
::
string
HITRACE_TP_CS_LOG
=
"
\\
[[a-f0-9]{1,16}
\\
] <HITRACE_TP_CS,chain=[0-9a-f]{1,16},span=0,pspan="
;
const
std
::
string
HITRACE_TP_SR_LOG
=
"
\\
[[a-f0-9]{1,16}
\\
] <HITRACE_TP_SR,chain=[0-9a-f]{1,16},span=0,pspan="
;
const
std
::
string
HITRACE_TP_SR_LOG
=
"
\\
[[a-f0-9]{1,16}
\\
] <HITRACE_TP_SR,chain=[0-9a-f]{1,16},span=0,pspan="
;
HiTraceId
getId
=
HiTrace
::
GetId
();
HiTraceId
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
HiTraceId
traceId
=
HiTrace
::
Begin
(
"ipc hitrace"
,
HiTraceId
traceId
=
HiTrace
Chain
::
Begin
(
"ipc hitrace"
,
HITRACE_FLAG_TP_INFO
|
HITRACE_FLAG_INCLUDE_ASYNC
|
HITRACE_FLAG_DONOT_CREATE_SPAN
);
HITRACE_FLAG_TP_INFO
|
HITRACE_FLAG_INCLUDE_ASYNC
|
HITRACE_FLAG_DONOT_CREATE_SPAN
);
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
std
::
string
chainId
=
HitraceLongToString
(
traceId
.
GetChainId
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
EXPECT_NE
(
0UL
,
chainId
.
size
());
...
@@ -406,9 +406,9 @@ HWTEST_F(BinderTraceTest, Async003, TestSize.Level1)
...
@@ -406,9 +406,9 @@ HWTEST_F(BinderTraceTest, Async003, TestSize.Level1)
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
HiLog
::
Info
(
LOG_LABEL
,
"Got Stub node
\n
"
);
}
}
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
1
,
getId
.
IsValid
());
EXPECT_EQ
(
1
,
getId
.
IsValid
());
HiTrace
::
End
(
traceId
);
HiTrace
Chain
::
End
(
traceId
);
getId
=
HiTrace
::
GetId
();
getId
=
HiTrace
Chain
::
GetId
();
EXPECT_EQ
(
0
,
getId
.
IsValid
());
EXPECT_EQ
(
0
,
getId
.
IsValid
());
}
}
services/dbinder/test/distributedtest/src/dbinder_distributed_test.cpp
浏览文件 @
b6d9595d
...
@@ -1079,7 +1079,7 @@ HWTEST_F(DbinderTest, DbinderRemoteCall024, TestSize.Level3)
...
@@ -1079,7 +1079,7 @@ HWTEST_F(DbinderTest, DbinderRemoteCall024, TestSize.Level3)
{
{
DBINDER_LOGI
(
LOG_LABEL
,
""
);
DBINDER_LOGI
(
LOG_LABEL
,
""
);
SetCurrentTestCase
(
DBINDER_TEST_TRACE_001
);
SetCurrentTestCase
(
DBINDER_TEST_TRACE_001
);
HiTraceId
traceId
=
HiTrace
::
Begin
(
"rpc hitrace"
,
0
);
HiTraceId
traceId
=
HiTrace
Chain
::
Begin
(
"rpc hitrace"
,
0
);
/*
/*
* @tc.steps: step1.Get a proxy (called testService) from remote server.
* @tc.steps: step1.Get a proxy (called testService) from remote server.
...
...
services/dbinder/test/distributedtest/src/dbinder_test_service_skeleton.cpp
浏览文件 @
b6d9595d
...
@@ -494,7 +494,7 @@ int DBinderTestServiceStub::OnReverseInt(MessageParcel &data, MessageParcel &rep
...
@@ -494,7 +494,7 @@ int DBinderTestServiceStub::OnReverseInt(MessageParcel &data, MessageParcel &rep
int
DBinderTestServiceStub
::
OnGetChildId
(
MessageParcel
&
data
,
MessageParcel
&
reply
)
int
DBinderTestServiceStub
::
OnGetChildId
(
MessageParcel
&
data
,
MessageParcel
&
reply
)
{
{
uint64_t
reqData
=
HiTrace
::
GetId
().
GetChainId
();
uint64_t
reqData
=
HiTrace
Chain
::
GetId
().
GetChainId
();
if
(
!
reply
.
WriteUint64
(
reqData
))
{
if
(
!
reply
.
WriteUint64
(
reqData
))
{
DBINDER_LOGE
(
LOG_LABEL
,
"fail to write parcel"
);
DBINDER_LOGE
(
LOG_LABEL
,
"fail to write parcel"
);
return
ERR_INVALID_STATE
;
return
ERR_INVALID_STATE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录