Re: [RFC v2 5/7] perf: add a pmu capability for "exclusive" events

2014-06-25 Thread Alexander Shishkin
Peter Zijlstra writes: > On Wed, Jun 11, 2014 at 06:41:48PM +0300, Alexander Shishkin wrote: >> +static bool exclusive_event_ok(struct perf_event *event, >> + struct perf_event_context *ctx) >> +{ >> +struct perf_event *iter_event; >> + >> +if

Re: [RFC v2 5/7] perf: add a pmu capability for exclusive events

2014-06-25 Thread Alexander Shishkin
Peter Zijlstra pet...@infradead.org writes: On Wed, Jun 11, 2014 at 06:41:48PM +0300, Alexander Shishkin wrote: +static bool exclusive_event_ok(struct perf_event *event, + struct perf_event_context *ctx) +{ +struct perf_event *iter_event; + +if

Re: [RFC v2 5/7] perf: add a pmu capability for "exclusive" events

2014-06-24 Thread Peter Zijlstra
On Wed, Jun 11, 2014 at 06:41:48PM +0300, Alexander Shishkin wrote: > +static bool exclusive_event_ok(struct perf_event *event, > + struct perf_event_context *ctx) > +{ > + struct perf_event *iter_event; > + > + if (!(event->pmu->capabilities &

Re: [RFC v2 5/7] perf: add a pmu capability for exclusive events

2014-06-24 Thread Peter Zijlstra
On Wed, Jun 11, 2014 at 06:41:48PM +0300, Alexander Shishkin wrote: +static bool exclusive_event_ok(struct perf_event *event, + struct perf_event_context *ctx) +{ + struct perf_event *iter_event; + + if (!(event-pmu-capabilities PERF_PMU_CAP_EXCLUSIVE)) +

[RFC v2 5/7] perf: add a pmu capability for "exclusive" events

2014-06-11 Thread Alexander Shishkin
Usually, pmus that do, for example, instruction tracing, would only ever be able to have one event per task per cpu (or per perf_context). For such pmus it makes sense to disallow creating conflicting events early on, so as to provide consistent behavior for the user. This patch adds a pmu

[RFC v2 5/7] perf: add a pmu capability for exclusive events

2014-06-11 Thread Alexander Shishkin
Usually, pmus that do, for example, instruction tracing, would only ever be able to have one event per task per cpu (or per perf_context). For such pmus it makes sense to disallow creating conflicting events early on, so as to provide consistent behavior for the user. This patch adds a pmu