diff mbox series

perf/arm-cmn: Minor event type housekeeping

Message ID ef46a47fc4ab909093f14b2b4289a4835836ab6c.1738851844.git.robin.murphy@arm.com (mailing list archive)
State New
Headers show
Series perf/arm-cmn: Minor event type housekeeping | expand

Commit Message

Robin Murphy Feb. 6, 2025, 2:24 p.m. UTC
While handling RN-D nodes under the functionally-identical RN-I type
works fine for perf tool users using the "rnid_" event aliases, and that
is the documented and expected ABI, there's little reason not to be
permissive and accept the actual RN-D type as an additional encoding for
the same events as well. This may be convenient for other tooling
generating event configs directly from its own topology data.

In the RN-I event mood, it also seems as good a time as any to clean up
a forgotten macro for CCLA_RNI events which ended up being unnecessary.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/perf/arm-cmn.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Ilkka Koskinen Feb. 6, 2025, 10 p.m. UTC | #1
On Thu, 6 Feb 2025, Robin Murphy wrote:

> While handling RN-D nodes under the functionally-identical RN-I type
> works fine for perf tool users using the "rnid_" event aliases, and that
> is the documented and expected ABI, there's little reason not to be
> permissive and accept the actual RN-D type as an additional encoding for
> the same events as well. This may be convenient for other tooling
> generating event configs directly from its own topology data.
>
> In the RN-I event mood, it also seems as good a time as any to clean up
> a forgotten macro for CCLA_RNI events which ended up being unnecessary.
>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>


Looks good to me.

Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>

> ---
> drivers/perf/arm-cmn.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
> index ef959e66db7c..d4fe30ff225b 100644
> --- a/drivers/perf/arm-cmn.c
> +++ b/drivers/perf/arm-cmn.c
> @@ -802,8 +802,6 @@ static umode_t arm_cmn_event_attr_is_visible(struct kobject *kobj,
> 	CMN_EVENT_ATTR(_model, ccha_##_name, CMN_TYPE_CCHA, _event)
> #define CMN_EVENT_CCLA(_name, _event)				\
> 	CMN_EVENT_ATTR(CMN_ANY, ccla_##_name, CMN_TYPE_CCLA, _event)
> -#define CMN_EVENT_CCLA_RNI(_name, _event)				\
> -	CMN_EVENT_ATTR(CMN_ANY, ccla_rni_##_name, CMN_TYPE_CCLA_RNI, _event)
> #define CMN_EVENT_HNS(_name, _event)				\
> 	CMN_EVENT_ATTR(CMN_ANY, hns_##_name, CMN_TYPE_HNS, _event)
>
> @@ -1798,6 +1796,9 @@ static int arm_cmn_event_init(struct perf_event *event)
> 	} else if (type == CMN_TYPE_XP &&
> 		   (cmn->part == PART_CMN700 || cmn->part == PART_CMN_S3)) {
> 		hw->wide_sel = true;
> +	} else if (type == CMN_TYPE_RND) {
> +		/* Secretly permit this as an alias for "rnid" events */
> +		type = CMN_TYPE_RNI;
> 	}
>
> 	/* This is sufficiently annoying to recalculate, so cache it */
> -- 
> 2.39.2.101.g768bb238c484.dirty
>
>
>
Will Deacon March 1, 2025, 7:05 a.m. UTC | #2
On Thu, 06 Feb 2025 14:24:04 +0000, Robin Murphy wrote:
> While handling RN-D nodes under the functionally-identical RN-I type
> works fine for perf tool users using the "rnid_" event aliases, and that
> is the documented and expected ABI, there's little reason not to be
> permissive and accept the actual RN-D type as an additional encoding for
> the same events as well. This may be convenient for other tooling
> generating event configs directly from its own topology data.
> 
> [...]

Applied to will (for-next/perf), thanks!

[1/1] perf/arm-cmn: Minor event type housekeeping
      https://git.kernel.org/will/c/678a5d3d6db6

Cheers,
diff mbox series

Patch

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index ef959e66db7c..d4fe30ff225b 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -802,8 +802,6 @@  static umode_t arm_cmn_event_attr_is_visible(struct kobject *kobj,
 	CMN_EVENT_ATTR(_model, ccha_##_name, CMN_TYPE_CCHA, _event)
 #define CMN_EVENT_CCLA(_name, _event)				\
 	CMN_EVENT_ATTR(CMN_ANY, ccla_##_name, CMN_TYPE_CCLA, _event)
-#define CMN_EVENT_CCLA_RNI(_name, _event)				\
-	CMN_EVENT_ATTR(CMN_ANY, ccla_rni_##_name, CMN_TYPE_CCLA_RNI, _event)
 #define CMN_EVENT_HNS(_name, _event)				\
 	CMN_EVENT_ATTR(CMN_ANY, hns_##_name, CMN_TYPE_HNS, _event)
 
@@ -1798,6 +1796,9 @@  static int arm_cmn_event_init(struct perf_event *event)
 	} else if (type == CMN_TYPE_XP &&
 		   (cmn->part == PART_CMN700 || cmn->part == PART_CMN_S3)) {
 		hw->wide_sel = true;
+	} else if (type == CMN_TYPE_RND) {
+		/* Secretly permit this as an alias for "rnid" events */
+		type = CMN_TYPE_RNI;
 	}
 
 	/* This is sufficiently annoying to recalculate, so cache it */