Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
feba1318
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
feba1318
编写于
6月 09, 2020
作者:
W
wangchaochaohu
提交者:
GitHub
6月 09, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the sgement fault error of profiler in seqseq model test=develop (#24952)
上级
0cb03182
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
7 deletion
+5
-7
paddle/fluid/platform/device_tracer.cc
paddle/fluid/platform/device_tracer.cc
+4
-6
paddle/fluid/platform/profiler.cc
paddle/fluid/platform/profiler.cc
+1
-1
未找到文件。
paddle/fluid/platform/device_tracer.cc
浏览文件 @
feba1318
...
@@ -646,7 +646,6 @@ DeviceTracer *GetDeviceTracer() {
...
@@ -646,7 +646,6 @@ DeviceTracer *GetDeviceTracer() {
// so when event is not in same thread of PE event, we need add
// so when event is not in same thread of PE event, we need add
// father event(PE::run event) for this event
// father event(PE::run event) for this event
void
SetCurAnnotation
(
Event
*
event
)
{
void
SetCurAnnotation
(
Event
*
event
)
{
std
::
string
ret
;
if
(
!
annotation_stack
.
empty
())
{
if
(
!
annotation_stack
.
empty
())
{
event
->
set_parent
(
annotation_stack
.
back
());
event
->
set_parent
(
annotation_stack
.
back
());
event
->
set_name
(
annotation_stack
.
back
()
->
name
()
+
"/"
+
event
->
name
());
event
->
set_name
(
annotation_stack
.
back
()
->
name
()
+
"/"
+
event
->
name
());
...
@@ -670,17 +669,16 @@ void SetCurAnnotation(Event *event) {
...
@@ -670,17 +669,16 @@ void SetCurAnnotation(Event *event) {
}
}
void
ClearCurAnnotation
()
{
void
ClearCurAnnotation
()
{
if
(
!
main_thread_annotation_stack
.
empty
()
&&
if
(
!
main_thread_annotation_stack
.
empty
())
{
main_thread_annotation_stack
.
back
()
->
name
()
==
annotation_stack
.
back
()
->
name
())
{
std
::
string
name
=
annotation_stack
.
back
()
->
name
();
std
::
string
name
=
annotation_stack
.
back
()
->
name
();
std
::
string
main_name
=
main_thread_annotation_stack
.
back
()
->
name
();
std
::
string
main_name
=
main_thread_annotation_stack
.
back
()
->
name
();
int
main_name_len
=
main_name
.
length
();
int
main_name_len
=
main_name
.
length
();
int
name_len
=
name
.
length
();
int
name_len
=
name
.
length
();
int
prefix_len
=
main_name_len
-
name_len
;
int
prefix_len
=
main_name_len
-
name_len
;
if
(
prefix_len
>=
0
&&
main_name
.
at
(
prefix_len
)
==
'/'
&&
if
((
prefix_len
>
0
&&
main_name
.
at
(
prefix_len
-
1
)
==
'/'
&&
name
==
main_name
.
substr
(
prefix_len
,
name_len
))
{
name
==
main_name
.
substr
(
prefix_len
,
name_len
))
||
(
name
==
main_name
))
{
main_thread_annotation_stack_name
.
pop_back
();
main_thread_annotation_stack_name
.
pop_back
();
main_thread_annotation_stack
.
pop_back
();
main_thread_annotation_stack
.
pop_back
();
}
}
...
...
paddle/fluid/platform/profiler.cc
浏览文件 @
feba1318
...
@@ -71,8 +71,8 @@ RecordEvent::RecordEvent(const std::string &name, const EventRole role) {
...
@@ -71,8 +71,8 @@ RecordEvent::RecordEvent(const std::string &name, const EventRole role) {
role_
=
role
;
role_
=
role
;
is_enabled_
=
true
;
is_enabled_
=
true
;
// lock is not needed, the code below is thread-safe
// lock is not needed, the code below is thread-safe
Event
*
e
=
PushEvent
(
name
,
role
);
// Maybe need the same push/pop behavior.
// Maybe need the same push/pop behavior.
Event
*
e
=
PushEvent
(
name
,
role
);
SetCurAnnotation
(
e
);
SetCurAnnotation
(
e
);
name_
=
e
->
name
();
name_
=
e
->
name
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录