Skip to contentSkip to conversation

perf vendor events arm64 AmpereOneX: Drop stale BPU_FLUSH_MEM_FAULT entry

PATCH Superseded TAKANO Mitsuhiro 7 participants 14 messages Oct 21 – Nov 12

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf vendor events arm64 AmpereOneX: Drop stale BPU_FLUSH_MEM_FAULT entry

AmpereOne carried BPU_FLUSH_MEM_FAULT for EventCode 0x121 until it was renamed to GPC_FLUSH_MEM_FAULT in 10a149e4b4a9; that rename and the AmpereOneX table were patches 3 and 4 of the same series, so the new file kept the old name.

The result is a table that names the 0x121 counter twice:
ampereonex/core-imp-def.json has GPC_FLUSH_MEM_FAULT, and ampereonex/memory.json adds BPU_FLUSH_MEM_FAULT with the same code and the same description. On AmpereOneX perf therefore lists two events for one counter, one of them under a name the documentation does not use. No metric and no other file refers to either name, so removing the stale entry cannot change a metric.

It also leaves memory.json holding only the ArchStdEvent aliases the other files of that kind carry: AmpereOne's memory.json has no raw EventCode at all, and neither has any other file of the AmpereOneX set except the ones where raw codes belong.

Nothing catches this at build time. jevents.py asserts on duplicate event names, but x86 repeats an EventCode for many events because the code carries umask and unit bits (3756 times across its tables) and powerpc repeats five codes, so a duplicate-code check is not possible. arm64 is the only architecture where no table but this one repeats a code.

Not tested on hardware: there is no AmpereOneX machine here, so perf was not run against the real PMU. The change only edits a JSON table; the perf build was verified and the generated table for this PMU goes from two names for 0x121 to one (rebuilt, counted in pmu-events.c).

Fixes 16438b652b46 ("perf vendor events arm64 AmpereOneX: Add core PMU events and metrics")
Assisted-by LLM
---
 .../pmu-events/arch/arm64/ampere/ampereonex/memory.json     | 6 ------
 1 file changed, 6 deletions(-)
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json +0 -6
index 6c06bc928415..2a83782f51b0 100644
@@ -33,11 +33,5 @@
     },
     {
         "ArchStdEvent": "MEM_ACCESS_CHECKED_WR"
-    },
-    {
-        "PublicDescription": "Flushes due to memory hazards",
-        "EventCode": "0x121",
-        "EventName": "BPU_FLUSH_MEM_FAULT",
-        "BriefDescription": "Flushes due to memory hazards"
     }
 ]

base-commit: f47d223627f80cb7a1eb14c585fe6cb35de5e984

Signature · 1 line
2.53.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 13 lines

AmpereOne carried BPU_FLUSH_MEM_FAULT for EventCode 0x121 until it was renamed to GPC_FLUSH_MEM_FAULT in 10a149e4b4a9; that rename and the AmpereOneX table were patches 3 and 4 of the same series, so the new file kept the old name.

The result is a table that names the 0x121 counter twice:
ampereonex/core-imp-def.json has GPC_FLUSH_MEM_FAULT, and ampereonex/memory.json adds BPU_FLUSH_MEM_FAULT with the same code and the same description. On AmpereOneX perf therefore lists two events for one counter, one of them under a name the documentation does not use. No metric and no other file refers to either name, so removing the stale entry cannot change a metric.

Quoted 8 lines

It also leaves memory.json holding only the ArchStdEvent aliases the other files of that kind carry: AmpereOne's memory.json has no raw [ ... ]
two names for 0x121 to one (rebuilt, counted in pmu-events.c).

Fixes 16438b652b46 ("perf vendor events arm64 AmpereOneX: Add core PMU events and metrics")
Assisted-by LLM

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to TAKANO Mitsuhiro
Quoted 18 lines · TAKANO Mitsuhiro

AmpereOne carried BPU_FLUSH_MEM_FAULT for EventCode 0x121 until it was renamed to GPC_FLUSH_MEM_FAULT in 10a149e4b4a9; that rename and the AmpereOneX table were patches 3 and 4 of the same series, so the new file kept the old name.

The result is a table that names the 0x121 counter twice:
ampereonex/core-imp-def.json has GPC_FLUSH_MEM_FAULT, and ampereonex/memory.json adds BPU_FLUSH_MEM_FAULT with the same code and the same description. On AmpereOneX perf therefore lists two events for one counter, one of them under a name the documentation does not use. No metric and no other file refers to either name, so removing the stale entry cannot change a metric.

It also leaves memory.json holding only the ArchStdEvent aliases the other files of that kind carry: AmpereOne's memory.json has no raw EventCode at all, and neither has any other file of the AmpereOneX set except the ones where raw codes belong.

Quoted 6 lines

Nothing catches this at build time. jevents.py asserts on duplicate event names, but x86 repeats an EventCode for many events because the code carries umask and unit bits (3756 times across its tables) and powerpc repeats five codes, so a duplicate-code check is not possible. arm64 is the only architecture where no table but this one repeats a code.

Maybe a followup improvement to jevents.py?

Quoted 4 lines

Not tested on hardware: there is no AmpereOneX machine here, so perf was not run against the real PMU. The change only edits a JSON table; the perf build was verified and the generated table for this PMU goes from two names for 0x121 to one (rebuilt, counted in pmu-events.c).

Ilkka, can I have your Reviewed-by or Acked-by?

Thanks,

- Arnaldo

Quoted 27 lines
Fixes 16438b652b46 ("perf vendor events arm64 AmpereOneX: Add core PMU events and metrics")
Assisted-by LLM
---
 .../pmu-events/arch/arm64/ampere/ampereonex/memory.json     | 6 ------
 1 file changed, 6 deletions(-)
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json +0 -6
index 6c06bc928415..2a83782f51b0 100644
@@ -33,11 +33,5 @@
     },
     {
         "ArchStdEvent": "MEM_ACCESS_CHECKED_WR"
-    },
-    {
-        "PublicDescription": "Flushes due to memory hazards",
-        "EventCode": "0x121",
-        "EventName": "BPU_FLUSH_MEM_FAULT",
-        "BriefDescription": "Flushes due to memory hazards"
     }
 ]

base-commit: f47d223627f80cb7a1eb14c585fe6cb35de5e984

Signature · 1 line
2.53.0
reviewer
#3 lore raw
Quoted 20 lines · Arnaldo Carvalho de Melo
Quoted 17 lines · TAKANO Mitsuhiro

AmpereOne carried BPU_FLUSH_MEM_FAULT for EventCode 0x121 until it was renamed to GPC_FLUSH_MEM_FAULT in 10a149e4b4a9; that rename and the AmpereOneX table were patches 3 and 4 of the same series, so the new file kept the old name.

The result is a table that names the 0x121 counter twice:
ampereonex/core-imp-def.json has GPC_FLUSH_MEM_FAULT, and ampereonex/memory.json adds BPU_FLUSH_MEM_FAULT with the same code and the same description. On AmpereOneX perf therefore lists two events for one counter, one of them under a name the documentation does not use. No metric and no other file refers to either name, so removing the stale entry cannot change a metric.

It also leaves memory.json holding only the ArchStdEvent aliases the other files of that kind carry: AmpereOne's memory.json has no raw EventCode at all, and neither has any other file of the AmpereOneX set except the ones where raw codes belong.

Quoted 8 lines
Quoted 6 lines

Nothing catches this at build time. jevents.py asserts on duplicate event names, but x86 repeats an EventCode for many events because the code carries umask and unit bits (3756 times across its tables) and powerpc repeats five codes, so a duplicate-code check is not possible. arm64 is the only architecture where no table but this one repeats a code.

Maybe a followup improvement to jevents.py?

It is expected that events may share an event code but they may be differentiated by unit masks, filters, etc. We might have identical encodings even with these extra differentiators, due to old and new event names.

Quoted 6 lines
Quoted 4 lines

Not tested on hardware: there is no AmpereOneX machine here, so perf was not run against the real PMU. The change only edits a JSON table; the perf build was verified and the generated table for this PMU goes from two names for 0x121 to one (rebuilt, counted in pmu-events.c).

Ilkka, can I have your Reviewed-by or Acked-by?

An alternative to deleting the event is to add:
"Deprecated": "1",
as that makes the event not show up in perf list. Using Deprecated means that anyone using the event name won't be broken by this change.

Thanks,
Ian

#4 lore raw
Quoted 41 lines · Ian Rogers
Quoted 20 lines · Arnaldo Carvalho de Melo
Quoted 17 lines · TAKANO Mitsuhiro

AmpereOne carried BPU_FLUSH_MEM_FAULT for EventCode 0x121 until it was renamed to GPC_FLUSH_MEM_FAULT in 10a149e4b4a9; that rename and the AmpereOneX table were patches 3 and 4 of the same series, so the new file kept the old name.

The result is a table that names the 0x121 counter twice:
ampereonex/core-imp-def.json has GPC_FLUSH_MEM_FAULT, and ampereonex/memory.json adds BPU_FLUSH_MEM_FAULT with the same code and the same description. On AmpereOneX perf therefore lists two events for one counter, one of them under a name the documentation does not use. No metric and no other file refers to either name, so removing the stale entry cannot change a metric.

It also leaves memory.json holding only the ArchStdEvent aliases the other files of that kind carry: AmpereOne's memory.json has no raw EventCode at all, and neither has any other file of the AmpereOneX set except the ones where raw codes belong.

Quoted 8 lines
Quoted 6 lines

Nothing catches this at build time. jevents.py asserts on duplicate event names, but x86 repeats an EventCode for many events because the code carries umask and unit bits (3756 times across its tables) and powerpc repeats five codes, so a duplicate-code check is not possible. arm64 is the only architecture where no table but this one repeats a code.

Maybe a followup improvement to jevents.py?

It is expected that events may share an event code but they may be differentiated by unit masks, filters, etc. We might have identical encodings even with these extra differentiators, due to old and new event names.

Quoted 5 lines
Quoted 4 lines

Not tested on hardware: there is no AmpereOneX machine here, so perf was not run against the real PMU. The change only edits a JSON table; the perf build was verified and the generated table for this PMU goes from two names for 0x121 to one (rebuilt, counted in pmu-events.c).

Quoted 6 lines
Quoted 1 line

Ilkka, can I have your Reviewed-by or Acked-by?

An alternative to deleting the event is to add:
"Deprecated": "1",
as that makes the event not show up in perf list. Using Deprecated means that anyone using the event name won't be broken by this change.

Sorry, I somehow missed the original email.

Takano, thanks for the patch!

That seems like a bug I made, when I tried to address the specification change. I'm fine with either option, taking the patch or set the event to "Deprecated".

Cheers, Ilkka

#5 lore raw
In reply to Ian Rogers

Hi Ian,

Agreed, and v2 is in this thread: the entry stays and is marked deprecated, with the description worded the way the x86 tables word it, so perf list shows the counter once and a script that names BPU_FLUSH_MEM_FAULT keeps working.

Ilkka, your Acked-by is on v2 as well, since you said either option was fine -- say so and I will drop it rather than have it look like you acked a diff you did not read.

On Arnaldo's jevents.py question: a general duplicate-EventCode check is not possible for the reasons you gave. Across the 1463 raw EventCode entries under arch/arm64 this is the only duplicated code, so a check limited to those tables would flag this and nothing else in the tree today. I can send that separately if it is thought worth having.

Thanks,
Mitsuhiro

#6 lore raw

Hi Mitsuhiro,

Quoted 10 lines · TAKANO Mitsuhiro

Hi Ian,

Agreed, and v2 is in this thread: the entry stays and is marked deprecated, with the description worded the way the x86 tables word it, so perf list shows the counter once and a script that names BPU_FLUSH_MEM_FAULT keeps working.

Ilkka, your Acked-by is on v2 as well, since you said either option was fine -- say so and I will drop it rather than have it look like you acked a diff you did not read.

You can add Acked-by to v2 as well if you just add the Deprecated line. I tested both the versions quickly and they work as expected.

Cheers, Ilkka

Quoted 11 lines

On Arnaldo's jevents.py question: a general duplicate-EventCode check is not possible for the reasons you gave. Across the 1463 raw EventCode entries under arch/arm64 this is the only duplicated code, so a check limited to those tables would flag this and nothing else in the tree today. I can send that separately if it is thought worth having.

Thanks,
Mitsuhiro

#7 lore raw

PATCH v2 1/1 perf vendor events arm64 AmpereOneX: Deprecate BPU_FLUSH_MEM_FAULT

AmpereOne named event 0x121 BPU_FLUSH_MEM_FAULT until
commit 10a149e4b4a9 ("perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT") renamed it. The next patch in that series, 16438b652b46, added the AmpereOneX tables with the old name in memory.json, so 0x121 carries two names: GPC_FLUSH_MEM_FAULT in core-imp-def.json and BPU_FLUSH_MEM_FAULT in memory.json, and the default perf list output shows both. The old name has been in every release since v6.8, so deleting it would break scripts that use it.

Mark the entry deprecated instead of deleting it, as Ian Rogers asked:
perf list then shows 0x121 once while those scripts keep working. The x86 tables use the same wording, and
commit eda39f98bbc5 ("perf vendor events amd: Reintroduce deprecated Zen 5 core events") brought back deprecated AMD events for the same reason. The flag is only read when listing; the entry still registers event=0x121, so perf stat -e bpu_flush_mem_fault resolves as before, and regenerating the tables changes nothing but that flag.
perf list --deprecated still prints the name in the text output; the JSON path does not consult the flag, so perf list -j cannot show it. No metric expression and no other file refers to either name.

The duplicate came in because jevents checks repeated names, not event codes, and one encoding carrying several names is legitimate, so nothing is added for that here. No AmpereOneX machine was available, so the listing was not run on hardware; Ilkka Koskinen, who added both tables, tried v1 and v2 and reports that they behave as expected, and his Acked-by is for this variant. The JSON edit and this changelog were written with an LLM assistant, Hermes Agent, working from the code and the thread; the checks above were run here.

---
v2: keep the entry and mark it deprecated instead of deleting it,
as Ian Rogers suggested, and word both descriptions the way the x86 tables do. Ilkka Koskinen Acked-by v1 and asked for it to be carried over to v2; the description wording was added on top of that, as said in this thread.
v1: https://lore.kernel.org/[email protected]

 .../perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json +3 -2
index 6c06bc928415..114f95e41e0d 100644
@@ -35,9 +35,10 @@
         "ArchStdEvent": "MEM_ACCESS_CHECKED_WR"
     },
     {
-        "PublicDescription": "Flushes due to memory hazards",
+        "PublicDescription": "This event is deprecated. Refer to new event GPC_FLUSH_MEM_FAULT Flushes due to memory hazards",
         "EventCode": "0x121",
         "EventName": "BPU_FLUSH_MEM_FAULT",
-        "BriefDescription": "Flushes due to memory hazards"
+        "BriefDescription": "This event is deprecated. Refer to new event GPC_FLUSH_MEM_FAULT",
+        "Deprecated": "1"
     }
 ]

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4

Signature · 1 line
2.53.0
#8 lore raw

Re: [PATCH v2] perf vendor events arm64 AmpereOneX: Deprecate BPU_FLUSH_MEM_FAULT

Sashiko has reviewed this patch and found no issues.
Quoted 15 lines

AmpereOne named event 0x121 BPU_FLUSH_MEM_FAULT until
commit 10a149e4b4a9 ("perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT") renamed it. The next patch in that series, 16438b652b46, added the AmpereOneX tables with the old name in memory.json, so 0x121 carries two names: GPC_FLUSH_MEM_FAULT in core-imp-def.json and BPU_FLUSH_MEM_FAULT in memory.json, and the default perf list output shows both. The old name has been in every release since v6.8, so deleting it would break scripts that use it.

Mark the entry deprecated instead of deleting it, as Ian Rogers asked:
perf list then shows 0x121 once while those scripts keep working. The x86 tables use the same wording, and
commit eda39f98bbc5 ("perf vendor events amd: Reintroduce deprecated Zen 5 core events") brought back deprecated AMD events for the same reason. The flag is only read when listing; the entry still registers

Quoted 6 lines

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
reviewer Reviewed-by on v2 1/1
#9 lore raw

Re: [PATCH v2] perf vendor events arm64 AmpereOneX: Deprecate BPU_FLUSH_MEM_FAULT

In reply to TAKANO Mitsuhiro
Quoted 53 lines · TAKANO Mitsuhiro

AmpereOne named event 0x121 BPU_FLUSH_MEM_FAULT until
commit 10a149e4b4a9 ("perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT") renamed it. The next patch in that series, 16438b652b46, added the AmpereOneX tables with the old name in memory.json, so 0x121 carries two names: GPC_FLUSH_MEM_FAULT in core-imp-def.json and BPU_FLUSH_MEM_FAULT in memory.json, and the default perf list output shows both. The old name has been in every release since v6.8, so deleting it would break scripts that use it.

Mark the entry deprecated instead of deleting it, as Ian Rogers asked:
perf list then shows 0x121 once while those scripts keep working. The x86 tables use the same wording, and
commit eda39f98bbc5 ("perf vendor events amd: Reintroduce deprecated Zen 5 core events") brought back deprecated AMD events for the same reason. The flag is only read when listing; the entry still registers event=0x121, so perf stat -e bpu_flush_mem_fault resolves as before, and regenerating the tables changes nothing but that flag.
perf list --deprecated still prints the name in the text output; the JSON path does not consult the flag, so perf list -j cannot show it. No metric expression and no other file refers to either name.

The duplicate came in because jevents checks repeated names, not event codes, and one encoding carrying several names is legitimate, so nothing is added for that here. No AmpereOneX machine was available, so the listing was not run on hardware; Ilkka Koskinen, who added both tables, tried v1 and v2 and reports that they behave as expected, and his Acked-by is for this variant. The JSON edit and this changelog were written with an LLM assistant, Hermes Agent, working from the code and the thread; the checks above were run here.

---
v2: keep the entry and mark it deprecated instead of deleting it,
as Ian Rogers suggested, and word both descriptions the way the x86 tables do. Ilkka Koskinen Acked-by v1 and asked for it to be carried over to v2; the description wording was added on top of that, as said in this thread.
v1: https://lore.kernel.org/[email protected]

  .../perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json +0 -0
index 6c06bc928415..114f95e41e0d 100644

tools/perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json line 38

Quoted 5 lines
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json +1 -1
@@ -35,9 +35,10 @@
          "ArchStdEvent": "MEM_ACCESS_CHECKED_WR"
      },
      {
-        "PublicDescription": "Flushes due to memory hazards",
+        "PublicDescription": "This event is deprecated. Refer to new event GPC_FLUSH_MEM_FAULT Flushes due to memory hazards",

Extremely minor nit, but there should be a full stop before 'Flushes'. But if marking it deprecated makes it not show in Perf list, then it doesn't make a difference.

Quoted 9 lines
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json +2 -1
          "EventCode": "0x121",
          "EventName": "BPU_FLUSH_MEM_FAULT",
-        "BriefDescription": "Flushes due to memory hazards"
+        "BriefDescription": "This event is deprecated. Refer to new event GPC_FLUSH_MEM_FAULT",
+        "Deprecated": "1"
      }
  ]

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4

#10 lore raw

Re: [PATCH v2] perf vendor events arm64 AmpereOneX: Deprecate BPU_FLUSH_MEM_FAULT

Sorry, the trail is confusing and that is my fault. The single "[PATCH] perf jevents: Check the JSON keys that jevents.py never reads" from 11/10 was version 1 of this check; v3 turned it into a series and v5 replaced the check with the fixed list, so the title of the single patch no longer matched the series. The current one is v6:

https://lore.kernel.org/linux-perf-users/[email protected]/

You are right that it is ten lines, so here it is, as it would be posted. It reports 19 keys in four tables on today's tree and exits 1; with the two typo fixes that are already in perf-tools it exits 0:

#!/usr/bin/env python3
import json, sys
from pathlib import Path

KEYS = {
'AggregationMode', 'AnyThread', 'ArchStdEvent', 'BriefDescription', 'Compat', 'ConfigCode', 'Counter', 'CounterMask', 'CountersNumFixed', 'CountersNumGeneric', 'Data_LA', 'DefaultMetricgroupName', 'DefaultShowEvents', 'Deprecated', 'EdgeDetect', 'EnAllCores', 'EnAllSlices', 'Errata', 'EventCode', 'EventidCode',
'EventName', 'Experimental', 'ExtSel', 'FCMask',
'Filter', 'Invert', 'LegacyCacheCode', 'LegacyConfigCode', 'MetricConstraint', 'MetricExpr', 'MetricGroup', 'MetricgroupNoGroup', 'MetricName', 'MetricThreshold', 'MSRIndex', 'MSRValue', 'NodeType', 'PEBS', 'PerPkg', 'PortMask',
'PublicDescription', 'RdWrMask', 'RetirementLatencyMax', 'RetirementLatencyMean', 'RetirementLatencyMin', 'SampleAfterValue', 'ScaleUnit', 'SliceId', 'ThreadMask', 'UMask', 'Unit',
}

def main(root):

    bad = 0
    for path in sorted(Path(root).rglob('*.json')):
        if path.name.endswith('metricgroups.json'):
            continue
        for obj in json.loads(path.read_text()):
            if extra := set(obj) - KEYS:
                print(f'{path}: {sorted(extra)}')
                bad += 1
    return 1 if bad else 0

if __name__ == '__main__':

    sys.exit(main(sys.argv[1]))

Two lines are not obvious and are the reason the posted version looks bigger. The metricgroups.json files hold a dictionary keyed by group name, so the filename has to be skipped or every character of every group name is reported. And without the path in the output a report over 1019 tables cannot be acted on, which is why the posted one carries the object too.

I will post this as v7 with the list above, as a perf test, and drop the Makefile target and the shell test. The other two patches in the series are independent of the check: patch 2 makes the model argument optional, patch 1 names the metric and the file when a MetricExpr is missing.

TAKANO

#11 lore raw

PATCH v3 1/1 perf vendor events arm64 AmpereOneX: Deprecate BPU_FLUSH_MEM_FAULT

In reply to TAKANO Mitsuhiro

AmpereOne named event 0x121 BPU_FLUSH_MEM_FAULT until
commit 10a149e4b4a9 ("perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT") renamed it. The next patch in that series, 16438b652b46, added the AmpereOneX tables with the old name in memory.json, so 0x121 carries two names: GPC_FLUSH_MEM_FAULT in core-imp-def.json and BPU_FLUSH_MEM_FAULT in memory.json, and the default perf list output shows both. The old name has been in every release since v6.8, so removing the name would break anything that refers to it.

Mark the entry deprecated instead of deleting it, as Ian Rogers asked:
perf list then shows 0x121 once, and perf stat -e bpu_flush_mem_fault keeps working. The x86 tables use the same wording, and the same reasoning brought back deprecated AMD events in
commit eda39f98bbc5 ("perf vendor events amd: Reintroduce deprecated Zen 5 core events"). The entry still registers event=0x121, and no other event changes; after regenerating the tables only the two descriptions and the deprecation flag differ.
perf list --deprecated still prints the name in the text output. perf list -j cannot show deprecated events at all: the JSON printer honours the flag, but --deprecated is wired only into the text print state, so the JSON state never sees it. No metric expression and no other file refers to either name.

The duplicate came in because jevents checks repeated names, not event codes, and one encoding carrying several names is legitimate, so nothing is added for that here. No AmpereOneX machine was available, so the listing was not run on hardware; Ilkka Koskinen, who added both tables, tried v1 and v2 and reports that they behave as expected, and his Acked-by covers v2, which differs from this version only in that full stop. The JSON edit and this changelog were written with an LLM assistant, Hermes Agent, working from the code and the thread; the checks above were run here.

---
v3: add the full stop after the new event name, as James Clark
asked, and carry his Reviewed-by. Also correct three statements in this changelog: the JSON printer does consult the flag (the option is simply not wired to it), regeneration changes the two descriptions as well as the flag, and Ilkka Koskinen's Acked-by was given for v2.

 .../perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json +3 -2
index 6c06bc928415..b0934a7b252c 100644
@@ -35,9 +35,10 @@
         "ArchStdEvent": "MEM_ACCESS_CHECKED_WR"
     },
     {
-        "PublicDescription": "Flushes due to memory hazards",
+        "PublicDescription": "This event is deprecated. Refer to new event GPC_FLUSH_MEM_FAULT. Flushes due to memory hazards",
         "EventCode": "0x121",
         "EventName": "BPU_FLUSH_MEM_FAULT",
-        "BriefDescription": "Flushes due to memory hazards"
+        "BriefDescription": "This event is deprecated. Refer to new event GPC_FLUSH_MEM_FAULT",
+        "Deprecated": "1"
     }
 ]

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4

Signature · 1 line
2.53.0
#12 lore raw

Re: [PATCH v3] perf vendor events arm64 AmpereOneX: Deprecate BPU_FLUSH_MEM_FAULT

Sashiko has reviewed this patch and found no issues.
Quoted 15 lines

AmpereOne named event 0x121 BPU_FLUSH_MEM_FAULT until
commit 10a149e4b4a9 ("perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT") renamed it. The next patch in that series, 16438b652b46, added the AmpereOneX tables with the old name in memory.json, so 0x121 carries two names: GPC_FLUSH_MEM_FAULT in core-imp-def.json and BPU_FLUSH_MEM_FAULT in memory.json, and the default perf list output shows both. The old name has been in every release since v6.8, so removing the name would break anything that refers to it.

Mark the entry deprecated instead of deleting it, as Ian Rogers asked:
perf list then shows 0x121 once, and perf stat -e bpu_flush_mem_fault keeps working. The x86 tables use the same wording, and the same reasoning brought back deprecated AMD events in
commit eda39f98bbc5 ("perf vendor events amd: Reintroduce deprecated

Quoted 6 lines

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Applied
#13 lore raw

Re: [PATCH v3] perf vendor events arm64 AmpereOneX: Deprecate BPU_FLUSH_MEM_FAULT

In reply to TAKANO Mitsuhiro
Quoted 11 lines · TAKANO Mitsuhiro

AmpereOne named event 0x121 BPU_FLUSH_MEM_FAULT until
commit 10a149e4b4a9 ("perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT") renamed it. The next patch in that series, 16438b652b46, added the AmpereOneX tables with the old name in memory.json, so 0x121 carries two names: GPC_FLUSH_MEM_FAULT in core-imp-def.json and BPU_FLUSH_MEM_FAULT in memory.json, and the default perf list output shows both. The old name has been in every release since v6.8, so removing the name would break anything that refers to it.

[...]

Applied to perf-tools-next, thanks!

Best regards
Namhyung