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 0510AC7EE43 for ; Tue, 13 Jun 2023 01:35:07 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6oOK5NLmEPjZbWtKXVgVrU7Wwp3WV/fkPIIxtIiHDjc=; b=jLpdNtlcJLaIm8 P4JuO9MZqWojQnrf8gCsGy/+bFdCwwMzt9vrQWzZhlStq7axu/NVENTTfot11XK707FA5zyEu0Gnv /oLb22HR4x943UQFmAL2SOD/9ZB+GVXLsJ84IjSnlIiFbH8aX834YYry1ws8NMfpY9KTeyI1ni6lg +kfH8l6YisQY6F5XWuiZE7J8jG7Pn5iglpc8NXBOam6NKscmCLgYt5+OZbH3jtv7pB99vNaCCE621 aKpCQgprsYXV+FQlUZzG0zzVjGE2Zl6l/tSf66vGuWH/+OIysFWtwyWkYXssr6RAK5hk1zO/ZKo84 YoYfeTcaKfui0SyD54Fw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q8svi-006aSu-2Y; Tue, 13 Jun 2023 01:34:42 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q8svf-006aSE-1P for linux-arm-kernel@lists.infradead.org; Tue, 13 Jun 2023 01:34:41 +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 95E2A1FB; Mon, 12 Jun 2023 18:35:20 -0700 (PDT) Received: from xinvm1.shanghai.arm.com (wls-x86-hp06.shanghai.arm.com [10.169.206.130]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DB9283F5A1; Mon, 12 Jun 2023 18:34:33 -0700 (PDT) From: Xin Yang To: linux-arm-kernel@lists.infradead.org Cc: mark.rutland@arm.com, will@kernel.org, robin.murphy@arm.com, Xin Yang Subject: [PATCH] perf/arm_dmc620: Add cpumask Date: Tue, 13 Jun 2023 01:34:23 +0000 Message-Id: <20230613013423.2078397-1-xin.yang@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230612_183439_544116_7942F905 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. 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 Add a cpumask for the DMC620 PMU. As it is an uncore PMU, perf userspace tool only needs to open a single counter on the CPU specified by the CPU mask for each event on a given DMC620 device. Signed-off-by: Xin Yang --- drivers/perf/arm_dmc620_pmu.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c index 5de06f9a4dd3..9d0f01c4455a 100644 --- a/drivers/perf/arm_dmc620_pmu.c +++ b/drivers/perf/arm_dmc620_pmu.c @@ -227,9 +227,31 @@ static const struct attribute_group dmc620_pmu_format_attr_group = { .attrs = dmc620_pmu_formats_attrs, }; +static ssize_t dmc620_pmu_cpumask_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct dmc620_pmu *dmc620_pmu = to_dmc620_pmu(dev_get_drvdata(dev)); + + return cpumap_print_to_pagebuf(true, buf, + cpumask_of(dmc620_pmu->irq->cpu)); +} + +static struct device_attribute dmc620_pmu_cpumask_attr = + __ATTR(cpumask, 0444, dmc620_pmu_cpumask_show, NULL); + +static struct attribute *dmc620_pmu_cpumask_attrs[] = { + &dmc620_pmu_cpumask_attr.attr, + NULL, +}; + +static const struct attribute_group dmc620_pmu_cpumask_attr_group = { + .attrs = dmc620_pmu_cpumask_attrs, +}; + static const struct attribute_group *dmc620_pmu_attr_groups[] = { &dmc620_pmu_events_attr_group, &dmc620_pmu_format_attr_group, + &dmc620_pmu_cpumask_attr_group, NULL, }; -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel