From: Qi Liu <liuqi115@huawei.com> To: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org> Cc: <linuxarm@huawei.com>, Shaokun Zhang <zhangshaokun@hisilicon.com>, "Will Deacon" <will@kernel.org>, Mark Rutland <mark.rutland@arm.com> Subject: [PATCH v3 2/9] drivers/perf: hisi: Simplify EVENT ATTR macro in HiSilicon PMU driver Date: Tue, 8 Jun 2021 11:33:14 +0800 [thread overview] Message-ID: <1623123201-45634-3-git-send-email-liuqi115@huawei.com> (raw) In-Reply-To: <1623123201-45634-1-git-send-email-liuqi115@huawei.com> Use common macro PMU_EVENT_ATTR_ID to simplify HISI_PMU_EVENT_ATTR. Cc: Shaokun Zhang <zhangshaokun@hisilicon.com> Cc: Will Deacon <will@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Qi Liu <liuqi115@huawei.com> --- drivers/perf/hisilicon/hisi_uncore_pmu.c | 7 +++---- drivers/perf/hisilicon/hisi_uncore_pmu.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c index 13c68b5..52e3bcb 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c @@ -43,11 +43,10 @@ EXPORT_SYMBOL_GPL(hisi_format_sysfs_show); ssize_t hisi_event_sysfs_show(struct device *dev, struct device_attribute *attr, char *page) { - struct dev_ext_attribute *eattr; - - eattr = container_of(attr, struct dev_ext_attribute, attr); + struct perf_pmu_events_attr *pmu_attr = + container_of(attr, struct perf_pmu_events_attr, attr); - return sysfs_emit(page, "config=0x%lx\n", (unsigned long)eattr->var); + return sysfs_emit(page, "config=0x%llx\n", pmu_attr->id); } EXPORT_SYMBOL_GPL(hisi_event_sysfs_show); diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h index ea9d89b..b2504d4 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.h +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h @@ -35,7 +35,7 @@ #define HISI_PMU_FORMAT_ATTR(_name, _config) \ HISI_PMU_ATTR(_name, hisi_format_sysfs_show, (void *)_config) #define HISI_PMU_EVENT_ATTR(_name, _config) \ - HISI_PMU_ATTR(_name, hisi_event_sysfs_show, (unsigned long)_config) + PMU_EVENT_ATTR_ID(_name, hisi_event_sysfs_show, _config) #define HISI_PMU_EVENT_ATTR_EXTRACTOR(name, config, hi, lo) \ static inline u32 hisi_get_##name(struct perf_event *event) \ -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: Qi Liu <liuqi115@huawei.com> To: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org> Cc: <linuxarm@huawei.com>, Shaokun Zhang <zhangshaokun@hisilicon.com>, "Will Deacon" <will@kernel.org>, Mark Rutland <mark.rutland@arm.com> Subject: [PATCH v3 2/9] drivers/perf: hisi: Simplify EVENT ATTR macro in HiSilicon PMU driver Date: Tue, 8 Jun 2021 11:33:14 +0800 [thread overview] Message-ID: <1623123201-45634-3-git-send-email-liuqi115@huawei.com> (raw) In-Reply-To: <1623123201-45634-1-git-send-email-liuqi115@huawei.com> Use common macro PMU_EVENT_ATTR_ID to simplify HISI_PMU_EVENT_ATTR. Cc: Shaokun Zhang <zhangshaokun@hisilicon.com> Cc: Will Deacon <will@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Qi Liu <liuqi115@huawei.com> --- drivers/perf/hisilicon/hisi_uncore_pmu.c | 7 +++---- drivers/perf/hisilicon/hisi_uncore_pmu.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c index 13c68b5..52e3bcb 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c @@ -43,11 +43,10 @@ EXPORT_SYMBOL_GPL(hisi_format_sysfs_show); ssize_t hisi_event_sysfs_show(struct device *dev, struct device_attribute *attr, char *page) { - struct dev_ext_attribute *eattr; - - eattr = container_of(attr, struct dev_ext_attribute, attr); + struct perf_pmu_events_attr *pmu_attr = + container_of(attr, struct perf_pmu_events_attr, attr); - return sysfs_emit(page, "config=0x%lx\n", (unsigned long)eattr->var); + return sysfs_emit(page, "config=0x%llx\n", pmu_attr->id); } EXPORT_SYMBOL_GPL(hisi_event_sysfs_show); diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h index ea9d89b..b2504d4 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.h +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h @@ -35,7 +35,7 @@ #define HISI_PMU_FORMAT_ATTR(_name, _config) \ HISI_PMU_ATTR(_name, hisi_format_sysfs_show, (void *)_config) #define HISI_PMU_EVENT_ATTR(_name, _config) \ - HISI_PMU_ATTR(_name, hisi_event_sysfs_show, (unsigned long)_config) + PMU_EVENT_ATTR_ID(_name, hisi_event_sysfs_show, _config) #define HISI_PMU_EVENT_ATTR_EXTRACTOR(name, config, hi, lo) \ static inline u32 hisi_get_##name(struct perf_event *event) \ -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-06-08 3:33 UTC|newest] Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-08 3:33 [PATCH v3 0/9] drivers/perf: Use general macro to simplify event attributes Qi Liu 2021-06-08 3:33 ` Qi Liu 2021-06-08 3:33 ` [PATCH v3 1/9] perf: Add EVENT_ATTR_ID " Qi Liu 2021-06-08 3:33 ` Qi Liu 2021-06-08 3:33 ` Qi Liu [this message] 2021-06-08 3:33 ` [PATCH v3 2/9] drivers/perf: hisi: Simplify EVENT ATTR macro in HiSilicon PMU driver Qi Liu 2021-06-08 3:33 ` [PATCH v3 3/9] drivers/perf: Simplify EVENT ATTR macro in SMMU " Qi Liu 2021-06-08 3:33 ` Qi Liu 2021-06-08 3:33 ` [PATCH v3 4/9] drivers/perf: Simplify EVENT ATTR macro in qcom_l2_pmu.c Qi Liu 2021-06-08 3:33 ` Qi Liu 2021-06-08 3:33 ` [PATCH v3 5/9] drivers/perf: Simplify EVENT ATTR macro in qcom_l3_pmu.c Qi Liu 2021-06-08 3:33 ` Qi Liu 2021-06-08 3:33 ` [PATCH v3 6/9] drivers/perf: Simplify EVENT ATTR macro in xgene_pmu.c Qi Liu 2021-06-08 3:33 ` Qi Liu 2021-06-08 3:33 ` [PATCH v3 7/9] drivers/perf: Simplify EVENT ATTR macro in fsl_imx8_ddr_perf.c Qi Liu 2021-06-08 3:33 ` Qi Liu 2021-06-08 3:33 ` [PATCH v3 8/9] drivers/perf: Simpilfy EVENT ATTR macro in arm_dsu_pmu.c Qi Liu 2021-06-08 3:33 ` Qi Liu 2021-06-08 8:52 ` Will Deacon 2021-06-08 8:52 ` Will Deacon 2021-06-09 1:26 ` liuqi (BA) 2021-06-09 1:26 ` liuqi (BA) 2021-06-08 3:33 ` [PATCH v3 9/9] arm64: perf: Simplify EVENT ATTR macro in perf_event.c Qi Liu 2021-06-08 3:33 ` Qi Liu 2021-06-08 6:07 ` [PATCH v3 0/9] drivers/perf: Use general macro to simplify event attributes liuqi (BA) 2021-06-08 6:07 ` liuqi (BA)
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=1623123201-45634-3-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 \ --cc=zhangshaokun@hisilicon.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.