Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754151AbdHIQbF (ORCPT ); Wed, 9 Aug 2017 12:31:05 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:58327 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752795AbdHIQbC (ORCPT ); Wed, 9 Aug 2017 12:31:02 -0400 Date: Wed, 9 Aug 2017 18:30:59 +0200 From: Peter Zijlstra To: Vince Weaver Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Arnaldo Carvalho de Melo , Stephane Eranian Subject: Re: [patch] perf wrong enabled time after attach/enable/enable Message-ID: <20170809163059.zyd4sgbuylrmhq3r@hirez.programming.kicks-ass.net> References: <20170802171051.zlq5rgx3jqkkxpg7@hirez.programming.kicks-ass.net> <20170804112253.vk4rg334732f4s7x@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170804112253.vk4rg334732f4s7x@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 927 Lines: 23 On Fri, Aug 04, 2017 at 01:22:53PM +0200, Peter Zijlstra wrote: > On Thu, Aug 03, 2017 at 02:07:53PM -0400, Vince Weaver wrote: > > On Wed, 2 Aug 2017, Peter Zijlstra wrote: > > > > > Playing with that test it really is the IOC_DISABLE while STOP'ed that > > > messes things up. > > > > > > Ah.. magic.. the below seems to fix things, hopefully it doesn't break > > > anything else. > > > > yes, I've tested this and it seems to fix things. > > New version below.. is a bit different and should handle another case. > I'll try and run more tests on it, because while it _SHOULD_ not trigger > that WARN_ON_ONCE() you know how that goes.. And splat it goes.. turns out we can attach to a ctx when OFF (which makes sense, they need to live someplace too). In that case the IOC_ENABLE will again go through __perf_event_enable_time() and recompute things. I think I'll just remove the WARN_ON_ONCE(), and put in a comment.