[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200831091134.GC406859@krava>
Date: Mon, 31 Aug 2020 11:11:34 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Rob Herring <robh@...nel.org>
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-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@....com
Subject: Re: [PATCH v2 5/9] libperf: Add support for user space counter access
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
jirka
Powered by blists - more mailing lists