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]
Date:   Wed, 3 Nov 2021 10:35:04 -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 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:
> > > On Tue, Nov 02, 2021 at 04:21:21PM -0700, Namhyung Kim wrote:
> > > > On Tue, Nov 2, 2021 at 7:10 AM Jiri Olsa <jolsa@...hat.com> wrote:
> > > > > we were discussing this with Arnaldo yesterday and he had an idea to use
> > > > > evsel->pmu link to store this info instead of hash.. I first thought we
> > > > > needed 'evsel' related data, but after I gave it some thought I think that
> > > > > might actually work
>
> > > > I don't get it.. do we have evsel->pmu already?  Or do you want to add it?
> > > > Yeah, the filtering facility (attr.exclude_*) should be kept in a PMU data
> > > > not in the evsel.  So I added a hashmap to find the pmu data from attr.type.
> > > > How do I use evsel->pmu to store the info then?
>
> > > evsel->pmu is not there yet (only evsel->pmu_name) so that
> > > would need to be added.. we have evsel__find_pmu available
>
> > > then the idea is to use evsel->pmu instead of the hasmap,
> > > like add:
>
> > >   struct pmu {
> > >     ...
> > >     bool missing_exclude_guest;
> > >   };
>
> yeah, or more generaly:
>
>         struct pmu {
>                 ...
>                 struct {
>                         bool exclude_guess;
>                 } missing_features;
>         };
>
> > > set it when the guest filtering fails and and check it
> > > instead of the hashmap__find call
>
> > > > > my argument was following usecase:
>
> > > > >   cycles:G,instructions:G,pmu/bla1/:G,pmu/bla2/
>
> > > > > that we would falsely clear pmu/bla1/:G if we used the 'evsel->pmu' data..
> > > > > but then I realized it's detection if pmu support :G and so if the :G is
> > > > > not there, none of the events should have it
>
> > > > > thoughts?
>
> > > > I don't think I'm following well... ;-p
>
> > > > 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?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ