Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
communication_ipc
提交
98b32817
C
communication_ipc
项目概览
OpenHarmony
/
communication_ipc
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
98b32817
编写于
12月 31, 2021
作者:
X
XiYuhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ipc support hitrace
Signed-off-by:
N
XiYuhao
<
xiyuhao@huawei.com
>
上级
d7ef6229
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
20 deletion
+0
-20
ipc/native/src/mock/include/dbinder_base_invoker.h
ipc/native/src/mock/include/dbinder_base_invoker.h
+0
-10
ipc/native/src/mock/source/binder_invoker.cpp
ipc/native/src/mock/source/binder_invoker.cpp
+0
-10
未找到文件。
ipc/native/src/mock/include/dbinder_base_invoker.h
浏览文件 @
98b32817
...
...
@@ -30,9 +30,7 @@
#include "ipc_process_skeleton.h"
#include "ipc_thread_skeleton.h"
#include "ipc_debug.h"
#ifndef CONFIG_STANDARD_SYSTEM
#include "hitrace_invoker.h"
#endif
#include "dbinder_error_code.h"
#include "log_tags.h"
...
...
@@ -678,11 +676,9 @@ int DBinderBaseInvoker<T>::SendRequest(int32_t handle, uint32_t code, MessagePar
int
userWaitTime
=
option
.
GetWaitTime
();
MessageParcel
&
newData
=
const_cast
<
MessageParcel
&>
(
data
);
size_t
oldWritePosition
=
newData
.
GetWritePosition
();
#ifndef CONFIG_STANDARD_SYSTEM
HiTraceId
traceId
=
HiTrace
::
GetId
();
// set client send trace point if trace is enabled
HiTraceId
childId
=
HitraceInvoker
::
TraceClientSend
(
handle
,
code
,
newData
,
flags
,
traceId
);
#endif
std
::
shared_ptr
<
T
>
session
=
WriteTransaction
(
BC_TRANSACTION
,
flags
,
handle
,
0
,
code
,
data
,
seqNumber
,
0
);
if
(
session
==
nullptr
)
{
newData
.
RewindWrite
(
oldWritePosition
);
...
...
@@ -699,9 +695,7 @@ int DBinderBaseInvoker<T>::SendRequest(int32_t handle, uint32_t code, MessagePar
}
else
{
ret
=
SendOrWaitForCompletion
(
userWaitTime
,
seqNumber
,
session
,
&
reply
);
}
#ifndef CONFIG_STANDARD_SYSTEM
HitraceInvoker
::
TraceClientReceieve
(
handle
,
code
,
flags
,
traceId
,
childId
);
#endif
// restore Parcel data
newData
.
RewindWrite
(
oldWritePosition
);
return
ret
;
...
...
@@ -840,10 +834,8 @@ template <class T> void DBinderBaseInvoker<T>::ProcessTransaction(dbinder_transa
data
.
InjectOffsets
(
reinterpret_cast
<
binder_uintptr_t
>
(
reinterpret_cast
<
char
*>
(
tr
->
buffer
)
+
tr
->
offsets
),
tr
->
offsets_size
/
sizeof
(
binder_size_t
));
}
#ifndef CONFIG_STANDARD_SYSTEM
uint32_t
&
newflags
=
const_cast
<
uint32_t
&>
(
tr
->
flags
);
int
isServerTraced
=
HitraceInvoker
::
TraceServerReceieve
(
tr
->
cookie
,
tr
->
code
,
data
,
newflags
);
#endif
const
pid_t
oldPid
=
GetCallerPid
();
const
auto
oldUid
=
static_cast
<
const
uid_t
>
(
GetCallerUid
());
...
...
@@ -884,9 +876,7 @@ template <class T> void DBinderBaseInvoker<T>::ProcessTransaction(dbinder_transa
DBINDER_BASE_LOGE
(
"delete raw data in process skeleton"
);
current
->
DetachRawData
(
listenFd
);
}
#ifndef CONFIG_STANDARD_SYSTEM
HitraceInvoker
::
TraceServerSend
(
tr
->
cookie
,
tr
->
code
,
isServerTraced
,
newflags
);
#endif
if
(
!
(
flags
&
MessageOption
::
TF_ASYNC
))
{
SetClientFd
(
listenFd
);
SetSeqNum
(
senderSeqNumber
);
...
...
ipc/native/src/mock/source/binder_invoker.cpp
浏览文件 @
98b32817
...
...
@@ -22,9 +22,7 @@
#include "ipc_object_proxy.h"
#include "ipc_process_skeleton.h"
#include "ipc_thread_skeleton.h"
#ifndef CONFIG_STANDARD_SYSTEM
#include "hitrace_invoker.h"
#endif
#include "dbinder_error_code.h"
#include "log_tags.h"
...
...
@@ -97,11 +95,9 @@ int BinderInvoker::SendRequest(int handle, uint32_t code, MessageParcel &data, M
ZLOGI
(
LABEL
,
"%{public}s: handle=%d ,flags:%d"
,
__func__
,
handle
,
flags
);
MessageParcel
&
newData
=
const_cast
<
MessageParcel
&>
(
data
);
size_t
oldWritePosition
=
newData
.
GetWritePosition
();
#ifndef CONFIG_STANDARD_SYSTEM
HiTraceId
traceId
=
HiTrace
::
GetId
();
// set client send trace point if trace is enabled
HiTraceId
childId
=
HitraceInvoker
::
TraceClientSend
(
handle
,
code
,
newData
,
flags
,
traceId
);
#endif
if
(
!
WriteTransaction
(
BC_TRANSACTION
,
flags
,
handle
,
code
,
data
,
nullptr
))
{
newData
.
RewindWrite
(
oldWritePosition
);
ZLOGE
(
LABEL
,
"WriteTransaction ERROR"
);
...
...
@@ -117,9 +113,7 @@ int BinderInvoker::SendRequest(int handle, uint32_t code, MessageParcel &data, M
}
else
{
error
=
WaitForCompletion
(
&
reply
);
}
#ifndef CONFIG_STANDARD_SYSTEM
HitraceInvoker
::
TraceClientReceieve
(
handle
,
code
,
flags
,
traceId
,
childId
);
#endif
// restore Parcel data
newData
.
RewindWrite
(
oldWritePosition
);
ZLOGI
(
LABEL
,
"%{public}s: handle=%d result = %{public}d"
,
__func__
,
handle
,
error
);
...
...
@@ -417,10 +411,8 @@ void BinderInvoker::OnTransaction(const uint8_t *buffer)
if
(
tr
->
offsets_size
>
0
)
{
data
->
InjectOffsets
(
tr
->
data
.
ptr
.
offsets
,
tr
->
offsets_size
/
sizeof
(
binder_size_t
));
}
#ifndef CONFIG_STANDARD_SYSTEM
uint32_t
&
newflags
=
const_cast
<
uint32_t
&>
(
tr
->
flags
);
int
isServerTraced
=
HitraceInvoker
::
TraceServerReceieve
(
tr
->
target
.
handle
,
tr
->
code
,
*
data
,
newflags
);
#endif
const
pid_t
oldPid
=
callerPid_
;
const
auto
oldUid
=
static_cast
<
const
uid_t
>
(
callerUid_
);
uint32_t
oldStatus
=
status_
;
...
...
@@ -445,9 +437,7 @@ void BinderInvoker::OnTransaction(const uint8_t *buffer)
option
.
SetFlags
(
static_cast
<
int
>
(
flagValue
));
error
=
targetObject
->
SendRequest
(
tr
->
code
,
*
data
,
reply
,
option
);
}
#ifndef CONFIG_STANDARD_SYSTEM
HitraceInvoker
::
TraceServerSend
(
tr
->
target
.
handle
,
tr
->
code
,
isServerTraced
,
newflags
);
#endif
if
(
!
(
flagValue
&
TF_ONE_WAY
))
{
SendReply
(
reply
,
0
,
error
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录