Re: [PATCH 1/2] perf x86: Make intel_pmu_enable_all to enable only active events

2013-08-19 Thread Peter Zijlstra
On Mon, Aug 19, 2013 at 04:31:31PM +0200, Stephane Eranian wrote: > Yeah, I think you can have one NMI pending because it came > while you were already servicing an NMI interrupt. Though, this > is very unlikely. Yeah exceedingly rare. I'm also fairly certain I've had NMIs right after clearing EN

Re: [PATCH 1/2] perf x86: Make intel_pmu_enable_all to enable only active events

2013-08-19 Thread Stephane Eranian
Hi, On Mon, Aug 19, 2013 at 1:16 PM, Jiri Olsa wrote: > On Mon, Aug 19, 2013 at 11:16:54AM +0200, Stephane Eranian wrote: >> On Thu, Aug 15, 2013 at 3:53 PM, Andi Kleen wrote: >> >> >> >> I think its a NOP; this is the global ctrl register but >> >> intel_pmu_disable_event() writes PERFEVTSELx.E

Re: [PATCH 1/2] perf x86: Make intel_pmu_enable_all to enable only active events

2013-08-19 Thread Jiri Olsa
On Mon, Aug 19, 2013 at 11:16:54AM +0200, Stephane Eranian wrote: > On Thu, Aug 15, 2013 at 3:53 PM, Andi Kleen wrote: > >> > >> I think its a NOP; this is the global ctrl register but > >> intel_pmu_disable_event() writes PERFEVTSELx.EN = 0, so even if you > >> enable it in the global mask, the e

Re: [PATCH 1/2] perf x86: Make intel_pmu_enable_all to enable only active events

2013-08-19 Thread Stephane Eranian
On Thu, Aug 15, 2013 at 3:53 PM, Andi Kleen wrote: >> >> I think its a NOP; this is the global ctrl register but >> intel_pmu_disable_event() writes PERFEVTSELx.EN = 0, so even if you >> enable it in the global mask, the event should still be disabled. > > Yes the hardware ANDs the various enable

Re: [PATCH 1/2] perf x86: Make intel_pmu_enable_all to enable only active events

2013-08-15 Thread Andi Kleen
> > I think its a NOP; this is the global ctrl register but > intel_pmu_disable_event() writes PERFEVTSELx.EN = 0, so even if you > enable it in the global mask, the event should still be disabled. Yes the hardware ANDs the various enable bits in the different registers. -andi -- To unsubscribe

Re: [PATCH 1/2] perf x86: Make intel_pmu_enable_all to enable only active events

2013-08-15 Thread Jiri Olsa
On Thu, Aug 15, 2013 at 01:40:40PM +0200, Peter Zijlstra wrote: > On Tue, Aug 13, 2013 at 06:39:11PM +0200, Jiri Olsa wrote: > > Currently the intel_pmu_enable_all enables all possible > > events, which is not allways desired. One case (there'll > > be probably more) is: > > > > - event hits thr

Re: [PATCH 1/2] perf x86: Make intel_pmu_enable_all to enable only active events

2013-08-15 Thread Peter Zijlstra
On Tue, Aug 13, 2013 at 06:39:11PM +0200, Jiri Olsa wrote: > Currently the intel_pmu_enable_all enables all possible > events, which is not allways desired. One case (there'll > be probably more) is: > > - event hits throttling threshold > - NMI stops event > - intel_pmu_enable_all starts it

[PATCH 1/2] perf x86: Make intel_pmu_enable_all to enable only active events

2013-08-13 Thread Jiri Olsa
Currently the intel_pmu_enable_all enables all possible events, which is not allways desired. One case (there'll be probably more) is: - event hits throttling threshold - NMI stops event - intel_pmu_enable_all starts it back on the NMI exit Signed-off-by: Jiri Olsa Cc: Corey Ashford Cc: F