# Re: \[PATCH\] perf\_event\_open.2: 4.9 PERF\_EVENT\_IOC\_SET\_DRV\_CONFIGS support

- From: Mathieu Poirier \<hidden\>
- Date: 2016-08-12 18:02:51 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2016/08/13329436
- Thread: https://ratatoskr.run/linux-api/2016/08/13329436/t.md

```text
On 12 August 2016 at 11:57, Vince Weaver [ref] wrote:
> On Thu, 11 Aug 2016, Mathieu Poirier wrote:
>> +.TP
>> +.BR PERF_EVENT_IOC_SET_DRV_CONFIGS " (since Linux 4.9)"
>> +This makes it possible to pass configuration parameters to PMU drivers.
>> +Configuration parameters are specific to each drivers.
>> +
>> +The argument is a pointer to the desired configuration parameters.
>
> So I gave up and read the code and I'm guessing this is what you really
> mean:
>
> .TP
> .BR PERF_EVENT_IOC_SET_DRV_CONFIGS " (since Linux 4.9)"
> Pass custom configuration paramaters to a PMU driver.
>
> The argument is a pointer to a NUL-termiated string of up to
> PAGE_SIZE in length.
> The string contains a list of comma-separated configuration options
> that will be parsed by the kernel.
> The kernel handles both singleton values as well as name/value pairs
> that are indicated with the '=' character.
> The size of the strings is limited internally to PERF_DRV_CONFIG_MAX
> (which is not visible to userspace).
>

Yes this is a very good description but in sharp contrast with what is
currently done for the ioctl() descriptors in this page.  I shied away
from writing that much based on how slim the current descriptions
were.

>
>
> some additional questions: can this ioctl be run at any time or should it
> only be run while the event is quiet?  Does the change in options take
> place immediately?

That is up to PMU drivers to decide - for CoreSight it is set only
once when trace sessions are created.  Any changes from thereon will
be ignored.

Thanks for the review.
Mathieu

>
> Vince
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```
