Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1638967lql; Wed, 13 Mar 2024 04:15:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZyPC5qrJTFRiTX05PcbjA1oM+7oxQ1mNiYh0v3GAOodMY70vNho+HNwAehnRCSNRH9XMdmyjx7AjCfuxUbgjPB0F4UjhO4dHjp7PbcA== X-Google-Smtp-Source: AGHT+IFRlximFtnK0PcK7CBXPYyyJcA6l/N59j5OM4j6CBt39/tDNlwbM9yerMzwkM3hZnuTBT/y X-Received: by 2002:a05:6358:4909:b0:17c:d10:720f with SMTP id w9-20020a056358490900b0017c0d10720fmr15811154rwn.6.1710328555006; Wed, 13 Mar 2024 04:15:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710328554; cv=pass; d=google.com; s=arc-20160816; b=Mj65fkkG23T8p70qIcTs2NuSbfZaZn6C4X1tD563U8xHNemYxPabOAJ/hWM0CHJnm6 Bsqi2OGLJFNVbLQViupQ6Te8E9qR4hSscN3vR9XAqbKimXfLm2q17665QsgjzCG5+VRd aEgPMtdQNduLi+pYUwgr5cJgN1kO6n9AMQYbFfVQyco8btW2AUN9gnNYIS6fzWd7K5EA FwUBYX7HgtXwhLBBXq2oWJjPo6s1ngdeK+RTQEJcvUhQ7hp7EHhecH6iSeDk2fPKT88Z xT6H9GIKOh1JythE9UQ+sMLg6RgIqnv/Vro4L/3j+9FkNcDw6hlq9TfscD6/D81VpAzw 9N5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=pCDacFMw5FUusHkZcbfwFTnMOYoJjfqPFuE0HlYmGB4=; fh=DTatXDGMKcgRkwRApyg5UhbusKti4JW7s3Q/7ynVJUk=; b=ZZPJDj94SIKqMtHvuWsLlEtYFMDKhc3BnhFiQ5opn+r1G+dWSHbYYTq/wX5j6pVE2y Mh6j8khkHsiOK/oFXuUIVP9cEm4wW4QgIrwQ9m0Y0pFNbpGEty4x9pZQOTMd9aqT6r7C btwebmAYN2aA0hEgUflNSepGywbpAbiae+GQMpO0b/7EwJf6EjMq0sY//AMLePEwcb7w ai56DXGQMNTwNNRBXC0rRnyFuGOzPUJPWPLr9uzaClt8JXYuCLC5WZxb9NpuUad6EV9m jz3U9a8HKI9bWcga/rPvPpB/hXTG87ESusZN7Fua2TgEUtV7yFfYvXwcCg2OlgfGv70/ EuIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-101422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101422-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d23-20020a63d717000000b005dc86450fc8si8610970pgg.515.2024.03.13.04.15.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 04:15:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-101422-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101422-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B55FCB235FB for ; Wed, 13 Mar 2024 11:12:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCC9C4502C; Wed, 13 Mar 2024 11:11:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBC6645021; Wed, 13 Mar 2024 11:11:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710328309; cv=none; b=eZ0yP06FXiUGYH6tWGL84WnV5UsGKQKcSvGGw1CB8o2YMXNuJkAY3ze6cjRjOmUEpGU39QT+dJ41ttn1e8BRJtlt88Uu1pYtx0fzrybEHEXJCtfZXgFqxeWfxSNB5bnJLzHBYDPwdnlTQBlueLmRV8Pag6TCRXQD27oxkcc9j4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710328309; c=relaxed/simple; bh=LEyXAn/v2Hw3prnwl+wVgn/JXUC8HGQ1YBXsFPPZx6c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bTExvI1qeP8VaF0JRGHz++H2/b2pn3xFppjDVD+P1QKY+Uv5Fi3lmBShUuxeOXKze0EOcqS4IaY9FJ6MmjnOgAivfe6GZd9dF8CcNP4+HtEj8XeDm5pZeNapwuDxbDOzw03vIFxG3/lkDzU9Q5YPT8y0bVArQKBZdQ9qvj9BruY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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