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:   Mon, 13 Nov 2017 10:30:11 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Andi Kleen <andi@...stfloor.org>
Cc:     acme@...nel.org, jolsa@...nel.org, linux-kernel@...r.kernel.org,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH v1 5/5] perf, tools, script: Allow computing metrics in
 perf script

On Thu, Nov 09, 2017 at 06:55:28AM -0800, Andi Kleen wrote:

SNIP

>  static void process_event(struct perf_script *script,
>  			  struct perf_sample *sample, struct perf_evsel *evsel,
>  			  struct addr_location *al,
> @@ -1481,6 +1560,9 @@ static void process_event(struct perf_script *script,
>  	if (PRINT_FIELD(PHYS_ADDR))
>  		printf("%16" PRIx64, sample->phys_addr);
>  	printf("\n");
> +
> +	if (PRINT_FIELD(METRIC))
> +		print_metric(script, thread, evsel, sample);
>  }
>  
>  static struct scripting_ops	*scripting_ops;
> diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
> index 25f21cde8826..27a72b883645 100644
> --- a/tools/perf/util/evsel.h
> +++ b/tools/perf/util/evsel.h
> @@ -108,6 +108,8 @@ struct perf_evsel {
>  	struct cpu_map		*cpus;
>  	struct cpu_map		*own_cpus;
>  	struct thread_map	*threads;
> +	u64			val;
> +	int			gnum;

please put this to the priv (struct perf_stat_evsel)
with some comments that it's used in script only

also there's per event dump feature that uses evsel->priv
(please rebase to latest Arnaldo's perf/core) in script,
so make sure you are mutualy exclusive

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ