提交 94ddddfa 编写于 作者: J Jiri Olsa 提交者: Arnaldo Carvalho de Melo

perf script: Add data_src and weight column definitions

Adding data_src and weight column definitions, so it's displayed for
related sample types.
Signed-off-by: NJiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1455525293-8671-22-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 b19a1b6a
...@@ -58,6 +58,8 @@ enum perf_output_field { ...@@ -58,6 +58,8 @@ enum perf_output_field {
PERF_OUTPUT_IREGS = 1U << 14, PERF_OUTPUT_IREGS = 1U << 14,
PERF_OUTPUT_BRSTACK = 1U << 15, PERF_OUTPUT_BRSTACK = 1U << 15,
PERF_OUTPUT_BRSTACKSYM = 1U << 16, PERF_OUTPUT_BRSTACKSYM = 1U << 16,
PERF_OUTPUT_DATA_SRC = 1U << 17,
PERF_OUTPUT_WEIGHT = 1U << 18,
}; };
struct output_option { struct output_option {
...@@ -81,6 +83,8 @@ struct output_option { ...@@ -81,6 +83,8 @@ struct output_option {
{.str = "iregs", .field = PERF_OUTPUT_IREGS}, {.str = "iregs", .field = PERF_OUTPUT_IREGS},
{.str = "brstack", .field = PERF_OUTPUT_BRSTACK}, {.str = "brstack", .field = PERF_OUTPUT_BRSTACK},
{.str = "brstacksym", .field = PERF_OUTPUT_BRSTACKSYM}, {.str = "brstacksym", .field = PERF_OUTPUT_BRSTACKSYM},
{.str = "data_src", .field = PERF_OUTPUT_DATA_SRC},
{.str = "weight", .field = PERF_OUTPUT_WEIGHT},
}; };
/* default set to maintain compatibility with current format */ /* default set to maintain compatibility with current format */
...@@ -242,6 +246,16 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel, ...@@ -242,6 +246,16 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
PERF_OUTPUT_ADDR, allow_user_set)) PERF_OUTPUT_ADDR, allow_user_set))
return -EINVAL; return -EINVAL;
if (PRINT_FIELD(DATA_SRC) &&
perf_evsel__check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC",
PERF_OUTPUT_DATA_SRC))
return -EINVAL;
if (PRINT_FIELD(WEIGHT) &&
perf_evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT, "WEIGHT",
PERF_OUTPUT_WEIGHT))
return -EINVAL;
if (PRINT_FIELD(SYM) && !PRINT_FIELD(IP) && !PRINT_FIELD(ADDR)) { if (PRINT_FIELD(SYM) && !PRINT_FIELD(IP) && !PRINT_FIELD(ADDR)) {
pr_err("Display of symbols requested but neither sample IP nor " pr_err("Display of symbols requested but neither sample IP nor "
"sample address\nis selected. Hence, no addresses to convert " "sample address\nis selected. Hence, no addresses to convert "
...@@ -673,6 +687,12 @@ static void process_event(struct perf_script *script, union perf_event *event, ...@@ -673,6 +687,12 @@ static void process_event(struct perf_script *script, union perf_event *event,
if (PRINT_FIELD(ADDR)) if (PRINT_FIELD(ADDR))
print_sample_addr(event, sample, thread, attr); print_sample_addr(event, sample, thread, attr);
if (PRINT_FIELD(DATA_SRC))
printf("%16" PRIx64, sample->data_src);
if (PRINT_FIELD(WEIGHT))
printf("%16" PRIu64, sample->weight);
if (PRINT_FIELD(IP)) { if (PRINT_FIELD(IP)) {
if (!symbol_conf.use_callchain) if (!symbol_conf.use_callchain)
printf(" "); printf(" ");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册