lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 May 2021 15:23:44 +0800
From:   Qi Liu <liuqi115@...wei.com>
To:     <will@...nel.org>, <mark.rutland@....com>, <john.garry@...wei.com>
CC:     <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <linuxarm@...wei.com>,
        <zhangshaokun@...ilicon.com>
Subject: [PATCH 5/9] drivers/perf: Remove redundant macro and functions in qcom_l3_pmu.c

Remove L3CACHE_EVENT_ATTR and l3cache_pmu_event_show(), as there is
a general function for this.

Signed-off-by: Qi Liu <liuqi115@...wei.com>
---
 drivers/perf/qcom_l3_pmu.c | 30 +++++++-----------------------
 1 file changed, 7 insertions(+), 23 deletions(-)

diff --git a/drivers/perf/qcom_l3_pmu.c b/drivers/perf/qcom_l3_pmu.c
index bba0780..a163c9a 100644
--- a/drivers/perf/qcom_l3_pmu.c
+++ b/drivers/perf/qcom_l3_pmu.c
@@ -636,30 +636,14 @@ static const struct attribute_group qcom_l3_cache_pmu_format_group = {
 };
 
 /* events */
-
-static ssize_t l3cache_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 L3CACHE_EVENT_ATTR(_name, _id)					     \
-	(&((struct perf_pmu_events_attr[]) {				     \
-		{ .attr = __ATTR(_name, 0444, l3cache_pmu_event_show, NULL), \
-		  .id = _id, }						     \
-	})[0].attr.attr)
-
 static struct attribute *qcom_l3_cache_pmu_events[] = {
-	L3CACHE_EVENT_ATTR(cycles, L3_EVENT_CYCLES),
-	L3CACHE_EVENT_ATTR(read-hit, L3_EVENT_READ_HIT),
-	L3CACHE_EVENT_ATTR(read-miss, L3_EVENT_READ_MISS),
-	L3CACHE_EVENT_ATTR(read-hit-d-side, L3_EVENT_READ_HIT_D),
-	L3CACHE_EVENT_ATTR(read-miss-d-side, L3_EVENT_READ_MISS_D),
-	L3CACHE_EVENT_ATTR(write-hit, L3_EVENT_WRITE_HIT),
-	L3CACHE_EVENT_ATTR(write-miss, L3_EVENT_WRITE_MISS),
+	PMU_EVENT_ATTR_ID(cycles, L3_EVENT_CYCLES),
+	PMU_EVENT_ATTR_ID(read-hit, L3_EVENT_READ_HIT),
+	PMU_EVENT_ATTR_ID(read-miss, L3_EVENT_READ_MISS),
+	PMU_EVENT_ATTR_ID(read-hit-d-side, L3_EVENT_READ_HIT_D),
+	PMU_EVENT_ATTR_ID(read-miss-d-side, L3_EVENT_READ_MISS_D),
+	PMU_EVENT_ATTR_ID(write-hit, L3_EVENT_WRITE_HIT),
+	PMU_EVENT_ATTR_ID(write-miss, L3_EVENT_WRITE_MISS),
 	NULL
 };
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ