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: <20240730122523.GM33588@noisy.programming.kicks-ass.net>
Date: Tue, 30 Jul 2024 14:25:23 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Ben Gainey <ben.gainey@....com>
Cc: mingo@...hat.com, acme@...nel.org, namhyung@...nel.org,
	james.clark@....com, mark.rutland@....com,
	alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
	irogers@...gle.com, adrian.hunter@...el.com,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v9 0/4] perf: Support PERF_SAMPLE_READ with inherit

On Tue, Jul 30, 2024 at 09:44:13AM +0100, Ben Gainey wrote:
> This change allows events to use PERF_SAMPLE READ with inherit so long
> as PERF_SAMPLE_TID is also set.
> 
> Currently it is not possible to use PERF_SAMPLE_READ with inherit. This
> restriction assumes the user is interested in collecting aggregate
> statistics as per `perf stat`. It prevents a user from collecting
> per-thread samples using counter groups from a multi-threaded or
> multi-process application, as with `perf record -e '{....}:S'`. Instead
> users must use system-wide mode, or forgo the ability to sample counter
> groups, or profile a single thread. System-wide mode is often
> problematic as it requires specific permissions (no CAP_PERFMON / root
> access), or may lead to capture of significant amounts of extra data
> from other processes running on the system.
> 
> This patch changes `perf_event_alloc` relaxing the restriction against
> combining `inherit` with `PERF_SAMPLE_READ` so that the combination
> will be allowed so long as `PERF_SAMPLE_TID` is enabled. It modifies
> sampling so that only the count associated with the active thread is
> recorded into the buffer. It modifies the context switch handling so
> that perf contexts are always switched out if they have this kind of
> event so that the correct per-thread state is maintained. Finally, the
> tools are updated to allow perf record to specify this combination and
> to correctly decode the sample data.
> 
> In this configuration sample values, as may appear in the read_format
> field of a PERF_RECORD_SAMPLE, are no longer global counters. Instead
> the value reports the per-thread value for the active thread.
> Tools that expect the global total, for example when calculate a delta
> between samples, would need updating to take this into account when
> opting into this new behaviour. Previously valid event configurations
> (system-wide, no-inherit and so on) are unaffected.
> 

Thanks, I've picked up the kernel patches, and provided the robot
doesn't hate on them, they will appear in tip/perf/core soonish.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ