Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-04 Thread Mathieu Poirier
On Wed, 4 Jul 2018 at 04:35, Alexander Shishkin wrote: > > Mathieu Poirier writes: > > > On Tue, 3 Jul 2018 at 04:57, Alexander Shishkin > > wrote: > >> > >> On Tue, Jul 03, 2018 at 01:03:48PM +0300, Alexander Shishkin wrote: > >> > On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote

Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-04 Thread Alexander Shishkin
Mathieu Poirier writes: > Hi Alex, Hi Mathieu, > On Tue, 3 Jul 2018 at 04:03, Alexander Shishkin > wrote: >> >> On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: >> > This patch follows what has been done for filters by adding an ioctl() >> > option to communicate to the kernel

Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-04 Thread Alexander Shishkin
Mathieu Poirier writes: > On Tue, 3 Jul 2018 at 04:57, Alexander Shishkin > wrote: >> >> On Tue, Jul 03, 2018 at 01:03:48PM +0300, Alexander Shishkin wrote: >> > On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: >> > > +/* >> > > + * PMU driver configuration works the same way as

Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-03 Thread Mathieu Poirier
On Tue, 3 Jul 2018 at 04:57, Alexander Shishkin wrote: > > On Tue, Jul 03, 2018 at 01:03:48PM +0300, Alexander Shishkin wrote: > > On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: > > > +/* > > > + * PMU driver configuration works the same way as filter management > > > above, > >

Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-03 Thread Mathieu Poirier
On Tue, 3 Jul 2018 at 04:03, Alexander Shishkin wrote: > > On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: > > This patch follows what has been done for filters by adding an ioctl() > > option to communicate to the kernel arbitrary PMU specific configuration > > that don't fit in

Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-03 Thread Mathieu Poirier
Hi Alex, On Tue, 3 Jul 2018 at 04:03, Alexander Shishkin wrote: > > On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: > > This patch follows what has been done for filters by adding an ioctl() > > option to communicate to the kernel arbitrary PMU specific configuration > > that don

Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-03 Thread Mathieu Poirier
On Tue, 3 Jul 2018 at 07:40, Jiri Olsa wrote: > > On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: > > SNIP > > > +static int > > +perf_event_process_drv_config(struct perf_event *event, char *config_str) > > +{ > > + int ret = -EINVAL; > > + void *drv_data; > > + > > +

Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-03 Thread Jiri Olsa
On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: SNIP > + ret = 0; > +out: > + return ret; > +} > + > +static int perf_event_set_drv_config(struct perf_event *event, void __user > *arg) > +{ > + int ret = -EINVAL; > + char *config_str; > + > + config_str = str

Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-03 Thread Jiri Olsa
On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: SNIP > +static int > +perf_event_process_drv_config(struct perf_event *event, char *config_str) > +{ > + int ret = -EINVAL; > + void *drv_data; > + > + /* Make sure ctx.mutex it held */ > + lockdep_assert_held(&event

Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-03 Thread Alexander Shishkin
On Tue, Jul 03, 2018 at 01:03:48PM +0300, Alexander Shishkin wrote: > On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: > > +/* > > + * PMU driver configuration works the same way as filter management above, > > + * but without the need to deal with memory mapping. Driver configurat

Re: [PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-03 Thread Alexander Shishkin
On Mon, Jul 02, 2018 at 04:33:29PM -0600, Mathieu Poirier wrote: > This patch follows what has been done for filters by adding an ioctl() > option to communicate to the kernel arbitrary PMU specific configuration > that don't fit in the conventional struct perf_event_attr to the kernel. Ok, so wha

[PATCH 5/6] perf/core: Use ioctl to communicate driver configuration to kernel

2018-07-02 Thread Mathieu Poirier
This patch follows what has been done for filters by adding an ioctl() option to communicate to the kernel arbitrary PMU specific configuration that don't fit in the conventional struct perf_event_attr to the kernel. Signed-off-by: Mathieu Poirier --- include/linux/perf_event.h | 54 +++