mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>, Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Stephane Eranian <eranian@google.com>,
	Andi Kleen <ak@linux.intel.com>, Ian Rogers <irogers@google.com>,
	Namhyung Kim <namhyung@google.com>,
	Song Liu <songliubraving@fb.com>
Subject: Re: [PATCH v2] perf/core: Set event shadow time for inactive events too
Date: Sun, 5 Dec 2021 15:15:58 +0100	[thread overview]
Message-ID: <20211205141558.GX16608@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20211201045807.1223200-1-namhyung@kernel.org>

On Tue, Nov 30, 2021 at 08:58:07PM -0800, Namhyung Kim wrote:
> From: Namhyung Kim <namhyung@google.com>
> 
> While f79256532682 ("perf/core: fix userpage->time_enabled of inactive
> events") fixed this problem for user rdpmc usage, bperf (perf stat
> with BPF) still has the same problem that accessing inactive perf
> events from BPF using bpf_perf_event_read_value().
> 
> +static inline void group_update_event_time(struct perf_event *group_event)
>  {
> +	struct perf_event *event;
> +	struct perf_event_context *ctx = group_event->ctx;

:-( surely you're aware of the reverse xmas tree thing by now?

>  
> +	perf_event_update_time(group_event);
> +	perf_set_shadow_time(group_event, ctx);
>  
> +	for_each_sibling_event(event, group_event) {
> +		perf_event_update_time(event);
> +		perf_set_shadow_time(event, ctx);
> +	}
>  
> +	if (likely(!atomic_read(&group_event->mmap_count)))
>  		return;
>  
> +	perf_event_update_userpage(group_event);
> +
>  	for_each_sibling_event(event, group_event)
> +		perf_event_update_userpage(event);

How does it make sense to chase those pointers twice?

>  }

  reply	other threads:[~2021-12-05 14:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01  4:58 Namhyung Kim
2021-12-05 14:15 ` Peter Zijlstra [this message]
2021-12-05 20:56   ` Namhyung Kim

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=20211205141558.GX16608@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@google.com \
    --cc=namhyung@kernel.org \
    --cc=songliubraving@fb.com \
    /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

all inboxes | Powered by JetHome®