[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1621417919-6632-6-git-send-email-liuqi115@huawei.com>
Date: Wed, 19 May 2021 17:51:55 +0800
From: Qi Liu <liuqi115@...wei.com>
To: <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <linuxarm@...wei.com>, Andy Gross <agross@...nel.org>,
Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>
Subject: [PATCH v2 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.
Cc: Andy Gross <agross@...nel.org>
Cc: Will Deacon <will@...nel.org>
Cc: Mark Rutland <mark.rutland@....com>
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