linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Qi Liu <liuqi115@huawei.com>
To: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Cc: <linuxarm@huawei.com>, Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Subject: [PATCH v2 3/9] drivers/perf: Remove redundant macro and functions in SMMU PMU driver
Date: Wed, 19 May 2021 17:51:53 +0800	[thread overview]
Message-ID: <1621417919-6632-4-git-send-email-liuqi115@huawei.com> (raw)
In-Reply-To: <1621417919-6632-1-git-send-email-liuqi115@huawei.com>

Remove SMMU_EVENT_ATTR and smmu_event_sysfs_show(), as there is
a general function for this.

Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/perf/arm_smmuv3_pmu.c | 33 ++++++++-------------------------
 1 file changed, 8 insertions(+), 25 deletions(-)

diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
index ff6fab4..9d745a1 100644
--- a/drivers/perf/arm_smmuv3_pmu.c
+++ b/drivers/perf/arm_smmuv3_pmu.c
@@ -498,32 +498,15 @@ static const struct attribute_group smmu_pmu_cpumask_group = {
 };
 
 /* Events */
-
-static ssize_t smmu_pmu_event_show(struct device *dev,
-				   struct device_attribute *attr, char *page)
-{
-	struct perf_pmu_events_attr *pmu_attr;
-
-	pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr);
-
-	return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id);
-}
-
-#define SMMU_EVENT_ATTR(name, config)					\
-	(&((struct perf_pmu_events_attr) {				\
-		.attr = __ATTR(name, 0444, smmu_pmu_event_show, NULL),	\
-		.id = config,						\
-	}).attr.attr)
-
 static struct attribute *smmu_pmu_events[] = {
-	SMMU_EVENT_ATTR(cycles, 0),
-	SMMU_EVENT_ATTR(transaction, 1),
-	SMMU_EVENT_ATTR(tlb_miss, 2),
-	SMMU_EVENT_ATTR(config_cache_miss, 3),
-	SMMU_EVENT_ATTR(trans_table_walk_access, 4),
-	SMMU_EVENT_ATTR(config_struct_access, 5),
-	SMMU_EVENT_ATTR(pcie_ats_trans_rq, 6),
-	SMMU_EVENT_ATTR(pcie_ats_trans_passed, 7),
+	PMU_EVENT_ATTR_ID(cycles, 0),
+	PMU_EVENT_ATTR_ID(transaction, 1),
+	PMU_EVENT_ATTR_ID(tlb_miss, 2),
+	PMU_EVENT_ATTR_ID(config_cache_miss, 3),
+	PMU_EVENT_ATTR_ID(trans_table_walk_access, 4),
+	PMU_EVENT_ATTR_ID(config_struct_access, 5),
+	PMU_EVENT_ATTR_ID(pcie_ats_trans_rq, 6),
+	PMU_EVENT_ATTR_ID(pcie_ats_trans_passed, 7),
 	NULL
 };
 
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-05-19  9:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19  9:51 [PATCH v2 0/9] drivers/perf: Use general macro to simplify event attributes Qi Liu
2021-05-19  9:51 ` [PATCH v2 1/9] perf: Add EVENT_ATTR_ID " Qi Liu
2021-06-01 13:10   ` Will Deacon
2021-06-02  8:45     ` liuqi (BA)
2021-06-02  9:49       ` Will Deacon
2021-06-02 10:49         ` liuqi (BA)
2021-05-19  9:51 ` [PATCH v2 2/9] drivers/perf: hisi: Remove redundant macro and functions Qi Liu
2021-05-19  9:51 ` Qi Liu [this message]
2021-05-19  9:51 ` [PATCH v2 4/9] drivers/perf: Remove redundant macro and functions in qcom_l2_pmu.c Qi Liu
2021-05-19  9:51 ` [PATCH v2 5/9] drivers/perf: Remove redundant macro and functions in qcom_l3_pmu.c Qi Liu
2021-05-19  9:51 ` [PATCH v2 6/9] drivers/perf: Remove redundant macro and functions in xgene_pmu.c Qi Liu
2021-05-19  9:51 ` [PATCH v2 7/9] drivers/perf: Remove redundant macro and functions in fsl_imx8_ddr_perf.c Qi Liu
2021-05-19 14:36   ` Frank Li
2021-05-19  9:51 ` [PATCH v2 8/9] drivers/perf: Remove redundant macro and functions in arm_dsu_pmu.c Qi Liu
2021-05-19  9:51 ` [PATCH v2 9/9] arm64: perf: Remove redundant macro and functions in perf_event.c Qi Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1621417919-6632-4-git-send-email-liuqi115@huawei.com \
    --to=liuqi115@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).