Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
c4f3b5a2
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看板
提交
c4f3b5a2
编写于
5月 04, 2010
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'perf' of
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6
into perf/core
上级
777d0411
02bf60aa
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
75 addition
and
18 deletion
+75
-18
tools/perf/Documentation/perf-buildid-cache.txt
tools/perf/Documentation/perf-buildid-cache.txt
+2
-2
tools/perf/Documentation/perf-inject.txt
tools/perf/Documentation/perf-inject.txt
+35
-0
tools/perf/builtin-inject.c
tools/perf/builtin-inject.c
+1
-1
tools/perf/builtin-record.c
tools/perf/builtin-record.c
+21
-14
tools/perf/command-list.txt
tools/perf/command-list.txt
+1
-0
tools/perf/util/event.c
tools/perf/util/event.c
+1
-0
tools/perf/util/header.c
tools/perf/util/header.c
+8
-1
tools/perf/util/parse-events.h
tools/perf/util/parse-events.h
+1
-0
tools/perf/util/trace-event-info.c
tools/perf/util/trace-event-info.c
+5
-0
未找到文件。
tools/perf/Documentation/perf-buildid-cache.txt
浏览文件 @
c4f3b5a2
...
@@ -8,7 +8,7 @@ perf-buildid-cache - Manage build-id cache.
...
@@ -8,7 +8,7 @@ perf-buildid-cache - Manage build-id cache.
SYNOPSIS
SYNOPSIS
--------
--------
[verse]
[verse]
'perf buildid-
list
<options>'
'perf buildid-
cache
<options>'
DESCRIPTION
DESCRIPTION
-----------
-----------
...
@@ -30,4 +30,4 @@ OPTIONS
...
@@ -30,4 +30,4 @@ OPTIONS
SEE ALSO
SEE ALSO
--------
--------
linkperf:perf-record[1], linkperf:perf-report[1]
linkperf:perf-record[1], linkperf:perf-report[1]
, linkperf:perf-buildid-list[1]
tools/perf/Documentation/perf-inject.txt
0 → 100644
浏览文件 @
c4f3b5a2
perf-inject(1)
==============
NAME
----
perf-inject - Filter to augment the events stream with additional information
SYNOPSIS
--------
[verse]
'perf inject <options>'
DESCRIPTION
-----------
perf-inject reads a perf-record event stream and repipes it to stdout. At any
point the processing code can inject other events into the event stream - in
this case build-ids (-b option) are read and injected as needed into the event
stream.
Build-ids are just the first user of perf-inject - potentially anything that
needs userspace processing to augment the events stream with additional
information could make use of this facility.
OPTIONS
-------
-b::
--build-ids=::
Inject build-ids into the output stream
-v::
--verbose::
Be more verbose.
SEE ALSO
--------
linkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-archive[1]
tools/perf/builtin-inject.c
浏览文件 @
c4f3b5a2
...
@@ -204,7 +204,7 @@ static const char * const report_usage[] = {
...
@@ -204,7 +204,7 @@ static const char * const report_usage[] = {
};
};
static
const
struct
option
options
[]
=
{
static
const
struct
option
options
[]
=
{
OPT_BOOLEAN
(
'b'
,
"
inject
build-ids"
,
&
inject_build_ids
,
OPT_BOOLEAN
(
'b'
,
"build-ids"
,
&
inject_build_ids
,
"Inject build-ids into the output stream"
),
"Inject build-ids into the output stream"
),
OPT_INCR
(
'v'
,
"verbose"
,
&
verbose
,
OPT_INCR
(
'v'
,
"verbose"
,
&
verbose
,
"be more verbose (show build ids, etc)"
),
"be more verbose (show build ids, etc)"
),
...
...
tools/perf/builtin-record.c
浏览文件 @
c4f3b5a2
...
@@ -560,11 +560,12 @@ static int __cmd_record(int argc, const char **argv)
...
@@ -560,11 +560,12 @@ static int __cmd_record(int argc, const char **argv)
return
err
;
return
err
;
}
}
if
(
raw_samples
)
{
if
(
raw_samples
&&
have_tracepoints
(
attrs
,
nr_counters
)
)
{
perf_header__set_feat
(
&
session
->
header
,
HEADER_TRACE_INFO
);
perf_header__set_feat
(
&
session
->
header
,
HEADER_TRACE_INFO
);
}
else
{
}
else
{
for
(
i
=
0
;
i
<
nr_counters
;
i
++
)
{
for
(
i
=
0
;
i
<
nr_counters
;
i
++
)
{
if
(
attrs
[
i
].
sample_type
&
PERF_SAMPLE_RAW
)
{
if
(
attrs
[
i
].
sample_type
&
PERF_SAMPLE_RAW
&&
attrs
[
i
].
type
==
PERF_TYPE_TRACEPOINT
)
{
perf_header__set_feat
(
&
session
->
header
,
HEADER_TRACE_INFO
);
perf_header__set_feat
(
&
session
->
header
,
HEADER_TRACE_INFO
);
break
;
break
;
}
}
...
@@ -662,19 +663,25 @@ static int __cmd_record(int argc, const char **argv)
...
@@ -662,19 +663,25 @@ static int __cmd_record(int argc, const char **argv)
return
err
;
return
err
;
}
}
err
=
event__synthesize_tracing_data
(
output
,
attrs
,
if
(
have_tracepoints
(
attrs
,
nr_counters
))
{
nr_counters
,
/*
process_synthesized_event
,
* FIXME err <= 0 here actually means that
session
);
* there were no tracepoints so its not really
/*
* an error, just that we don't need to
* FIXME err <= 0 here actually means that there were no tracepoints
* synthesize anything. We really have to
* so its not really an error, just that we don't need to synthesize
* return this more properly and also
* anything.
* propagate errors that now are calling die()
* We really have to return this more properly and also propagate
*/
* errors that now are calling die()
err
=
event__synthesize_tracing_data
(
output
,
attrs
,
*/
nr_counters
,
if
(
err
>
0
)
process_synthesized_event
,
session
);
if
(
err
<=
0
)
{
pr_err
(
"Couldn't record tracing data.
\n
"
);
return
err
;
}
advance_output
(
err
);
advance_output
(
err
);
}
}
}
machine
=
perf_session__find_host_machine
(
session
);
machine
=
perf_session__find_host_machine
(
session
);
...
...
tools/perf/command-list.txt
浏览文件 @
c4f3b5a2
...
@@ -8,6 +8,7 @@ perf-bench mainporcelain common
...
@@ -8,6 +8,7 @@ perf-bench mainporcelain common
perf-buildid-cache mainporcelain common
perf-buildid-cache mainporcelain common
perf-buildid-list mainporcelain common
perf-buildid-list mainporcelain common
perf-diff mainporcelain common
perf-diff mainporcelain common
perf-inject mainporcelain common
perf-list mainporcelain common
perf-list mainporcelain common
perf-sched mainporcelain common
perf-sched mainporcelain common
perf-record mainporcelain common
perf-record mainporcelain common
...
...
tools/perf/util/event.c
浏览文件 @
c4f3b5a2
...
@@ -713,6 +713,7 @@ int event__parse_sample(event_t *event, u64 type, struct sample_data *data)
...
@@ -713,6 +713,7 @@ int event__parse_sample(event_t *event, u64 type, struct sample_data *data)
array
++
;
array
++
;
}
}
data
->
id
=
-
1ULL
;
if
(
type
&
PERF_SAMPLE_ID
)
{
if
(
type
&
PERF_SAMPLE_ID
)
{
data
->
id
=
*
array
;
data
->
id
=
*
array
;
array
++
;
array
++
;
...
...
tools/perf/util/header.c
浏览文件 @
c4f3b5a2
...
@@ -436,7 +436,6 @@ static int perf_header__adds_write(struct perf_header *self, int fd)
...
@@ -436,7 +436,6 @@ static int perf_header__adds_write(struct perf_header *self, int fd)
trace_sec
->
size
=
lseek
(
fd
,
0
,
SEEK_CUR
)
-
trace_sec
->
offset
;
trace_sec
->
size
=
lseek
(
fd
,
0
,
SEEK_CUR
)
-
trace_sec
->
offset
;
}
}
if
(
perf_header__has_feat
(
self
,
HEADER_BUILD_ID
))
{
if
(
perf_header__has_feat
(
self
,
HEADER_BUILD_ID
))
{
struct
perf_file_section
*
buildid_sec
;
struct
perf_file_section
*
buildid_sec
;
...
@@ -923,6 +922,14 @@ perf_header__find_attr(u64 id, struct perf_header *header)
...
@@ -923,6 +922,14 @@ perf_header__find_attr(u64 id, struct perf_header *header)
{
{
int
i
;
int
i
;
/*
* We set id to -1 if the data file doesn't contain sample
* ids. Check for this and avoid walking through the entire
* list of ids which may be large.
*/
if
(
id
==
-
1ULL
)
return
NULL
;
for
(
i
=
0
;
i
<
header
->
attrs
;
i
++
)
{
for
(
i
=
0
;
i
<
header
->
attrs
;
i
++
)
{
struct
perf_header_attr
*
attr
=
header
->
attr
[
i
];
struct
perf_header_attr
*
attr
=
header
->
attr
[
i
];
int
j
;
int
j
;
...
...
tools/perf/util/parse-events.h
浏览文件 @
c4f3b5a2
...
@@ -13,6 +13,7 @@ struct tracepoint_path {
...
@@ -13,6 +13,7 @@ struct tracepoint_path {
};
};
extern
struct
tracepoint_path
*
tracepoint_id_to_path
(
u64
config
);
extern
struct
tracepoint_path
*
tracepoint_id_to_path
(
u64
config
);
extern
bool
have_tracepoints
(
struct
perf_event_attr
*
pattrs
,
int
nb_events
);
extern
int
nr_counters
;
extern
int
nr_counters
;
...
...
tools/perf/util/trace-event-info.c
浏览文件 @
c4f3b5a2
...
@@ -487,6 +487,11 @@ get_tracepoints_path(struct perf_event_attr *pattrs, int nb_events)
...
@@ -487,6 +487,11 @@ get_tracepoints_path(struct perf_event_attr *pattrs, int nb_events)
return
nr_tracepoints
>
0
?
path
.
next
:
NULL
;
return
nr_tracepoints
>
0
?
path
.
next
:
NULL
;
}
}
bool
have_tracepoints
(
struct
perf_event_attr
*
pattrs
,
int
nb_events
)
{
return
get_tracepoints_path
(
pattrs
,
nb_events
)
?
true
:
false
;
}
int
read_tracing_data
(
int
fd
,
struct
perf_event_attr
*
pattrs
,
int
nb_events
)
int
read_tracing_data
(
int
fd
,
struct
perf_event_attr
*
pattrs
,
int
nb_events
)
{
{
char
buf
[
BUFSIZ
];
char
buf
[
BUFSIZ
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录