Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-11-11 Thread Rob Herring
On Wed, Nov 11, 2020 at 6:01 AM Jiri Olsa wrote: > > On Fri, Nov 06, 2020 at 03:56:11PM -0600, Rob Herring wrote: > > On Thu, Nov 5, 2020 at 4:41 PM Jiri Olsa wrote: > > > > > > On Thu, Nov 05, 2020 at 10:19:24AM -0600, Rob Herring wrote: > > > > > > SNIP > > > > > > > > > > > > > > > > > that

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-11-11 Thread Jiri Olsa
On Fri, Nov 06, 2020 at 03:56:11PM -0600, Rob Herring wrote: > On Thu, Nov 5, 2020 at 4:41 PM Jiri Olsa wrote: > > > > On Thu, Nov 05, 2020 at 10:19:24AM -0600, Rob Herring wrote: > > > > SNIP > > > > > > > > > > > > > > that maps page for each event, then perf_evsel__read > > > > > > could go

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-11-06 Thread Rob Herring
On Thu, Nov 5, 2020 at 4:41 PM Jiri Olsa wrote: > > On Thu, Nov 05, 2020 at 10:19:24AM -0600, Rob Herring wrote: > > SNIP > > > > > > > > > > > that maps page for each event, then perf_evsel__read > > > > > could go through the fast code, no? > > > > > > > > No, because we're not self-monitoring

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-11-05 Thread Jiri Olsa
On Thu, Nov 05, 2020 at 10:19:24AM -0600, Rob Herring wrote: SNIP > > > > > > > > that maps page for each event, then perf_evsel__read > > > > could go through the fast code, no? > > > > > > No, because we're not self-monitoring (pid == 0 and cpu == -1). With > > > the following change: > > > >

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-11-05 Thread Rob Herring
On Wed, Oct 21, 2020 at 6:24 AM Jiri Olsa wrote: > > On Tue, Oct 20, 2020 at 12:11:47PM -0500, Rob Herring wrote: > > SNIP > > > > > > > > > > > > > The mmapped read will actually fail and then we fallback here. My > > > > > > main > > > > > > concern though is adding more overhead on a feature

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-10-21 Thread Jiri Olsa
On Tue, Oct 20, 2020 at 12:11:47PM -0500, Rob Herring wrote: SNIP > > > > > > > > > > The mmapped read will actually fail and then we fallback here. My main > > > > > concern though is adding more overhead on a feature that's meant to be > > > > > low overhead (granted, it's not much). Maybe we

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-10-20 Thread Rob Herring
On Tue, Oct 20, 2020 at 10:35 AM Jiri Olsa wrote: > > On Tue, Oct 20, 2020 at 09:38:13AM -0500, Rob Herring wrote: > > On Mon, Oct 19, 2020 at 3:15 PM Jiri Olsa wrote: > > > > > > On Fri, Oct 16, 2020 at 04:39:15PM -0500, Rob Herring wrote: > > > > On Wed, Oct 14, 2020 at 6:05 AM Jiri Olsa

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-10-20 Thread Jiri Olsa
On Tue, Oct 20, 2020 at 09:38:13AM -0500, Rob Herring wrote: > On Mon, Oct 19, 2020 at 3:15 PM Jiri Olsa wrote: > > > > On Fri, Oct 16, 2020 at 04:39:15PM -0500, Rob Herring wrote: > > > On Wed, Oct 14, 2020 at 6:05 AM Jiri Olsa wrote: > > > > > > > > On Thu, Oct 01, 2020 at 09:01:11AM -0500,

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-10-20 Thread Rob Herring
On Mon, Oct 19, 2020 at 3:15 PM Jiri Olsa wrote: > > On Fri, Oct 16, 2020 at 04:39:15PM -0500, Rob Herring wrote: > > On Wed, Oct 14, 2020 at 6:05 AM Jiri Olsa wrote: > > > > > > On Thu, Oct 01, 2020 at 09:01:11AM -0500, Rob Herring wrote: > > > > > > SNIP > > > > > > > > > > > +void

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-10-19 Thread Jiri Olsa
On Fri, Oct 16, 2020 at 04:39:15PM -0500, Rob Herring wrote: > On Wed, Oct 14, 2020 at 6:05 AM Jiri Olsa wrote: > > > > On Thu, Oct 01, 2020 at 09:01:11AM -0500, Rob Herring wrote: > > > > SNIP > > > > > > > > +void *perf_evsel__mmap(struct perf_evsel *evsel, int pages) > > > +{ > > > + int

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-10-16 Thread Rob Herring
On Wed, Oct 14, 2020 at 6:05 AM Jiri Olsa wrote: > > On Thu, Oct 01, 2020 at 09:01:11AM -0500, Rob Herring wrote: > > SNIP > > > > > +void *perf_evsel__mmap(struct perf_evsel *evsel, int pages) > > +{ > > + int ret; > > + struct perf_mmap *map; > > + struct perf_mmap_param mp = { > >

Re: [PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-10-14 Thread Jiri Olsa
On Thu, Oct 01, 2020 at 09:01:11AM -0500, Rob Herring wrote: SNIP > > +void *perf_evsel__mmap(struct perf_evsel *evsel, int pages) > +{ > + int ret; > + struct perf_mmap *map; > + struct perf_mmap_param mp = { > + .prot = PROT_READ | PROT_WRITE, > + }; > + > +

[PATCH v4 4/9] libperf: Add libperf_evsel__mmap()

2020-10-01 Thread Rob Herring
In order to support usersapce access, an event must be mmapped. While there's already mmap support for evlist, the usecase is a bit different than the self monitoring with userspace access. So let's add a new perf_evsel__mmap() function to mmap an evsel. This allows implementing userspace access