提交 0817a6a3 编写于 作者: A Arun Sharma 提交者: Arnaldo Carvalho de Melo

perf script: Add support for PERF_TYPE_RAW

Useful for getting stack traces for hardware events not handled by
PERF_TYPE_HARDWARE.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: NArun Sharma <asharma@fb.com>
Link: http://lkml.kernel.org/n/tip-qimdcdpekjqxuyqovy4kjusx@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 f18568aa
...@@ -82,6 +82,16 @@ static struct { ...@@ -82,6 +82,16 @@ static struct {
PERF_OUTPUT_CPU | PERF_OUTPUT_TIME | PERF_OUTPUT_CPU | PERF_OUTPUT_TIME |
PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE, PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE,
}, },
[PERF_TYPE_RAW] = {
.user_set = false,
.fields = PERF_OUTPUT_COMM | PERF_OUTPUT_TID |
PERF_OUTPUT_CPU | PERF_OUTPUT_TIME |
PERF_OUTPUT_EVNAME | PERF_OUTPUT_SYM,
.invalid_fields = PERF_OUTPUT_TRACE,
},
}; };
static bool output_set_by_user(void) static bool output_set_by_user(void)
...@@ -502,6 +512,8 @@ static int parse_output_fields(const struct option *opt __used, ...@@ -502,6 +512,8 @@ static int parse_output_fields(const struct option *opt __used,
type = PERF_TYPE_SOFTWARE; type = PERF_TYPE_SOFTWARE;
else if (!strcmp(str, "trace")) else if (!strcmp(str, "trace"))
type = PERF_TYPE_TRACEPOINT; type = PERF_TYPE_TRACEPOINT;
else if (!strcmp(str, "raw"))
type = PERF_TYPE_RAW;
else { else {
fprintf(stderr, "Invalid event type in field string.\n"); fprintf(stderr, "Invalid event type in field string.\n");
return -EINVAL; return -EINVAL;
...@@ -902,7 +914,7 @@ static const struct option options[] = { ...@@ -902,7 +914,7 @@ static const struct option options[] = {
OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory", OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
"Look for files with symbols relative to this directory"), "Look for files with symbols relative to this directory"),
OPT_CALLBACK('f', "fields", NULL, "str", OPT_CALLBACK('f', "fields", NULL, "str",
"comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace. Fields: comm,tid,pid,time,cpu,event,trace,sym", "comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,sym",
parse_output_fields), parse_output_fields),
OPT_END() OPT_END()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册