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:	Wed, 24 Jun 2015 00:03:12 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	Jiri Olsa <jolsa@...nel.org>, lkml <linux-kernel@...r.kernel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Andi Kleen <ak@...ux.intel.com>,
	David Ahern <dsahern@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 09/27] perf stat: Introduce perf_counts function

On Tue, Jun 23, 2015 at 06:11:54PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Jun 23, 2015 at 12:36:10AM +0200, Jiri Olsa escreveu:
> > Introducing perf_counts function, that returns
> > 'struct perf_counts_values' pointer for given cpu.
> > -		evsel->counts->cpu[cpu] = *count;
> > +		*perf_counts(evsel->counts, cpu) = *count;
> 
> For consistency, just like thread_map__set_pid(), please have a:

it's consistent with xyarray__entry

> 
> 	perf_counts__set(evsel->counts, *cont);
> 
> In addition to its counterpart:
> 
>         perf_counts__value(evsel->counts, cpu);
> 
> Since you're not storing multiple entries per bucket, we need to use the
> "value" idiom.

perf_counts returns pointer to the 'struct perf_counts_values'
which is clean and valid and IMO the code is more readable

You use just 'perf_counts(counts, cpu, thread)' and get values
and do whatever you want with them.. why introduce 2 functions
for it?

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ