From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753136AbcAGJyQ (ORCPT ); Thu, 7 Jan 2016 04:54:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41543 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752522AbcAGJyM (ORCPT ); Thu, 7 Jan 2016 04:54:12 -0500 Date: Thu, 7 Jan 2016 10:54:09 +0100 From: Jiri Olsa 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 Message-ID: <20160107095409.GA6782@krava.brq.redhat.com> References: <1452078277-15520-1-git-send-email-kan.liang@intel.com> <1452078277-15520-7-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452078277-15520-7-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 06, 2016 at 06:04:36AM -0500, kan.liang@intel.com wrote: > From: Kan Liang > > 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 > --- > 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