public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Ben Gainey <Ben.Gainey@arm.com>
Cc: "alexander.shishkin@linux.intel.com"
	<alexander.shishkin@linux.intel.com>,
	"linux-perf-users@vger.kernel.org"
	<linux-perf-users@vger.kernel.org>,
	Mark Rutland <Mark.Rutland@arm.com>,
	"acme@kernel.org" <acme@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	James Clark <James.Clark@arm.com>,
	"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
	"namhyung@kernel.org" <namhyung@kernel.org>,
	"irogers@google.com" <irogers@google.com>,
	"jolsa@kernel.org" <jolsa@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v7 1/4] perf: Support PERF_SAMPLE_READ with inherit
Date: Mon, 10 Jun 2024 21:01:18 +0200	[thread overview]
Message-ID: <20240610190118.GV8774@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <60ed550e8cb5e5aa4004fb2d3857a605ba1da23e.camel@arm.com>

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.

  reply	other threads:[~2024-06-10 19:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 14:40 [PATCH v7 0/4] perf: Support PERF_SAMPLE_READ with inherit Ben Gainey
2024-06-06 14:40 ` [PATCH v7 1/4] " Ben Gainey
2024-06-07  9:32   ` Peter Zijlstra
2024-06-07 10:16     ` Ben Gainey
2024-06-07 11:02       ` Peter Zijlstra
2024-06-07 14:04         ` Ben Gainey
2024-06-10 19:01           ` Peter Zijlstra [this message]
2024-06-06 14:40 ` [PATCH v7 2/4] tools/perf: Track where perf_sample_ids need per-thread periods Ben Gainey
2024-06-06 14:40 ` [PATCH v7 3/4] tools/perf: Correctly calculate sample period for inherited SAMPLE_READ values Ben Gainey
2024-06-06 14:40 ` [PATCH v7 4/4] tools/perf: Allow inherit + PERF_SAMPLE_READ when opening events Ben Gainey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240610190118.GV8774@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Ben.Gainey@arm.com \
    --cc=James.Clark@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox