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]
Date: Mon, 10 Jun 2024 21:01:18 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Ben Gainey <Ben.Gainey@....com>
Cc: "alexander.shishkin@...ux.intel.com" <alexander.shishkin@...ux.intel.com>,
	"linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>,
	Mark Rutland <Mark.Rutland@....com>,
	"acme@...nel.org" <acme@...nel.org>,
	"mingo@...hat.com" <mingo@...hat.com>,
	James Clark <James.Clark@....com>,
	"adrian.hunter@...el.com" <adrian.hunter@...el.com>,
	"namhyung@...nel.org" <namhyung@...nel.org>,
	"irogers@...gle.com" <irogers@...gle.com>,
	"jolsa@...nel.org" <jolsa@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v7 1/4] perf: Support PERF_SAMPLE_READ with inherit

On Fri, Jun 07, 2024 at 02:04:49PM +0000, Ben Gainey wrote:

> > IIRC they all originate in a single location around
> > perf_output_read(),
> > that already has the event and could easily 'correct' the semantic
> > meaning by doing the above once or so.
> > 
> 
> As far as I can tell, you can mix events in a group with inconsistent
> values of PERF_SAMPLE_READ which means that doing it at the top level
> introduces an inconsistency/confusing behaviour since it makes the
> "thread-local-ness" of the read_format values a property of the event
> that caused the sample, rather than of the specific event to which the
> value belongs. The current implementation makes it a property of the
> specific event not the sample event. Specifically, when
> perf_output_read_group reads a child event that does not have
> PERF_SAMPLE_READ, the sample event must have PERF_SAMPLE_READ, meaning
> the child event will give the thread-local value even though it was not
> created as inherit+PERF_SAMPLE_READ
> 
> I can either:
> 
>  * Keep it so that the perf_output_read_group uses per-event value for
> self

Having the lot be inconsistent seems bad.

>  * Rework the deliver_sample_value in session.c to base its decision on
> the sample event rather than the specific event

The code as it exists seems to use the read_format from the event that
actually triggers the sample -- which makes sense. I would expect this
new thing to follow that.

Mixing inherit between events in a group gets you crap, but that's what
you asked for I suppose :-) But otherwise let the sampling event set the
format.

>  * Forbid inconsistent PERF_SAMPLE_READ for events in a group

Not possible I think, you can have non-sampling events in a group.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ