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: <CAL_JsqLcDm-WZdByr4AYJMGD1pZ_+8RUgRvpjLhMvEgrTbq_sA@mail.gmail.com>
Date:   Wed, 2 Sep 2020 11:01:09 -0600
From:   Rob Herring <robh@...nel.org>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Will Deacon <will@...nel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Raphael Gault <raphael.gault@....com>,
        Mark Rutland <mark.rutland@....com>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Ian Rogers <irogers@...gle.com>,
        Honnappa Nagarahalli <honnappa.nagarahalli@....com>
Subject: Re: [PATCH v2 5/9] libperf: Add support for user space counter access

On Mon, Aug 31, 2020 at 3:11 AM Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Fri, Aug 28, 2020 at 02:56:10PM -0600, Rob Herring wrote:
>
> SNIP
>
> >
> > +void *perf_evsel__mmap(struct perf_evsel *evsel)
> > +{
> > +     int ret;
> > +     struct perf_mmap *map;
> > +     struct perf_mmap_param mp = {
> > +             .mask = -1,
> > +             .prot = PROT_READ | PROT_WRITE,
> > +     };
> > +
> > +     if (FD(evsel, 0, 0) < 0)
> > +             return NULL;
> > +
> > +     map = zalloc(sizeof(*map));
> > +     if (!map)
> > +             return NULL;
> > +
> > +     perf_mmap__init(map, NULL, false, NULL);
> > +
> > +     ret = perf_mmap__mmap(map, &mp, FD(evsel, 0, 0), 0);
> > +     if (ret) {
> > +             free(map);
> > +             return NULL;
> > +     }
> > +
> > +     evsel->mmap = map;
> > +     return map->base;
> > +}
>
> so this only maps first page, I think we should use different
> name and keep perf_evsel__mmap for some generic map with size
>
> perf_evsel__mmap_user
> perf_evsel__mmap_zero
> ...?
>
> not sure.. or we could add size argument

Adding a size arg is simple enough to do and saves the hard naming problem. :)

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ