[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABPqkBTr10pcbY0v5mM23PKDWdWg3CNywH4HLSGfy4ab8d6+=g@mail.gmail.com>
Date: Wed, 3 Nov 2021 15:29:50 -0700
From: Stephane Eranian <eranian@...gle.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Jiri Olsa <jolsa@...hat.com>, Namhyung Kim <namhyung@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Andi Kleen <ak@...ux.intel.com>,
Ian Rogers <irogers@...gle.com>
Subject: Re: [PATCH v3] perf evsel: Fix missing exclude_{host,guest} setting
On Wed, Nov 3, 2021 at 2:03 PM Arnaldo Carvalho de Melo <acme@...nel.org> wrote:
>
> Em Wed, Nov 03, 2021 at 10:35:04AM -0700, Stephane Eranian escreveu:
> > On Wed, Nov 3, 2021 at 4:32 AM Arnaldo Carvalho de Melo <acme@...nel.org> wrote:
> > > Em Wed, Nov 03, 2021 at 12:44:12AM -0700, Stephane Eranian escreveu:
> > > > On Wed, Nov 3, 2021 at 12:24 AM Jiri Olsa <jolsa@...hat.com> wrote:
> > > > > > If the pmu doesn't support host/guest filtering, pmu/bla1/G
> > > > > > may count something. Not sure if it's better to error out.
> > > > > > But the cycles:G and instructions:G should result in 0
> > > > > > in case there's no VM running.
>
> > > > > hm, I think if pmu doesn't support host/guest filtering then
> > > > > I think 'pmu/bla1/G' should error, no? better no number than
> > > > > bad number
>
> > > > Yes, it should in my opinion.
>
> > > Yeah, I thought about this yesterday (holiday here).
>
> > Otherwise you create the illusion that you are monitoring in guest
> > mode when you are not.
>
> > The question is: how can the tool know which modifiers are supported
> > per pmu model?
>
> As things stand kernel-wise, we should just do capability querying, i.e.
> if the user asks for a feature not available for a specific PMU, we
> should refuse and provide a helpful error message to the user.
>
> If the PMUs in the kernel had some kind of mask that stated what of the
> 'struct perf_event_attr' selectable features are supported, then we
> would just be able to avoid bothering the kernel asking for unsupported
> stuff.
>
I think we could add something like that in the sysfs entry for each
PMU instance.
that would avoid all these perf_event_open() calls and trying to
decipher the error
code.
> Just for exclude_guest we don't even need to have
> evsel->pmu->missing_features.exclude_guest, as this is a hard error, no
> point in caching previous capability queries.
>
> - Arnaldo
Powered by blists - more mailing lists