Thread (15 messages) flat view 15 messages, 3 authors, 2021-06-02
STALE1898d

Revision v2 of 4 in this series.

Revisions (4)
  1. v1 [diff vs current]
  2. v2 current
  3. v3 [diff vs current]
  4. v4 [diff vs current]

[PATCH v2 5/9] drivers/perf: Remove redundant macro and functions in qcom_l3_pmu.c

From: Qi Liu <hidden>
Date: 2021-05-19 09:53:35
Also in: lkml
Subsystem: arm pmu profiling and debugging, arm/qualcomm mailing list, the rest · Maintainers: Will Deacon, Mark Rutland, Linus Torvalds

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

Cc: Andy Gross <agross@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Qi Liu <redacted>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help