perf vendor events arm64: AmpereOne/AmpereOneX: Add a new errata and fix metrics calculations
Subsystems (2)
cover perf vendor events arm64: AmpereOne/AmpereOneX: Add a new errata and fix metrics calculations
Add an errata reference to a impacted event and fix metrics calculation caused by a scaling issue.
Ilkka Koskinen (2):
perf vendor events arm64: AmpereOne/AmpereOneX: Mark LD_RETIRED
impacted by errata
perf vendor events arm64 AmpereOneX: Fix frontend_bound calculation
.../pmu-events/arch/arm64/ampere/ampereone/memory.json | 4 +++- .../arch/arm64/ampere/ampereonex/memory.json | 4 +++- .../arch/arm64/ampere/ampereonex/metrics.json | 10 +++++----- 3 files changed, 11 insertions(+), 7 deletions(-)
Signature · 1 line
2.47.0
PATCH 1/2 perf vendor events arm64: AmpereOne/AmpereOneX: Mark LD_RETIRED impacted by errata
Atomic instructions are both memory-reading and memory-writing instructions and so should be counted by both LD_RETIRED and ST_RETIRED performance monitoring events. However LD_RETIRED does not count atomic instructions.
--- tools/perf/pmu-events/arch/arm64/ampere/ampereone/memory.json | 4 +++- .../perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
tools/perf/pmu-events/arch/arm64/ampere/ampereone/memory.json +3 -1
@@ -1,6 +1,8 @@ [ { - "ArchStdEvent": "LD_RETIRED" + "ArchStdEvent": "LD_RETIRED", + "Errata": "Errata AC03_CPU_52", + "BriefDescription": "Instruction architecturally executed, condition code check pass, load. Impacted by errata -" }, { "ArchStdEvent": "MEM_ACCESS_RD"
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json +3 -1
@@ -1,6 +1,8 @@ [ { - "ArchStdEvent": "LD_RETIRED" + "ArchStdEvent": "LD_RETIRED", + "Errata": "Errata AC04_CPU_21", + "BriefDescription": "Instruction architecturally executed, condition code check pass, load. Impacted by errata -" }, { "ArchStdEvent": "MEM_ACCESS_RD"
Signature · 1 line
2.47.0
Re: [PATCH 1/2] perf vendor events arm64: AmpereOne/AmpereOneX: Mark LD_RETIRED impacted by errata
Quoted 16 lines · Ilkka Koskinen
Atomic instructions are both memory-reading and memory-writing instructions and so should be counted by both
LD_RETIREDandST_RETIREDperformance monitoring events. HoweverLD_RETIREDdoes not count atomic instructions.Signed-off-by Ilkka Koskinen <[email protected]>--- tools/perf/pmu-events/arch/arm64/ampere/ampereone/memory.json | 4 +++- .../perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)tools/perf/pmu-events/arch/arm64/ampere/ampereone/memory.json +0
-0
tools/perf/pmu-events/arch/arm64/ampere/ampereone/memory.json line 5
Quoted 6 lines
tools/perf/pmu-events/arch/arm64/ampere/ampereone/memory.json +3
-1@@ -1,6 +1,8 @@ [ { - "ArchStdEvent": "LD_RETIRED" + "ArchStdEvent": "LD_RETIRED", + "Errata": "Errata AC03_CPU_52", + "BriefDescription": "Instruction architecturally executed, condition code check pass, load. Impacted by errata -"
I think this could also have a 'Fixes:' tag, either way:
Re: [PATCH 1/2] perf vendor events arm64: AmpereOne/AmpereOneX: Mark LD_RETIRED impacted by errata
Hi James,
Quoted 27 lines · James Clark
Quoted 22 lines · Ilkka Koskinen
Atomic instructions are both memory-reading and memory-writing instructions and so should be counted by both
LD_RETIREDandST_RETIREDperformance monitoring events. HoweverLD_RETIREDdoes not count atomic instructions.Signed-off-by Ilkka Koskinen <[email protected]>--- tools/perf/pmu-events/arch/arm64/ampere/ampereone/memory.json | 4 +++- .../perf/pmu-events/arch/arm64/ampere/ampereonex/memory.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)tools/perf/pmu-events/arch/arm64/ampere/ampereone/memory.json +3
-1@@ -1,6 +1,8 @@ [ { - "ArchStdEvent": "LD_RETIRED" + "ArchStdEvent": "LD_RETIRED", + "Errata": "Errata AC03_CPU_52", + "BriefDescription": "Instruction architecturally executed,Quoted 1 line
condition code check pass, load. Impacted by errata -"
I think this could also have a 'Fixes:' tag, either way:
Quoted 1 line
Reviewed-by James Clark <[email protected]>
Yeah, that's true. I guess, I was thinking about using 'Fixes' more on broken patches rather than when adding a patch dealing with a new hw errata. Well, given you're find with this, I don't think I'll resubmit it with a Fixes tag this time.
Cheers, Ilkka
PATCH 2/2 perf vendor events arm64 AmpereOneX: Fix frontend_bound calculation
In reply to Ilkka Koskinenfrontend_bound metrics was miscalculated due to different scaling in a couple of metrics it depends on. Change the scaling to match with AmpereOne.
--- .../arch/arm64/ampere/ampereonex/metrics.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/metrics.json +5 -5
@@ -229,19 +229,19 @@ }, { "MetricName": "slots_lost_misspeculation_fraction", - "MetricExpr": "(OP_SPEC - OP_RETIRED) / (CPU_CYCLES * #slots)", + "MetricExpr": "100 * (OP_SPEC - OP_RETIRED) / (CPU_CYCLES * #slots)", "BriefDescription": "Fraction of slots lost due to misspeculation", "DefaultMetricgroupName": "TopdownL1", "MetricGroup": "Default;TopdownL1", - "ScaleUnit": "100percent of slots" + "ScaleUnit": "1percent of slots" }, { "MetricName": "retired_fraction", - "MetricExpr": "OP_RETIRED / (CPU_CYCLES * #slots)", + "MetricExpr": "100 * OP_RETIRED / (CPU_CYCLES * #slots)", "BriefDescription": "Fraction of slots retiring, useful work", "DefaultMetricgroupName": "TopdownL1", "MetricGroup": "Default;TopdownL1", - "ScaleUnit": "100percent of slots" + "ScaleUnit": "1percent of slots" }, { "MetricName": "backend_core",
@@ -266,7 +266,7 @@ }, { "MetricName": "frontend_bandwidth", - "MetricExpr": "frontend_bound - frontend_latency", + "MetricExpr": "frontend_bound - 100 * frontend_latency", "BriefDescription": "Fraction of slots the CPU did not dispatch at full bandwidth - able to dispatch partial slots only (1, 2, or 3 uops)", "MetricGroup": "TopdownL2", "ScaleUnit": "1percent of slots"
Signature · 1 line
2.47.0
Re: [PATCH 2/2] perf vendor events arm64 AmpereOneX: Fix frontend_bound calculation
Quoted 25 lines · Ilkka Koskinen
frontend_boundmetrics was miscalculated due to different scaling in a couple of metrics it depends on. Change the scaling to match with AmpereOne.Fixes 16438b652b46 ("perf vendor events arm64 AmpereOneX: Add core PMU events and metrics")Signed-off-by Ilkka Koskinen <[email protected]>--- .../arch/arm64/ampere/ampereonex/metrics.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)tools/perf/pmu-events/arch/arm64/ampere/ampereonex/metrics.json +2
-2@@ -229,19 +229,19 @@ }, { "MetricName": "slots_lost_misspeculation_fraction", - "MetricExpr": "(OP_SPEC - OP_RETIRED) / (CPU_CYCLES * #slots)", + "MetricExpr": "100 * (OP_SPEC - OP_RETIRED) / (CPU_CYCLES * #slots)", "BriefDescription": "Fraction of slots lost due to misspeculation", "DefaultMetricgroupName": "TopdownL1", "MetricGroup": "Default;TopdownL1", - "ScaleUnit": "100percent of slots" + "ScaleUnit": "1percent of slots"
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/metrics.json line 244
Quoted 10 lines
tools/perf/pmu-events/arch/arm64/ampere/ampereonex/metrics.json +2
-2}, { "MetricName": "retired_fraction", - "MetricExpr": "OP_RETIRED / (CPU_CYCLES * #slots)", + "MetricExpr": "100 * OP_RETIRED / (CPU_CYCLES * #slots)", "BriefDescription": "Fraction of slots retiring, useful work", "DefaultMetricgroupName": "TopdownL1", "MetricGroup": "Default;TopdownL1", - "ScaleUnit": "100percent of slots" + "ScaleUnit": "1percent of slots"
I never considered that ScaleUnit could be an issue when the metric was included in other metrics with different scales. Seems like an easy trap.
Quoted 9 lines · Ilkka Koskinen
Add an errata reference to a impacted event and fix metrics calculation caused by a scaling issue.
Ilkka Koskinen (2):
perf vendor events arm64: AmpereOne/AmpereOneX: MarkLD_RETIRED
impacted by errata
perf vendor events arm64 AmpereOneX: Fixfrontend_boundcalculation[...]
Applied to perf-tools-next, thanks!
Best regards,
Namhyung