lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 7 Jan 2016 10:54:09 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	kan.liang@...el.com
Cc:	peterz@...radead.org, acme@...nel.org, eranian@...gle.com,
	ak@...ux.intel.com, jolsa@...nel.org, namhyung@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/8] perf script: support physical addresses in script

On Wed, Jan 06, 2016 at 06:04:36AM -0500, kan.liang@...el.com wrote:
> From: Kan Liang <kan.liang@...el.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@...el.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@...-x3650m4-01 perf]$ ./perf script -F addr,phys_addr | head -3
ffff8804744e5de9       4744e5de9
ffff88047fca5e90       47fca5e90
ffff8804710cfcb8       4710cfcb8

[jolsa@...-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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists