[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YcBPZXtu0OOesleq@hirez.programming.kicks-ass.net>
Date: Mon, 20 Dec 2021 10:39:49 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>,
Andi Kleen <ak@...ux.intel.com>,
Ian Rogers <irogers@...gle.com>,
Song Liu <songliubraving@...com>
Subject: Re: [PATCH v3] perf/core: Set event shadow time for inactive events
too
On Fri, Dec 10, 2021 at 10:59:49AM -0800, Namhyung Kim wrote:
> > You're doing that bpf-cgroup crud, right? Where exactly do you hook into
> > to do the counter reads?
>
> That's true but it doesn't use cgroup events actually. They are plain cpu
> events and BPF is called from a separate 'cgroup-switches' event to
> read out the counters.
Oh, right.
> > > Maybe because the event is enabled from the beginning.
> > > Then it might miss set_state/update_time at all.
> >
> > Even then, it's set to INACTIVE and any state change thereafter needs to
> > go through perf_event_set_state() and update the relevant timestamps.
>
> Right, but the problem happens when you read the event *before*
> any state change.
But the per-cpu event should be the simplest case ever, the cpu context
is *always* active, enabled time always runs.
Powered by blists - more mailing lists