Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
d9e24427
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
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看板
提交
d9e24427
编写于
12月 20, 2011
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'perf/core' of
git://github.com/acmel/linux
into perf/core
上级
d87f69a1
65c1e045
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
160 addition
and
24 deletion
+160
-24
tools/perf/Documentation/perf-report.txt
tools/perf/Documentation/perf-report.txt
+3
-2
tools/perf/builtin-record.c
tools/perf/builtin-record.c
+1
-0
tools/perf/builtin-report.c
tools/perf/builtin-report.c
+3
-3
tools/perf/builtin-test.c
tools/perf/builtin-test.c
+126
-1
tools/perf/perf.h
tools/perf/perf.h
+1
-0
tools/perf/util/config.c
tools/perf/util/config.c
+4
-1
tools/perf/util/event.c
tools/perf/util/event.c
+7
-6
tools/perf/util/evlist.c
tools/perf/util/evlist.c
+3
-1
tools/perf/util/evsel.c
tools/perf/util/evsel.c
+4
-1
tools/perf/util/symbol.c
tools/perf/util/symbol.c
+3
-8
tools/perf/util/usage.c
tools/perf/util/usage.c
+4
-1
tools/perf/util/values.c
tools/perf/util/values.c
+1
-0
未找到文件。
tools/perf/Documentation/perf-report.txt
浏览文件 @
d9e24427
...
...
@@ -80,9 +80,10 @@ OPTIONS
--dump-raw-trace::
Dump raw trace in ASCII.
-g [type,min,order]::
-g [type,min
[,limit]
,order]::
--call-graph::
Display call chains using type, min percent threshold and order.
Display call chains using type, min percent threshold, optional print
limit and order.
type can be either:
- flat: single column, linear exposure of call chains.
- graph: use a graph tree, displaying absolute overhead rates.
...
...
tools/perf/builtin-record.c
浏览文件 @
d9e24427
...
...
@@ -700,6 +700,7 @@ const struct option record_options[] = {
OPT_BOOLEAN
(
'd'
,
"data"
,
&
record
.
opts
.
sample_address
,
"Sample addresses"
),
OPT_BOOLEAN
(
'T'
,
"timestamp"
,
&
record
.
opts
.
sample_time
,
"Sample timestamps"
),
OPT_BOOLEAN
(
'P'
,
"period"
,
&
record
.
opts
.
period
,
"Sample period"
),
OPT_BOOLEAN
(
'n'
,
"no-samples"
,
&
record
.
opts
.
no_samples
,
"don't sample"
),
OPT_BOOLEAN
(
'N'
,
"no-buildid-cache"
,
&
record
.
no_buildid_cache
,
...
...
tools/perf/builtin-report.c
浏览文件 @
d9e24427
...
...
@@ -407,7 +407,7 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset)
goto
setup
;
if
(
tok2
[
0
]
!=
'c'
)
{
callchain_param
.
print_limit
=
strto
d
(
tok2
,
&
endptr
);
callchain_param
.
print_limit
=
strto
ul
(
tok2
,
&
endptr
,
0
);
tok2
=
strtok
(
NULL
,
","
);
if
(
!
tok2
)
goto
setup
;
...
...
@@ -485,8 +485,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
"regex filter to identify parent, see: '--sort parent'"
),
OPT_BOOLEAN
(
'x'
,
"exclude-other"
,
&
symbol_conf
.
exclude_other
,
"Only display entries with parent-match"
),
OPT_CALLBACK_DEFAULT
(
'g'
,
"call-graph"
,
&
report
,
"output_type,min_percent
,
call_order"
,
"Display callchains using output_type (graph, flat, fractal, or none) , min percent threshold and callchain order. "
OPT_CALLBACK_DEFAULT
(
'g'
,
"call-graph"
,
&
report
,
"output_type,min_percent
[,print_limit],
call_order"
,
"Display callchains using output_type (graph, flat, fractal, or none) , min percent threshold
, optional print limit
and callchain order. "
"Default: fractal,0.5,callee"
,
&
parse_callchain_opt
,
callchain_default_opt
),
OPT_BOOLEAN
(
'G'
,
"inverted"
,
&
report
.
inverted_callchain
,
"alias for inverted call graph"
),
...
...
tools/perf/builtin-test.c
浏览文件 @
d9e24427
...
...
@@ -603,7 +603,7 @@ static int test__basic_mmap(void)
#define TEST_ASSERT_VAL(text, cond) \
do { \
if (!
cond
) { \
if (!
(cond)
) { \
pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \
return -1; \
} \
...
...
@@ -759,6 +759,103 @@ static int test__checkevent_breakpoint_w(struct perf_evlist *evlist)
return
0
;
}
static
int
test__checkevent_tracepoint_modifier
(
struct
perf_evlist
*
evlist
)
{
struct
perf_evsel
*
evsel
=
list_entry
(
evlist
->
entries
.
next
,
struct
perf_evsel
,
node
);
TEST_ASSERT_VAL
(
"wrong exclude_user"
,
evsel
->
attr
.
exclude_user
);
TEST_ASSERT_VAL
(
"wrong exclude_kernel"
,
!
evsel
->
attr
.
exclude_kernel
);
TEST_ASSERT_VAL
(
"wrong exclude_hv"
,
evsel
->
attr
.
exclude_hv
);
TEST_ASSERT_VAL
(
"wrong precise_ip"
,
!
evsel
->
attr
.
precise_ip
);
return
test__checkevent_tracepoint
(
evlist
);
}
static
int
test__checkevent_tracepoint_multi_modifier
(
struct
perf_evlist
*
evlist
)
{
struct
perf_evsel
*
evsel
;
TEST_ASSERT_VAL
(
"wrong number of entries"
,
evlist
->
nr_entries
>
1
);
list_for_each_entry
(
evsel
,
&
evlist
->
entries
,
node
)
{
TEST_ASSERT_VAL
(
"wrong exclude_user"
,
!
evsel
->
attr
.
exclude_user
);
TEST_ASSERT_VAL
(
"wrong exclude_kernel"
,
evsel
->
attr
.
exclude_kernel
);
TEST_ASSERT_VAL
(
"wrong exclude_hv"
,
evsel
->
attr
.
exclude_hv
);
TEST_ASSERT_VAL
(
"wrong precise_ip"
,
!
evsel
->
attr
.
precise_ip
);
}
return
test__checkevent_tracepoint_multi
(
evlist
);
}
static
int
test__checkevent_raw_modifier
(
struct
perf_evlist
*
evlist
)
{
struct
perf_evsel
*
evsel
=
list_entry
(
evlist
->
entries
.
next
,
struct
perf_evsel
,
node
);
TEST_ASSERT_VAL
(
"wrong exclude_user"
,
evsel
->
attr
.
exclude_user
);
TEST_ASSERT_VAL
(
"wrong exclude_kernel"
,
!
evsel
->
attr
.
exclude_kernel
);
TEST_ASSERT_VAL
(
"wrong exclude_hv"
,
evsel
->
attr
.
exclude_hv
);
TEST_ASSERT_VAL
(
"wrong precise_ip"
,
evsel
->
attr
.
precise_ip
);
return
test__checkevent_raw
(
evlist
);
}
static
int
test__checkevent_numeric_modifier
(
struct
perf_evlist
*
evlist
)
{
struct
perf_evsel
*
evsel
=
list_entry
(
evlist
->
entries
.
next
,
struct
perf_evsel
,
node
);
TEST_ASSERT_VAL
(
"wrong exclude_user"
,
evsel
->
attr
.
exclude_user
);
TEST_ASSERT_VAL
(
"wrong exclude_kernel"
,
evsel
->
attr
.
exclude_kernel
);
TEST_ASSERT_VAL
(
"wrong exclude_hv"
,
!
evsel
->
attr
.
exclude_hv
);
TEST_ASSERT_VAL
(
"wrong precise_ip"
,
evsel
->
attr
.
precise_ip
);
return
test__checkevent_numeric
(
evlist
);
}
static
int
test__checkevent_symbolic_name_modifier
(
struct
perf_evlist
*
evlist
)
{
struct
perf_evsel
*
evsel
=
list_entry
(
evlist
->
entries
.
next
,
struct
perf_evsel
,
node
);
TEST_ASSERT_VAL
(
"wrong exclude_user"
,
evsel
->
attr
.
exclude_user
);
TEST_ASSERT_VAL
(
"wrong exclude_kernel"
,
evsel
->
attr
.
exclude_kernel
);
TEST_ASSERT_VAL
(
"wrong exclude_hv"
,
!
evsel
->
attr
.
exclude_hv
);
TEST_ASSERT_VAL
(
"wrong precise_ip"
,
!
evsel
->
attr
.
precise_ip
);
return
test__checkevent_symbolic_name
(
evlist
);
}
static
int
test__checkevent_symbolic_alias_modifier
(
struct
perf_evlist
*
evlist
)
{
struct
perf_evsel
*
evsel
=
list_entry
(
evlist
->
entries
.
next
,
struct
perf_evsel
,
node
);
TEST_ASSERT_VAL
(
"wrong exclude_user"
,
!
evsel
->
attr
.
exclude_user
);
TEST_ASSERT_VAL
(
"wrong exclude_kernel"
,
evsel
->
attr
.
exclude_kernel
);
TEST_ASSERT_VAL
(
"wrong exclude_hv"
,
evsel
->
attr
.
exclude_hv
);
TEST_ASSERT_VAL
(
"wrong precise_ip"
,
!
evsel
->
attr
.
precise_ip
);
return
test__checkevent_symbolic_alias
(
evlist
);
}
static
int
test__checkevent_genhw_modifier
(
struct
perf_evlist
*
evlist
)
{
struct
perf_evsel
*
evsel
=
list_entry
(
evlist
->
entries
.
next
,
struct
perf_evsel
,
node
);
TEST_ASSERT_VAL
(
"wrong exclude_user"
,
evsel
->
attr
.
exclude_user
);
TEST_ASSERT_VAL
(
"wrong exclude_kernel"
,
!
evsel
->
attr
.
exclude_kernel
);
TEST_ASSERT_VAL
(
"wrong exclude_hv"
,
evsel
->
attr
.
exclude_hv
);
TEST_ASSERT_VAL
(
"wrong precise_ip"
,
evsel
->
attr
.
precise_ip
);
return
test__checkevent_genhw
(
evlist
);
}
static
struct
test__event_st
{
const
char
*
name
;
__u32
type
;
...
...
@@ -808,6 +905,34 @@ static struct test__event_st {
.
name
=
"mem:0:w"
,
.
check
=
test__checkevent_breakpoint_w
,
},
{
.
name
=
"syscalls:sys_enter_open:k"
,
.
check
=
test__checkevent_tracepoint_modifier
,
},
{
.
name
=
"syscalls:*:u"
,
.
check
=
test__checkevent_tracepoint_multi_modifier
,
},
{
.
name
=
"r1:kp"
,
.
check
=
test__checkevent_raw_modifier
,
},
{
.
name
=
"1:1:hp"
,
.
check
=
test__checkevent_numeric_modifier
,
},
{
.
name
=
"instructions:h"
,
.
check
=
test__checkevent_symbolic_name_modifier
,
},
{
.
name
=
"faults:u"
,
.
check
=
test__checkevent_symbolic_alias_modifier
,
},
{
.
name
=
"L1-dcache-load-miss:kp"
,
.
check
=
test__checkevent_genhw_modifier
,
},
};
#define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st))
...
...
tools/perf/perf.h
浏览文件 @
d9e24427
...
...
@@ -200,6 +200,7 @@ struct perf_record_opts {
bool
sample_time
;
bool
sample_id_all_avail
;
bool
system_wide
;
bool
period
;
unsigned
int
freq
;
unsigned
int
mmap_pages
;
unsigned
int
user_freq
;
...
...
tools/perf/util/config.c
浏览文件 @
d9e24427
/*
* GIT - The information manager from hell
* config.c
*
* Helper functions for parsing config items.
* Originally copied from GIT source.
*
* Copyright (C) Linus Torvalds, 2005
* Copyright (C) Johannes Schindelin, 2005
...
...
tools/perf/util/event.c
浏览文件 @
d9e24427
...
...
@@ -814,13 +814,14 @@ int perf_event__preprocess_sample(const union perf_event *event,
al
->
cpu
=
sample
->
cpu
;
if
(
al
->
map
)
{
struct
dso
*
dso
=
al
->
map
->
dso
;
if
(
symbol_conf
.
dso_list
&&
(
!
al
->
map
||
!
al
->
map
->
dso
||
!
(
strlist__has_entry
(
symbol_conf
.
dso_list
,
al
->
map
->
dso
->
short_name
)
||
(
al
->
map
->
dso
->
short_name
!=
al
->
map
->
dso
->
long_name
&&
strlist__has_entry
(
symbol_conf
.
dso_list
,
al
->
map
->
dso
->
long_name
)))))
(
!
dso
||
!
(
strlist__has_entry
(
symbol_conf
.
dso_list
,
dso
->
short_name
)
||
(
dso
->
short_name
!=
dso
->
long_name
&&
strlist__has_entry
(
symbol_conf
.
dso_list
,
dso
->
long_name
)))))
goto
out_filtered
;
al
->
sym
=
map__find_symbol
(
al
->
map
,
al
->
addr
,
filter
);
...
...
tools/perf/util/evlist.c
浏览文件 @
d9e24427
...
...
@@ -447,8 +447,10 @@ static int __perf_evlist__mmap(struct perf_evlist *evlist,
evlist
->
mmap
[
idx
].
mask
=
mask
;
evlist
->
mmap
[
idx
].
base
=
mmap
(
NULL
,
evlist
->
mmap_len
,
prot
,
MAP_SHARED
,
fd
,
0
);
if
(
evlist
->
mmap
[
idx
].
base
==
MAP_FAILED
)
if
(
evlist
->
mmap
[
idx
].
base
==
MAP_FAILED
)
{
evlist
->
mmap
[
idx
].
base
=
NULL
;
return
-
1
;
}
perf_evlist__add_pollfd
(
evlist
,
fd
);
return
0
;
...
...
tools/perf/util/evsel.c
浏览文件 @
d9e24427
...
...
@@ -108,6 +108,9 @@ void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts)
if
(
opts
->
system_wide
)
attr
->
sample_type
|=
PERF_SAMPLE_CPU
;
if
(
opts
->
period
)
attr
->
sample_type
|=
PERF_SAMPLE_PERIOD
;
if
(
opts
->
sample_id_all_avail
&&
(
opts
->
sample_time
||
opts
->
system_wide
||
!
opts
->
no_inherit
||
opts
->
cpu_list
))
...
...
@@ -457,7 +460,7 @@ int perf_event__parse_sample(const union perf_event *event, u64 type,
u32
val32
[
2
];
}
u
;
memset
(
data
,
0
,
sizeof
(
*
data
));
data
->
cpu
=
data
->
pid
=
data
->
tid
=
-
1
;
data
->
stream_id
=
data
->
id
=
data
->
time
=
-
1ULL
;
...
...
tools/perf/util/symbol.c
浏览文件 @
d9e24427
...
...
@@ -1757,7 +1757,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
struct
stat
st
;
/*sshfs might return bad dent->d_type, so we have to stat*/
s
printf
(
path
,
"%s/%s"
,
dir_name
,
dent
->
d_name
);
s
nprintf
(
path
,
sizeof
(
path
)
,
"%s/%s"
,
dir_name
,
dent
->
d_name
);
if
(
stat
(
path
,
&
st
))
continue
;
...
...
@@ -1766,8 +1766,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
!
strcmp
(
dent
->
d_name
,
".."
))
continue
;
snprintf
(
path
,
sizeof
(
path
),
"%s/%s"
,
dir_name
,
dent
->
d_name
);
ret
=
map_groups__set_modules_path_dir
(
mg
,
path
);
if
(
ret
<
0
)
goto
out
;
...
...
@@ -1788,9 +1786,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
if
(
map
==
NULL
)
continue
;
snprintf
(
path
,
sizeof
(
path
),
"%s/%s"
,
dir_name
,
dent
->
d_name
);
long_name
=
strdup
(
path
);
if
(
long_name
==
NULL
)
{
ret
=
-
1
;
...
...
@@ -2609,10 +2604,10 @@ int symbol__init(void)
symbol_conf
.
initialized
=
true
;
return
0
;
out_free_dso_list:
strlist__delete
(
symbol_conf
.
dso_list
);
out_free_comm_list:
strlist__delete
(
symbol_conf
.
comm_list
);
out_free_dso_list:
strlist__delete
(
symbol_conf
.
dso_list
);
return
-
1
;
}
...
...
tools/perf/util/usage.c
浏览文件 @
d9e24427
/*
* GIT - The information manager from hell
* usage.c
*
* Various reporting routines.
* Originally copied from GIT source.
*
* Copyright (C) Linus Torvalds, 2005
*/
...
...
tools/perf/util/values.c
浏览文件 @
d9e24427
...
...
@@ -32,6 +32,7 @@ void perf_read_values_destroy(struct perf_read_values *values)
for
(
i
=
0
;
i
<
values
->
threads
;
i
++
)
free
(
values
->
value
[
i
]);
free
(
values
->
value
);
free
(
values
->
pid
);
free
(
values
->
tid
);
free
(
values
->
counterrawid
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录