Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
429eb051
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
429eb051
编写于
10月 08, 2013
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'perf/urgent' into tools/perf/build
上级
b7af41a1
1651d120
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
77 addition
and
23 deletion
+77
-23
tools/perf/Makefile
tools/perf/Makefile
+1
-0
tools/perf/builtin-stat.c
tools/perf/builtin-stat.c
+1
-0
tools/perf/config/feature-tests.mak
tools/perf/config/feature-tests.mak
+1
-1
tools/perf/util/dwarf-aux.c
tools/perf/util/dwarf-aux.c
+21
-4
tools/perf/util/dwarf-aux.h
tools/perf/util/dwarf-aux.h
+5
-1
tools/perf/util/header.c
tools/perf/util/header.c
+12
-0
tools/perf/util/probe-finder.c
tools/perf/util/probe-finder.c
+33
-16
tools/perf/util/session.c
tools/perf/util/session.c
+3
-1
未找到文件。
tools/perf/Makefile
浏览文件 @
429eb051
...
...
@@ -770,6 +770,7 @@ check: $(OUTPUT)common-cmds.h
install-bin
:
all
$(INSTALL)
-d
-m
755
'
$(DESTDIR_SQ)$(bindir_SQ)
'
$(INSTALL)
$(OUTPUT)
perf
'
$(DESTDIR_SQ)$(bindir_SQ)
'
$(INSTALL)
-d
-m
755
'
$(DESTDIR_SQ)$(perfexec_instdir_SQ)
'
$(INSTALL)
$(OUTPUT)
perf-archive
-t
'
$(DESTDIR_SQ)$(perfexec_instdir_SQ)
'
ifndef
NO_LIBPERL
$(INSTALL)
-d
-m
755
'
$(DESTDIR_SQ)$(perfexec_instdir_SQ)
/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
...
...
tools/perf/builtin-stat.c
浏览文件 @
429eb051
...
...
@@ -534,6 +534,7 @@ static int __run_perf_stat(int argc, const char **argv)
perror
(
"failed to prepare workload"
);
return
-
1
;
}
child_pid
=
evsel_list
->
workload
.
pid
;
}
if
(
group
)
...
...
tools/perf/config/feature-tests.mak
浏览文件 @
429eb051
...
...
@@ -219,7 +219,7 @@ define SOURCE_LIBAUDIT
int
main(void)
{
printf(\"error message
:
%s
\
n\
"
,
audit_errno_to_name(0));
printf(\"error message
:
%s
\"
,
audit_errno_to_name(0));
return
audit_open
()
;
}
endef
...
...
tools/perf/util/dwarf-aux.c
浏览文件 @
429eb051
...
...
@@ -426,7 +426,7 @@ static int __die_search_func_cb(Dwarf_Die *fn_die, void *data)
* @die_mem: a buffer for result DIE
*
* Search a non-inlined function DIE which includes @addr. Stores the
* DIE to @die_mem and returns it if found. Returns NUL
l
if failed.
* DIE to @die_mem and returns it if found. Returns NUL
L
if failed.
*/
Dwarf_Die
*
die_find_realfunc
(
Dwarf_Die
*
cu_die
,
Dwarf_Addr
addr
,
Dwarf_Die
*
die_mem
)
...
...
@@ -453,16 +453,33 @@ static int __die_find_inline_cb(Dwarf_Die *die_mem, void *data)
return
DIE_FIND_CB_CONTINUE
;
}
/**
* die_find_top_inlinefunc - Search the top inlined function at given address
* @sp_die: a subprogram DIE which including @addr
* @addr: target address
* @die_mem: a buffer for result DIE
*
* Search an inlined function DIE which includes @addr. Stores the
* DIE to @die_mem and returns it if found. Returns NULL if failed.
* Even if several inlined functions are expanded recursively, this
* doesn't trace it down, and returns the topmost one.
*/
Dwarf_Die
*
die_find_top_inlinefunc
(
Dwarf_Die
*
sp_die
,
Dwarf_Addr
addr
,
Dwarf_Die
*
die_mem
)
{
return
die_find_child
(
sp_die
,
__die_find_inline_cb
,
&
addr
,
die_mem
);
}
/**
* die_find_inlinefunc - Search an inlined function at given address
* @
cu_die: a CU
DIE which including @addr
* @
sp_die: a subprogram
DIE which including @addr
* @addr: target address
* @die_mem: a buffer for result DIE
*
* Search an inlined function DIE which includes @addr. Stores the
* DIE to @die_mem and returns it if found. Returns NUL
l
if failed.
* DIE to @die_mem and returns it if found. Returns NUL
L
if failed.
* If several inlined functions are expanded recursively, this trace
* it and returns deepest one.
* it
down
and returns deepest one.
*/
Dwarf_Die
*
die_find_inlinefunc
(
Dwarf_Die
*
sp_die
,
Dwarf_Addr
addr
,
Dwarf_Die
*
die_mem
)
...
...
tools/perf/util/dwarf-aux.h
浏览文件 @
429eb051
...
...
@@ -79,7 +79,11 @@ extern Dwarf_Die *die_find_child(Dwarf_Die *rt_die,
extern
Dwarf_Die
*
die_find_realfunc
(
Dwarf_Die
*
cu_die
,
Dwarf_Addr
addr
,
Dwarf_Die
*
die_mem
);
/* Search an inlined function including given address */
/* Search the top inlined function including given address */
extern
Dwarf_Die
*
die_find_top_inlinefunc
(
Dwarf_Die
*
sp_die
,
Dwarf_Addr
addr
,
Dwarf_Die
*
die_mem
);
/* Search the deepest inlined function including given address */
extern
Dwarf_Die
*
die_find_inlinefunc
(
Dwarf_Die
*
sp_die
,
Dwarf_Addr
addr
,
Dwarf_Die
*
die_mem
);
...
...
tools/perf/util/header.c
浏览文件 @
429eb051
...
...
@@ -2768,6 +2768,18 @@ int perf_session__read_header(struct perf_session *session)
if
(
perf_file_header__read
(
&
f_header
,
header
,
fd
)
<
0
)
return
-
EINVAL
;
/*
* Sanity check that perf.data was written cleanly; data size is
* initialized to 0 and updated only if the on_exit function is run.
* If data size is still 0 then the file contains only partial
* information. Just warn user and process it as much as it can.
*/
if
(
f_header
.
data
.
size
==
0
)
{
pr_warning
(
"WARNING: The %s file's data size field is 0 which is unexpected.
\n
"
"Was the 'perf record' command properly terminated?
\n
"
,
session
->
filename
);
}
nr_attrs
=
f_header
.
attrs
.
size
/
f_header
.
attr_size
;
lseek
(
fd
,
f_header
.
attrs
.
offset
,
SEEK_SET
);
...
...
tools/perf/util/probe-finder.c
浏览文件 @
429eb051
...
...
@@ -1327,8 +1327,8 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr,
struct
perf_probe_point
*
ppt
)
{
Dwarf_Die
cudie
,
spdie
,
indie
;
Dwarf_Addr
_addr
,
baseaddr
;
const
char
*
fname
=
NULL
,
*
func
=
NULL
,
*
tmp
;
Dwarf_Addr
_addr
=
0
,
baseaddr
=
0
;
const
char
*
fname
=
NULL
,
*
func
=
NULL
,
*
basefunc
=
NULL
,
*
tmp
;
int
baseline
=
0
,
lineno
=
0
,
ret
=
0
;
/* Adjust address with bias */
...
...
@@ -1349,27 +1349,36 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr,
/* Find a corresponding function (name, baseline and baseaddr) */
if
(
die_find_realfunc
(
&
cudie
,
(
Dwarf_Addr
)
addr
,
&
spdie
))
{
/* Get function entry information */
tmp
=
dwarf_diename
(
&
spdie
);
if
(
!
tmp
||
func
=
basefunc
=
dwarf_diename
(
&
spdie
);
if
(
!
func
||
dwarf_entrypc
(
&
spdie
,
&
baseaddr
)
!=
0
||
dwarf_decl_line
(
&
spdie
,
&
baseline
)
!=
0
)
dwarf_decl_line
(
&
spdie
,
&
baseline
)
!=
0
)
{
lineno
=
0
;
goto
post
;
func
=
tmp
;
}
if
(
addr
==
(
unsigned
long
)
baseaddr
)
if
(
addr
==
(
unsigned
long
)
baseaddr
)
{
/* Function entry - Relative line number is 0 */
lineno
=
baseline
;
else
if
(
die_find_inlinefunc
(
&
spdie
,
(
Dwarf_Addr
)
addr
,
&
indie
))
{
fname
=
dwarf_decl_file
(
&
spdie
);
goto
post
;
}
/* Track down the inline functions step by step */
while
(
die_find_top_inlinefunc
(
&
spdie
,
(
Dwarf_Addr
)
addr
,
&
indie
))
{
/* There is an inline function */
if
(
dwarf_entrypc
(
&
indie
,
&
_addr
)
==
0
&&
_addr
==
addr
)
_addr
==
addr
)
{
/*
* addr is at an inline function entry.
* In this case, lineno should be the call-site
* line number.
* line number.
(overwrite lineinfo)
*/
lineno
=
die_get_call_lineno
(
&
indie
);
else
{
fname
=
die_get_call_file
(
&
indie
);
break
;
}
else
{
/*
* addr is in an inline function body.
* Since lineno points one of the lines
...
...
@@ -1377,19 +1386,27 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr,
* be the entry line of the inline function.
*/
tmp
=
dwarf_diename
(
&
indie
);
if
(
tmp
&&
dwarf_decl_line
(
&
spdie
,
&
baseline
)
==
0
)
func
=
tmp
;
if
(
!
tmp
||
dwarf_decl_line
(
&
indie
,
&
baseline
)
!=
0
)
break
;
func
=
tmp
;
spdie
=
indie
;
}
}
/* Verify the lineno and baseline are in a same file */
tmp
=
dwarf_decl_file
(
&
spdie
);
if
(
!
tmp
||
strcmp
(
tmp
,
fname
)
!=
0
)
lineno
=
0
;
}
post:
/* Make a relative line number or an offset */
if
(
lineno
)
ppt
->
line
=
lineno
-
baseline
;
else
if
(
func
)
else
if
(
basefunc
)
{
ppt
->
offset
=
addr
-
(
unsigned
long
)
baseaddr
;
func
=
basefunc
;
}
/* Duplicate strings */
if
(
func
)
{
...
...
tools/perf/util/session.c
浏览文件 @
429eb051
...
...
@@ -256,6 +256,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
tool
->
sample
=
process_event_sample_stub
;
if
(
tool
->
mmap
==
NULL
)
tool
->
mmap
=
process_event_stub
;
if
(
tool
->
mmap2
==
NULL
)
tool
->
mmap2
=
process_event_stub
;
if
(
tool
->
comm
==
NULL
)
tool
->
comm
=
process_event_stub
;
if
(
tool
->
fork
==
NULL
)
...
...
@@ -1313,7 +1315,7 @@ int __perf_session__process_events(struct perf_session *session,
file_offset
=
page_offset
;
head
=
data_offset
-
page_offset
;
if
(
data_
offset
+
data_size
<
file_size
)
if
(
data_
size
&&
(
data_offset
+
data_size
<
file_size
)
)
file_size
=
data_offset
+
data_size
;
progress_next
=
file_size
/
16
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录