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]
Message-ID: <20160507191427.GI19977@krava>
Date:	Sat, 7 May 2016 21:14:27 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	acme@...nel.org, peterz@...radead.org, jolsa@...nel.org,
	linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 07/10] perf, tools, stat: Scale values by unit before
 metrics

On Thu, May 05, 2016 at 04:04:04PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@...ux.intel.com>
> 
> Scale values by unit before passing them to the metrics printing functions.
> This is needed for TopDown, because it needs to scale the slots correctly
> by pipeline width / SMTness.
> 
> For existing metrics it shouldn't make any difference, as those generally
> use events that don't have any units.
> 
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>

Acked-by: Jiri Olsa <jolsa@...nel.org>

thanks,
jirka

> ---
>  tools/perf/util/stat.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
> index 4d9b481cf3b6..ffa1d0653861 100644
> --- a/tools/perf/util/stat.c
> +++ b/tools/perf/util/stat.c
> @@ -307,6 +307,7 @@ int perf_stat_process_counter(struct perf_stat_config *config,
>  	struct perf_counts_values *aggr = &counter->counts->aggr;
>  	struct perf_stat_evsel *ps = counter->priv;
>  	u64 *count = counter->counts->aggr.values;
> +	u64 val;
>  	int i, ret;
>  
>  	aggr->val = aggr->ena = aggr->run = 0;
> @@ -346,7 +347,8 @@ int perf_stat_process_counter(struct perf_stat_config *config,
>  	/*
>  	 * Save the full runtime - to allow normalization during printout:
>  	 */
> -	perf_stat__update_shadow_stats(counter, count, 0);
> +	val = counter->scale * *count;
> +	perf_stat__update_shadow_stats(counter, &val, 0);
>  
>  	return 0;
>  }
> -- 
> 2.5.5
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ