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]
Message-ID: <CAM9d7cj_P27f=Mi=-he3v66G7DiOtGwo1=RdijC_hQ86LQ5isw@mail.gmail.com>
Date:   Wed, 11 May 2022 22:01:15 -0700
From:   Namhyung Kim <namhyung@...nel.org>
To:     Adrian Hunter <adrian.hunter@...el.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...hat.com>, Ian Rogers <irogers@...gle.com>,
        Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>,
        Leo Yan <leo.yan@...aro.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V3 13/23] perf evlist: Add evlist__add_dummy_on_all_cpus()

On Wed, May 11, 2022 at 9:33 PM Adrian Hunter <adrian.hunter@...el.com> wrote:
>
> On 12/05/22 01:50, Namhyung Kim wrote:
> > On Wed, May 11, 2022 at 12:02 AM Adrian Hunter <adrian.hunter@...el.com> wrote:
> >>
> >> Add evlist__add_dummy_on_all_cpus() to enable creating a system-wide dummy
> >> event that sets up the system-wide maps before map propagation.
> >>
> >> For convenience, add evlist__add_aux_dummy() so that the logic can be used
> >> whether or not the event needs to be system-wide.
> >>
> >> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
> >> ---
> >>
> >> Changes in V3: Amended comment about all CPUs.
> >>
> >>  tools/perf/util/evlist.c | 45 ++++++++++++++++++++++++++++++++++++++++
> >>  tools/perf/util/evlist.h |  5 +++++
> >>  2 files changed, 50 insertions(+)
> >>
> >> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> >> index 78c47cbafbc2..2b2900434bba 100644
> >> --- a/tools/perf/util/evlist.c
> >> +++ b/tools/perf/util/evlist.c
> >> @@ -264,6 +264,51 @@ int evlist__add_dummy(struct evlist *evlist)
> >>         return 0;
> >>  }
> >>
> >> +static void evlist__add_on_all_cpus(struct evlist *evlist, struct evsel *evsel)
> >> +{
> >> +       evsel->core.system_wide = true;
> >> +
> >> +       /*
> >> +        * All CPUs.
> >> +        *
> >> +        * Note perf_event_open() does not accept CPUs that are not online, so
> >> +        * in fact this CPU list will include only all online CPUs.
> >> +        */
> >> +       perf_cpu_map__put(evsel->core.own_cpus);
> >> +       evsel->core.own_cpus = perf_cpu_map__new(NULL);
> >> +       perf_cpu_map__put(evsel->core.cpus);
> >> +       evsel->core.cpus = perf_cpu_map__get(evsel->core.own_cpus);
> >
> > Maybe I'm missing something.. Wouldn't it be overwritten
> > by the user requested cpus during map propagation in
> > evlist__add()?
>
> Yes.  That gets changed in patch 22 "perf tools: Allow system-wide
> events to keep their own CPUs"

Oh, I see.  I'll take a look.

Thanks,
Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ