From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754667AbbDTKQD (ORCPT ); Mon, 20 Apr 2015 06:16:03 -0400 Received: from foss.arm.com ([217.140.101.70]:44220 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754008AbbDTKP7 (ORCPT ); Mon, 20 Apr 2015 06:15:59 -0400 Date: Mon, 20 Apr 2015 11:15:53 +0100 From: Mark Rutland To: Andi Kleen Cc: Kan Liang , "acme@kernel.org" , "a.p.zijlstra@chello.nl" , "eranian@google.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V2 1/6] perf,core: allow invalid context events to be part of sw/hw groups Message-ID: <20150420101553.GE15875@leverpostej> References: <1429084576-1078-1-git-send-email-kan.liang@intel.com> <20150416163140.GA19775@leverpostej> <20150416212342.GW2366@two.firstfloor.org> <20150417094746.GA21655@leverpostej> <20150418004705.GA2366@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150418004705.GA2366@two.firstfloor.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 18, 2015 at 01:47:06AM +0100, Andi Kleen wrote: > > ... which would give you arbitrary skew, because one counter is > > free-running and the other is not (when scheduling a context in or out we stop > > the PMU) > > Everyone just reads the counter and subtracts it from > the last value they've seen. > > That's the same how any other shared free running counter work, > such as the standard timer. > > The only thing that perf needs to enforce is that the counters > are running with the same event. > > It also wouldn't work for sampling, but the uncore doesn't do > sampling anyways. If you don't care about sampling and only care about totals, then you can just open the events concurrently *without* grouping them, as I stated previously. > > From my PoV that violates group semantics, because now the events aren't > > always counting at the same time (which would be the reason I grouped > > them in the first place). > > You never use the absolute value, just differences. The differences > effectively count only when the group runs. Except that the uncore PMU is counting during the periods the CPU PMU is disabled (e.g. when it is being programmed, read, or written). There's a race there that you cannot solve given the two are indepedent agents. > > However, it is the case that you cannot offer group semantics. > > I don't think that's true. I believe that it is. I also believe it doesn't matter since you don't care about those semantics anyway. Given that you can just open independent events, which is already possible. Mark.