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] [day] [month] [year] [list]
Message-ID: <c7e865010699fc10c1e16b2720c31feb6beb5357.camel@intel.com>
Date: Fri, 13 Dec 2024 19:53:10 +0000
From: "Falcon, Thomas" <thomas.falcon@...el.com>
To: "ravi.bangoria@....com" <ravi.bangoria@....com>,
	"kan.liang@...ux.intel.com" <kan.liang@...ux.intel.com>
CC: "irogers@...gle.com" <irogers@...gle.com>,
	"alexander.shishkin@...ux.intel.com" <alexander.shishkin@...ux.intel.com>,
	"peterz@...radead.org" <peterz@...radead.org>, "mark.rutland@....com"
	<mark.rutland@....com>, "linux-perf-users@...r.kernel.org"
	<linux-perf-users@...r.kernel.org>, "mingo@...hat.com" <mingo@...hat.com>,
	"acme@...nel.org" <acme@...nel.org>, "namhyung@...nel.org"
	<namhyung@...nel.org>, "jolsa@...nel.org" <jolsa@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Hunter,
 Adrian" <adrian.hunter@...el.com>
Subject: Re: [PATCH] perf script: Fix output type for dynamically allocated
 core PMU's

On Fri, 2024-12-13 at 13:34 -0500, Liang, Kan wrote:
> 
> 
> On 2024-12-13 2:07 a.m., Ravi Bangoria wrote:
> > Hi Thomas,
> > 
> > > @@ -386,6 +386,8 @@ static int evsel_script__fprintf(struct
> > > evsel_script *es, FILE *fp)
> > >  
> > >  static inline int output_type(unsigned int type)
> > >  {
> > > +	struct perf_pmu *pmu;
> > > +
> > >  	switch (type) {
> > >  	case PERF_TYPE_SYNTH:
> > >  		return OUTPUT_TYPE_SYNTH;
> > > @@ -394,6 +396,10 @@ static inline int output_type(unsigned int
> > > type)
> > >  			return type;
> > >  	}
> > >  
> > > +	pmu = perf_pmus__find_by_type(type);
> > > +	if (pmu && pmu->is_core)
> > > +		return PERF_TYPE_RAW;
> > 
> > Minor nit ...
> > 
> > output_type() seems to be getting called a lot. For ex, for a
> > perf.data
> > with 4530 samples, output_type() was called 181246 times when I ran
> > "perf script". IIUC, this pmu lookup is unnecessary for homogeneous
> > platforms? If so, can we make it conditional?
> > 
> 
> Agreed. I think the search should only be applied for the
> perf_pmus__num_core_pmus() > 1 case.
> 
> We should just need to search the core_pmus when comparing the type.
> 
Thanks, will send v2 soon.

Tom

> Thanks,
> Kan
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ