From: Jiri Olsa <jolsa@redhat.com>
To: kan.liang@intel.com
Cc: peterz@infradead.org, acme@kernel.org, eranian@google.com,
ak@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/8] perf script: support physical addresses in script
Date: Thu, 7 Jan 2016 10:54:09 +0100 [thread overview]
Message-ID: <20160107095409.GA6782@krava.brq.redhat.com> (raw)
In-Reply-To: <1452078277-15520-7-git-send-email-kan.liang@intel.com>
On Wed, Jan 06, 2016 at 06:04:36AM -0500, kan.liang@intel.com wrote:
> From: Kan Liang <kan.liang@intel.com>
>
> perf script print out physical addresses by applying phys_addr.
> Only display physical address when virtual address is selected. The
> physical address will be printed out right after virtual address.
>
> Signed-off-by: Kan Liang <kan.liang@intel.com>
> ---
> tools/perf/builtin-script.c | 19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index c298cdc..1e292a7 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -58,6 +58,7 @@ enum perf_output_field {
> PERF_OUTPUT_IREGS = 1U << 14,
> PERF_OUTPUT_BRSTACK = 1U << 15,
> PERF_OUTPUT_BRSTACKSYM = 1U << 16,
> + PERF_OUTPUT_PHYS_ADDR = 1U << 17,
> };
>
> struct output_option {
> @@ -81,6 +82,7 @@ struct output_option {
> {.str = "iregs", .field = PERF_OUTPUT_IREGS},
> {.str = "brstack", .field = PERF_OUTPUT_BRSTACK},
> {.str = "brstacksym", .field = PERF_OUTPUT_BRSTACKSYM},
> + {.str = "phys_addr", .field = PERF_OUTPUT_PHYS_ADDR},
> };
>
> /* default set to maintain compatibility with current format */
> @@ -242,6 +244,12 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
> PERF_OUTPUT_ADDR, allow_user_set))
> return -EINVAL;
>
> + if (PRINT_FIELD(PHYS_ADDR) && !PRINT_FIELD(ADDR)) {
> + pr_err("Display of sample physical address"
> + "but sample address is not selected.\n");
> + return -EINVAL;
> + }
hum, why the ADDR matter in here? we have PHYS_ADDR already stored
in perf.data so we should be all set to display it
[jolsa@ibm-x3650m4-01 perf]$ ./perf script -F addr,phys_addr | head -3
ffff8804744e5de9 4744e5de9
ffff88047fca5e90 47fca5e90
ffff8804710cfcb8 4710cfcb8
[jolsa@ibm-x3650m4-01 perf]$ ./perf script -F phys_addr
Display of sample physical addressbut sample address is not selected.
also you need to add extra space behind 'address':
thanks,
jirka
next prev parent reply other threads:[~2016-01-07 9:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 11:04 [PATCH 1/8] perf: Add PERF_SAMPLE_PHYS_ADDR kan.liang
2016-01-06 11:04 ` [PATCH 2/8] perf tools: add option to record sample physical address kan.liang
2016-01-07 9:56 ` Jiri Olsa
2016-01-06 11:04 ` [PATCH 3/8] perf tools: add sort option phys_daddr kan.liang
2016-01-06 11:04 ` [PATCH 4/8] perf mem: add option phys-data to record physical address kan.liang
2016-01-06 11:04 ` [PATCH 5/8] perf mem: report physical addresses kan.liang
2016-01-07 8:27 ` Jiri Olsa
2016-01-06 11:04 ` [PATCH 6/8] perf mem: dump " kan.liang
2016-01-06 11:04 ` [PATCH 7/8] perf script: support physical addresses in script kan.liang
2016-01-07 9:54 ` Jiri Olsa [this message]
2016-01-06 11:04 ` [PATCH 8/8] perf test: add test case for PERF_SAMPLE_PHYS_ADDR kan.liang
2016-01-06 19:21 ` [PATCH 1/8] perf: Add PERF_SAMPLE_PHYS_ADDR Stephane Eranian
2016-01-07 8:33 ` Jiri Olsa
2016-01-07 15:55 ` Liang, Kan
2016-01-07 19:31 ` Jiri Olsa
2016-01-07 21:50 ` Stephane Eranian
2016-01-08 21:12 ` Liang, Kan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160107095409.GA6782@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome