Thread (8 messages) read the whole thread 8 messages, 2 authors, 2d ago

Re: [PATCH v2 1/5] perf/arm-cmn: Rename filter variables for clarity

From: Robin Murphy <robin.murphy@arm.com>
Date: 2026-07-29 18:39:47
Also in: linux-perf-users

On 29/07/2026 6:20 pm, Jonathan Cameron wrote:
On Tue, 28 Jul 2026 16:59:21 +0100
Robin Murphy [off-list ref] wrote:
quoted
CMN has already grown many more event-specific filters than the original
Occupancy ID, but since they are all independent of each other we've
just overloaded them onto the same name. Before we add yet more, and
they begin to overlap, rename all our "occupid" variables to "filter" so
that things can be a bit clearer and more consistent (but leaving the
format attribute itself, to avoid UAPI concerns).
Hi Robin,

Drive by review... I'm a bit confused.
The print out change isn't a ABI change?  I'd at least mention what changes
around that in the commit message.

Jonathan
quoted
Reviewed-by: Ilkka Koskinen <redacted>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---

v2: No change

  drivers/perf/arm-cmn.c | 53 ++++++++++++++++++++++--------------------
  1 file changed, 28 insertions(+), 25 deletions(-)
diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 50402bc4a21d..2a8a67da72c3 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
...
quoted
@@ -709,8 +709,8 @@ static ssize_t arm_cmn_event_show(struct device *dev,
  				  eattr->type, eattr->eventid);
  
  	if (eattr->fsel > SEL_NONE)
-		return sysfs_emit(buf, "type=0x%x,eventid=0x%x,occupid=0x%x\n",
-				  eattr->type, eattr->eventid, eattr->occupid);
+		return sysfs_emit(buf, "type=0x%x,eventid=0x%x,filter=0x%x\n",
+				  eattr->type, eattr->eventid, eattr->filter);
Changing the format of this smells like ABI change to me.
This is not a change per the event alias ABI itself[1], since that 
contract is only that these aliases may contain *some* symbolic terms 
which are to be dynamically resolved from the corresponding "format" 
attributes. Both the "occupid" and "filter" format names yield the same 
result, so tools simply parsing the sysfs aliases from scratch as 
intended are entirely unaffected.

The potential UAPI concern alluded to is between *those* tools and any 
higher-level scripts driving them - if those scripts contain 
already-copied or manually-generated event specifiers using an 
"occupid=" term then they would start failing if perf tool (or 
equivalent) could no longer resolve the "occupid" format. Thus although 
we're free to stop referring to it from our own event aliases, we can't 
just remove the old format name altogether. Because unfortunately, such 
scripts definitely do exist[2].

Anyone who was reading the sysfs event attributes expecting to see 
something they already know would have missed the point of the whole 
mechanism so hard I wouldn't even know what to say...

Thanks,
Robin.

[1] i.e. Documentation/ABI/testing/sysfs-bus-event_source-devices-events
[2] 
https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/blob/main/tools/topdown_tool/topdown_tool/cmn_probe/common.py?ref_type=heads#L311
quoted
  
  	return sysfs_emit(buf, "type=0x%x,eventid=0x%x\n", eattr->type,
  			  eattr->eventid);
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help