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: <20171113182311.GA4123@kernel.org>
Date:   Mon, 13 Nov 2017 15:23:11 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Andi Kleen <andi@...stfloor.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

Em Mon, Nov 13, 2017 at 10:30:11AM +0100, Jiri Olsa escreveu:
> 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

No need, priv is supposed to be used by one tool only, i.e. its a too
private area, that perf_evsel_stats thing started to be used by multiple
tools, so I moved it to perf_evsel->stats and made perf_evsel->priv be
a tool priv area again.

I.e. move the above values to perf_stat_evsel and access it via
evsel->stats.

- Arnaldo
 
> thanks,
> jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ