From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 974C5C54E58 for ; Wed, 13 Mar 2024 11:12:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o2yVQxVXB75qYo+QBprM1djsE8z+4XHRNeJZnPKOJRg=; b=vIXq8urPcI4ptX OaO1PVOWcpAHtsrMsETgX2PEsr1G0hqnHoqFJIYrHHaCB2LooufSQPg8G+tyfEfaEt3c9IlM5Sxpc 2HS85TDuDIdigLCddcdf8UIGXnubAXRncvMnrbfwcXPAtXWrgZ3wsvBcLIqLLIz96x9MH7wG/adoo 75lHAKC8r3qP8Uv2f4v/8DT5E3IF/q7mVbS8ueGJamOTs1HdUNWVpdlhYFBArasl1PLUATov/fjwI Smeyj3WSuF/UMYo5i0wUW2Nehv7idn+U811LBeWjEjsXl3X2DThsZ4ChfBrfin4dxFfu0h5Y0CAkx dj6OJyCErkJdlnwiXAFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkMWW-00000009ryI-38Ux; Wed, 13 Mar 2024 11:11:52 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkMWS-00000009ruo-3Z8M for linux-arm-kernel@lists.infradead.org; Wed, 13 Mar 2024 11:11:51 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D6B071007; Wed, 13 Mar 2024 04:12:23 -0700 (PDT) Received: from [192.168.1.100] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EE4913F73F; Wed, 13 Mar 2024 04:11:43 -0700 (PDT) Message-ID: <2ce4838e-7b5e-45ff-a78a-6363c57de5d9@arm.com> Date: Wed, 13 Mar 2024 11:11:42 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 05/10] drivers/perf: Use PERF_PMU_CAP_NO_SAMPLING consistently Content-Language: en-US To: Robin Murphy Cc: Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, linux-perf-users@vger.kernel.org, jialong.yang@shingroup.cn, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Will Deacon References: <5622df31e5f4874c2c085d1ce930f5bbad889181.1710257512.git.robin.murphy@arm.com> From: James Clark In-Reply-To: <5622df31e5f4874c2c085d1ce930f5bbad889181.1710257512.git.robin.murphy@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240313_041149_316401_398CD095 X-CRM114-Status: GOOD ( 20.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 12/03/2024 17:34, Robin Murphy wrote: > Our system PMUs fundamentally cannot support the current notion of > sampling events, so now that the core capability has been clarified, > apply it consistently and purge yet more boilerplate. > > Signed-off-by: Robin Murphy > --- > drivers/perf/alibaba_uncore_drw_pmu.c | 6 +----- > drivers/perf/amlogic/meson_ddr_pmu_core.c | 3 ++- > drivers/perf/arm-cci.c | 3 ++- > drivers/perf/arm-ccn.c | 12 +----------- > drivers/perf/arm-cmn.c | 3 ++- > drivers/perf/arm_cspmu/arm_cspmu.c | 17 ++++------------- > drivers/perf/arm_dmc620_pmu.c | 4 ++-- > drivers/perf/arm_dsu_pmu.c | 12 +----------- > drivers/perf/arm_smmuv3_pmu.c | 6 +----- > drivers/perf/cxl_pmu.c | 3 ++- > drivers/perf/dwc_pcie_pmu.c | 5 +---- > drivers/perf/fsl_imx8_ddr_perf.c | 3 ++- > drivers/perf/fsl_imx9_ddr_perf.c | 3 ++- > drivers/perf/hisilicon/hisi_pcie_pmu.c | 4 ++-- > drivers/perf/hisilicon/hisi_uncore_pmu.c | 3 ++- > drivers/perf/hisilicon/hns3_pmu.c | 4 ++-- > drivers/perf/marvell_cn10k_ddr_pmu.c | 6 +----- > drivers/perf/qcom_l2_pmu.c | 7 +------ > drivers/perf/qcom_l3_pmu.c | 7 +------ > drivers/perf/thunderx2_pmu.c | 4 ++-- > drivers/perf/xgene_pmu.c | 4 ++-- > 21 files changed, 36 insertions(+), 83 deletions(-) > [...] > > diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c > index ce26bb773a56..4114349e62dd 100644 > --- a/drivers/perf/arm-ccn.c > +++ b/drivers/perf/arm-ccn.c > @@ -713,7 +713,6 @@ static void arm_ccn_pmu_event_release(struct perf_event *event) > static int arm_ccn_pmu_event_init(struct perf_event *event) > { > struct arm_ccn *ccn; > - struct hw_perf_event *hw = &event->hw; > u32 node_xp, type, event_id; > int valid; > int i; > @@ -721,16 +720,6 @@ static int arm_ccn_pmu_event_init(struct perf_event *event) > > ccn = pmu_to_arm_ccn(event->pmu); > > - if (hw->sample_period) { > - dev_dbg(ccn->dev, "Sampling not supported!\n"); > - return -EOPNOTSUPP; > - } > - > - if (has_branch_stack(event)) { > - dev_dbg(ccn->dev, "Can't exclude execution levels!\n"); > - return -EINVAL; > - } > - [...] > diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c > index f5ea5acaf2f3..3424d165795c 100644 > --- a/drivers/perf/arm_dsu_pmu.c > +++ b/drivers/perf/arm_dsu_pmu.c > @@ -544,23 +544,12 @@ static int dsu_pmu_event_init(struct perf_event *event) > { > struct dsu_pmu *dsu_pmu = to_dsu_pmu(event->pmu); > > - /* We don't support sampling */ > - if (is_sampling_event(event)) { > - dev_dbg(dsu_pmu->pmu.dev, "Can't support sampling events\n"); > - return -EOPNOTSUPP; > - } > - > /* We cannot support task bound events */ > if (event->cpu < 0 || event->attach_state & PERF_ATTACH_TASK) { > dev_dbg(dsu_pmu->pmu.dev, "Can't support per-task counters\n"); > return -EINVAL; > } > > - if (has_branch_stack(event)) { > - dev_dbg(dsu_pmu->pmu.dev, "Can't support filtering\n"); > - return -EINVAL; > - } > - I'm assuming that this and the other has_branch_stack() check were removed because branch stacks don't actually do anything unless sampling is enabled? It's a small difference that there is now no error message if you ask for branch stacks, but it wouldn't have done anything anyway? I suppose this error message was also not applied very consistently across the different devices. James _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel