Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp7305ybl; Wed, 21 Aug 2019 13:52:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyV6JEhSg24lRR805HaDXhXrmUU68OejsGNPdcv2Z3wIx0jMpfEpV2wTEQ3eebEa+YvwqeM X-Received: by 2002:a62:e910:: with SMTP id j16mr38637237pfh.123.1566420753801; Wed, 21 Aug 2019 13:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566420753; cv=none; d=google.com; s=arc-20160816; b=mk6/qlL6KhJ2czkijxNb6A4DOMFKVVg2Ak7fYzHzPwvZj0jP1LXjCVGQhUXBmbbWmn qb1iOxCvrbYceZj1EFQShpbbDn/8MYIJ/+M1tX3JCKSZv+zix79WKg2/lOO8MVjEHSPS CgGnMpsQ51pPdGUR6eG2O3+iOhpRONvvGyAt77xPEiLUM4n7F3WL+ipKioHSEUnlH3PQ 5U/fU0kHhEGOdM/U6q757l4IW7gvKl66ccvQzYk5U/jF9WV/tCwvsQeHQPc+/gVR9Wec 9r7r8yu9p4nTTx1q5h/MhHmaKsA/TeWC5oQriaLOZ6Tp/USnn8Ac1/kv0icgCBBNMuJF +AeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4qF+ehTliAUgfNLUJsKpANKkAMJZ4XXEDGr3H0qWB0c=; b=lcjo69yY/Ak8Hj7beb1Q0g6IZjIzuaJV6djnpiv+M88WB/gBxg0Zd4u1jka12MF74Z XQFaEua8BMwAtq/Yy4Q6PJ3nfqGvbAnHyB0k6TvctJ6yni1CfZ45c+E8+kIp12VcBMAm zyperVmZvS9ozg9/cD70FZnDdQz3/hBtaVNwBBKdsUfU+rYCMldmt6VsnR1WUC0XGPSX qte3yDzn1+Cx1n+8O/SkMAZqNKRai5Us07+YRDO4eF8md/AsMW6o54kD+dXPVcCIzOev Oj9p4ceMtCTtR02HXQHUDI32/85oSMCvw0JC/Ey4WD6oi2OmKOR80hizVSJGuZyM9uOZ fEgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mfA3TYZ5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si11298078pls.0.2019.08.21.13.52.18; Wed, 21 Aug 2019 13:52:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mfA3TYZ5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729112AbfHUQxq (ORCPT + 99 others); Wed, 21 Aug 2019 12:53:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:34182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726696AbfHUQxp (ORCPT ); Wed, 21 Aug 2019 12:53:45 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9699122DD3; Wed, 21 Aug 2019 16:53:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566406424; bh=8EpYXOIJQ7TePwZ/ZCJnzDEkdpUgKmzzxBX02HTYDWc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mfA3TYZ5mReb6a41G+2FUsWZ4XDr3vM5MuLTd+xih2gFnd/B+p3syzRto7GLy1yCP yNbNLlyJluiuGn/UDS0ljvkiKAsdh75khbDmuBybOByPBaXAfA3M/PM56Bd93ckdf7 Uz4JeqWNifNtxOjNgPEvRWiDgS+Ymy2V+CFJCsZE= Date: Wed, 21 Aug 2019 17:53:39 +0100 From: Will Deacon To: Mark Rutland Cc: Ganapatrao Kulkarni , Ganapatrao Kulkarni , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "corbet@lwn.net" , Jayachandran Chandrasekharan Nair , Robert Richter , Jan Glauber Subject: Re: [PATCH v3 2/2] drivers/perf: Add CCPI2 PMU support in ThunderX2 UNCORE driver. Message-ID: <20190821165339.7gu4rxkvdjcr4mta@willie-the-truck> References: <1563873380-2003-1-git-send-email-gkulkarni@marvell.com> <1563873380-2003-3-git-send-email-gkulkarni@marvell.com> <20190812120125.GA50712@lakrids.cambridge.arm.com> <20190813110345.GD866@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190813110345.GD866@lakrids.cambridge.arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 13, 2019 at 12:03:45PM +0100, Mark Rutland wrote: > On Tue, Aug 13, 2019 at 04:25:15PM +0530, Ganapatrao Kulkarni wrote: > > On Mon, Aug 12, 2019 at 5:31 PM Mark Rutland wrote: > > > > > > On Tue, Jul 23, 2019 at 09:16:28AM +0000, Ganapatrao Kulkarni wrote: > > > > CCPI2 is a low-latency high-bandwidth serial interface for connecting > > > > ThunderX2 processors. This patch adds support to capture CCPI2 perf events. > > > > > > It would be worth pointing out in the commit message how the CCPI2 > > > counters differ from the others. I realise you have that in the body of > > > patch 1, but it's critical information when reviewing this patch... > > > > Ok, I will add in next version. > > > > > > > > > > > Signed-off-by: Ganapatrao Kulkarni > > > > --- > > > > drivers/perf/thunderx2_pmu.c | 248 ++++++++++++++++++++++++++++++----- > > > > 1 file changed, 214 insertions(+), 34 deletions(-) > > > > > > > > diff --git a/drivers/perf/thunderx2_pmu.c b/drivers/perf/thunderx2_pmu.c > > > > index 43d76c85da56..a4e1273eafa3 100644 > > > > --- a/drivers/perf/thunderx2_pmu.c > > > > +++ b/drivers/perf/thunderx2_pmu.c > > > > @@ -17,22 +17,31 @@ > > > > */ > > > > > > > > #define TX2_PMU_MAX_COUNTERS 4 > > > > > > Shouldn't this be 8 now? > > > > It is kept unchanged to 4(as suggested by Will), which is same for > > both L3 and DMC. > > For CCPI2 this macro is not used. > > Hmmm.... > > I disagree with that suggestion given that this also affects the > active_counters bitmap size (and thus it is not correctly sized as of > this patch), and it doesn't really save us much. > > I think it would be better to bump this to 8 and always update the > events array, even though it will be unused for CCPI2. That's less > surprising, needs fewer special-cases, and we can use the hrtimer > function pointer alone to determine if we need to do any hrtimer work. tbf, my complaint was actually about some macros applying to the whole PMU whilst others refer only to DMC/L3C and this not being apparent from the naming: https://lkml.org/lkml/2019/6/27/250 so I'm fine having TX2_PMU_DMC_L3C_MAX_COUNTERS and TX2_PMU_CCPI2_MAX_COUNTERS, but that sort of naming needs to be consistent unless the macro/definition really applies to both. That fed the suggestion that GET_EVENTID could be generic and switch on the event type internally instead of at the caller. Will