Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-23 Thread Jiri Olsa
On Tue, Sep 11, 2018 at 01:29:32PM +, Song Liu wrote: SNIP > >>> > >>> jirka > >> > >> I am not sure I am following. The pmu is disabled when we call > >> event_pmu_add(). Why do we need to read before calling pmu->add()? > >> And this is the first added dup event for this master, so we

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-23 Thread Jiri Olsa
On Tue, Sep 11, 2018 at 01:29:32PM +, Song Liu wrote: SNIP > >>> > >>> jirka > >> > >> I am not sure I am following. The pmu is disabled when we call > >> event_pmu_add(). Why do we need to read before calling pmu->add()? > >> And this is the first added dup event for this master, so we

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-11 Thread Song Liu
> On Sep 10, 2018, at 1:15 AM, Jiri Olsa wrote: > > On Thu, Aug 30, 2018 at 06:51:07PM +, Song Liu wrote: >> >> >>> On Aug 30, 2018, at 8:18 AM, Jiri Olsa wrote: >>> >>> On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: >>> >>> SNIP >>> @@ -6100,7 +6333,7 @@ static void

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-11 Thread Song Liu
> On Sep 10, 2018, at 1:15 AM, Jiri Olsa wrote: > > On Thu, Aug 30, 2018 at 06:51:07PM +, Song Liu wrote: >> >> >>> On Aug 30, 2018, at 8:18 AM, Jiri Olsa wrote: >>> >>> On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: >>> >>> SNIP >>> @@ -6100,7 +6333,7 @@ static void

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-11 Thread Song Liu
> On Sep 10, 2018, at 1:13 AM, Jiri Olsa wrote: > > On Thu, Aug 30, 2018 at 06:35:37PM +, Song Liu wrote: >> >> >>> On Aug 30, 2018, at 8:13 AM, Jiri Olsa wrote: >>> >>> On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: >>> >>> SNIP >>> +

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-11 Thread Song Liu
> On Sep 10, 2018, at 1:13 AM, Jiri Olsa wrote: > > On Thu, Aug 30, 2018 at 06:35:37PM +, Song Liu wrote: >> >> >>> On Aug 30, 2018, at 8:13 AM, Jiri Olsa wrote: >>> >>> On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: >>> >>> SNIP >>> +

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-10 Thread Jiri Olsa
On Thu, Aug 30, 2018 at 06:51:07PM +, Song Liu wrote: > > > > On Aug 30, 2018, at 8:18 AM, Jiri Olsa wrote: > > > > On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: > > > > SNIP > > > >> @@ -6100,7 +6333,7 @@ static void perf_output_read_group(struct > >> perf_output_handle

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-10 Thread Jiri Olsa
On Thu, Aug 30, 2018 at 06:51:07PM +, Song Liu wrote: > > > > On Aug 30, 2018, at 8:18 AM, Jiri Olsa wrote: > > > > On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: > > > > SNIP > > > >> @@ -6100,7 +6333,7 @@ static void perf_output_read_group(struct > >> perf_output_handle

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-10 Thread Jiri Olsa
On Thu, Aug 30, 2018 at 06:35:37PM +, Song Liu wrote: > > > > On Aug 30, 2018, at 8:13 AM, Jiri Olsa wrote: > > > > On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: > > > > SNIP > > > >> > >> + perf_event_remove_dup(event, ctx); > >>/* > >> * We can have double detach

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-10 Thread Jiri Olsa
On Thu, Aug 30, 2018 at 06:35:37PM +, Song Liu wrote: > > > > On Aug 30, 2018, at 8:13 AM, Jiri Olsa wrote: > > > > On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: > > > > SNIP > > > >> > >> + perf_event_remove_dup(event, ctx); > >>/* > >> * We can have double detach

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-30 Thread Song Liu
> On Aug 30, 2018, at 8:18 AM, Jiri Olsa wrote: > > On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: > > SNIP > >> @@ -6100,7 +6333,7 @@ static void perf_output_read_group(struct >> perf_output_handle *handle, >> >> if ((sub != event) && >>

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-30 Thread Song Liu
> On Aug 30, 2018, at 8:18 AM, Jiri Olsa wrote: > > On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: > > SNIP > >> @@ -6100,7 +6333,7 @@ static void perf_output_read_group(struct >> perf_output_handle *handle, >> >> if ((sub != event) && >>

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-30 Thread Song Liu
> On Aug 30, 2018, at 8:13 AM, Jiri Olsa wrote: > > On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: > > SNIP > >> >> +perf_event_remove_dup(event, ctx); >> /* >> * We can have double detach due to exit/hot-unplug + close. >> */ >> @@ -1982,6 +2123,92 @@

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-30 Thread Song Liu
> On Aug 30, 2018, at 8:13 AM, Jiri Olsa wrote: > > On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: > > SNIP > >> >> +perf_event_remove_dup(event, ctx); >> /* >> * We can have double detach due to exit/hot-unplug + close. >> */ >> @@ -1982,6 +2123,92 @@

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-30 Thread Jiri Olsa
On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: SNIP > @@ -6100,7 +6333,7 @@ static void perf_output_read_group(struct > perf_output_handle *handle, > > if ((sub != event) && > (sub->state == PERF_EVENT_STATE_ACTIVE)) > -

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-30 Thread Jiri Olsa
On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: SNIP > @@ -6100,7 +6333,7 @@ static void perf_output_read_group(struct > perf_output_handle *handle, > > if ((sub != event) && > (sub->state == PERF_EVENT_STATE_ACTIVE)) > -

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-30 Thread Jiri Olsa
On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: SNIP > > + perf_event_remove_dup(event, ctx); > /* >* We can have double detach due to exit/hot-unplug + close. >*/ > @@ -1982,6 +2123,92 @@ event_filter_match(struct perf_event *event) >

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-30 Thread Jiri Olsa
On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: SNIP > > + perf_event_remove_dup(event, ctx); > /* >* We can have double detach due to exit/hot-unplug + close. >*/ > @@ -1982,6 +2123,92 @@ event_filter_match(struct perf_event *event) >