Skip to contentSkip to conversation

perf list: Add IBM z17 event descriptions

PATCH Applied Thomas Richter 3 participants 8 messages Jun 23, 2025 – Jul 3, 2025

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

PATCH 1/1 perf list: Add IBM z17 event descriptions

Update IBM z17 counter description using document SA23-2260-08:
"The Load-Program-Parameter and the CPU-Measurement Facilities" released in May 2025 to include counter definitions for IBM z17 counter sets:
* Basic counter set
* Problem/user counter set
* Crypto counter set.

Use document SA23-2261-09:
"The CPU-Measurement Facility Extended Counters Definition
for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15, z16 and z17"
released on April 2025 to include counter definitions for IBM z17
* Extended counter set
* MT-Diagnostic counter set.

Use document SA22-7832-14:
"z/Architecture Principles of Operation."
released in April 2025 to include counter definitions for IBM z17
* PAI-Crypto counter set
* PAI-Extention counter set.

Use document
"CPU MF Formulas and Updates April 2025" released in April 2025 to include metric calculations.

---
 .../pmu-events/arch/s390/cf_z17/basic.json        |   58 +
 .../pmu-events/arch/s390/cf_z17/crypto6.json      |  142 ++
 .../pmu-events/arch/s390/cf_z17/extended.json     |  541 ++++++++
 .../pmu-events/arch/s390/cf_z17/pai_crypto.json   | 1213 +++++++++++++++++
 .../pmu-events/arch/s390/cf_z17/pai_ext.json      |  261 ++++
 .../pmu-events/arch/s390/cf_z17/transaction.json  |   72 +
 tools/perf/pmu-events/arch/s390/mapfile.csv       |    1 +
 7 files changed, 2288 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/s390/cf_z17/basic.json
 create mode 100644 tools/perf/pmu-events/arch/s390/cf_z17/crypto6.json
 create mode 100644 tools/perf/pmu-events/arch/s390/cf_z17/extended.json
 create mode 100644 tools/perf/pmu-events/arch/s390/cf_z17/pai_crypto.json
 create mode 100644 tools/perf/pmu-events/arch/s390/cf_z17/pai_ext.json
 create mode 100644 tools/perf/pmu-events/arch/s390/cf_z17/transaction.json
tools/perf/pmu-events/arch/s390/cf_z17/basic.json new file +58 -0
new file mode 100644
index 000000000000..1023d47028ce
@@ -0,0 +1,58 @@
+[
+	{
+		"Unit": "CPU-M-CF",
+		"EventCode": "0",
+		"EventName": "CPU_CYCLES",
+		"BriefDescription": "Cycle Count",
+		"PublicDescription": "This counter counts the total number of CPU cycles, excluding the number of cycles while the CPU is in the wait state."
+	},
+	{
+		"Unit": "CPU-M-CF",
+		"EventCode": "1",
+		"EventName": "INSTRUCTIONS",
+		"BriefDescription": "Instruction Count",
+		"PublicDescription": "This counter counts the total number of instructions executed by the CPU."
+	},
+	{
+		"Unit": "CPU-M-CF",
+		"EventCode": "2",
+		"EventName": "L1I_DIR_WRITES",
+		"BriefDescription": "Level-1 I-Cache Directory Write Count",
+		"PublicDescription": "This counter counts the total number of level-1 instruction-cache or unified-cache directory writes."
+	},
+	{
+		"Unit": "CPU-M-CF",
+		"EventCode": "3",
+		"EventName": "L1I_PENALTY_CYCLES",
+		"BriefDescription": "Level-1 I-Cache Penalty Cycle Count",
+		"PublicDescription": "This counter counts the total number of cache penalty cycles for level-1 instruction cache or unified cache."
+	},
+	{
+		"Unit": "CPU-M-CF",
+		"EventCode": "4",
+		"EventName": "L1D_DIR_WRITES",
+		"BriefDescription": "Level-1 D-Cache Directory Write Count",
+		"PublicDescription": "This counter counts the total number of level-1 data-cache directory writes."
+	},
+	{
+		"Unit": "CPU-M-CF",
+		"EventCode": "5",
+		"EventName": "L1D_PENALTY_CYCLES",
+		"BriefDescription": "Level-1 D-Cache Penalty Cycle Count",
+		"PublicDescription": "This counter counts the total number of cache penalty cycles for level-1 data cache."
+	},
+	{
+		"Unit": "CPU-M-CF",
+		"EventCode": "32",
+		"EventName": "PROBLEM_STATE_CPU_CYCLES",
+		"BriefDescription": "Problem-State Cycle Count",
+		"PublicDescription": "This counter counts the total number of CPU cycles when the CPU is in the problem state, excluding the number of cycles while the CPU is in the wait state."
+	},
+	{
+		"Unit": "CPU-M-CF",
+		"EventCode": "33",
+		"EventName": "PROBLEM_STATE_INSTRUCTIONS",
+		"BriefDescription": "Problem-State Instruction Count",
+		"PublicDescription": "This counter counts the total number of instructions executed by the CPU while in the problem state."
+	}
+]
tools/perf/pmu-events/arch/s390/cf_z17/crypto6.json new file +142 -0

142 lines not on this page · raw message

tools/perf/pmu-events/arch/s390/cf_z17/extended.json new file +541 -0

541 lines not on this page · raw message

tools/perf/pmu-events/arch/s390/cf_z17/pai_crypto.json new file +1213 -0

1,213 lines not on this page · raw message

tools/perf/pmu-events/arch/s390/cf_z17/pai_ext.json new file +261 -0

261 lines not on this page · raw message

tools/perf/pmu-events/arch/s390/cf_z17/transaction.json new file +72 -0

72 lines not on this page · raw message

tools/perf/pmu-events/arch/s390/mapfile.csv +1 -0
index b22648d12751..6fdede50e7b2 100644
@@ -6,3 +6,4 @@ Family-model,Version,Filename,EventType
 ^IBM.390[67].*[13]\.[1-5].[[:xdigit:]]+$,3,cf_z14,core
 ^IBM.856[12].*3\.6.[[:xdigit:]]+$,3,cf_z15,core
 ^IBM.393[12].*$,3,cf_z16,core
+^IBM.917[56].*$,3,cf_z17,core
Signature · 1 line
2.49.0
reviewer
#1 lore raw
Quoted 28 lines · Thomas Richter

Update IBM z17 counter description using document SA23-2260-08:
"The Load-Program-Parameter and the CPU-Measurement Facilities" released in May 2025 to include counter definitions for IBM z17 counter sets:
* Basic counter set
* Problem/user counter set
* Crypto counter set.

Use document SA23-2261-09:
"The CPU-Measurement Facility Extended Counters Definition
for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15, z16 and z17"
released on April 2025 to include counter definitions for IBM z17
* Extended counter set
* MT-Diagnostic counter set.

Use document SA22-7832-14:
"z/Architecture Principles of Operation."
released in April 2025 to include counter definitions for IBM z17
* PAI-Crypto counter set
* PAI-Extention counter set.

Use document
"CPU MF Formulas and Updates April 2025" released in April 2025 to include metric calculations.

[snip]

Quoted 7 lines
tools/perf/pmu-events/arch/s390/cf_z17/extended.json new file +7 -0
+       {
+               "Unit": "CPU-M-CF",
+               "EventCode": "143",
+               "EventName": "L1C_TLB2_MISSES",
+               "BriefDescription": "L1C TLB2 Misses",
+               "PublicDescription": "Increments by one for any cycle where a Level-1 cache or Level-2 TLB miss is in progress."
+       },

[snip]

Quoted 5 lines
tools/perf/pmu-events/arch/s390/cf_z17/transaction.json new file +5 -0
+  {
+    "BriefDescription": "Cycles per Instructions from Finite cache/memory",
+    "MetricName": "finite_cpi",
+    "MetricExpr": "L1C_TLB2_MISSES / INSTRUCTIONS if has_event(L1C_TLB2_MISSES) else 0"
+  },

tools/perf/pmu-events/arch/s390/cf_z17/transaction.json line 61

Quoted 10 lines
tools/perf/pmu-events/arch/s390/cf_z17/transaction.json new file +10 -0
+  {
+    "BriefDescription": "Estimated Instruction Complexity CPI infinite Level 1",
+    "MetricName": "est_cpi",
+    "MetricExpr": "(CPU_CYCLES / INSTRUCTIONS) - (L1C_TLB2_MISSES / INSTRUCTIONS) if has_event(INSTRUCTIONS) else 0"
+  },
+  {
+    "BriefDescription": "Estimated Sourcing Cycles per Level 1 Miss",
+    "MetricName": "scpl1m",
+    "MetricExpr": "L1C_TLB2_MISSES / (L1I_DIR_WRITES + L1D_DIR_WRITES) if has_event(L1C_TLB2_MISSES) else 0"
+  },

Just a quick check. If the PMU CPU-M-CF is always present then the "has_event(L1C_TLB2_MISSES)" check will always be true as the event is in json and not in sysfs. I'm guessing this is being done for the benefit of hypervisors.

tools/perf/pmu-events/arch/s390/cf_z17/transaction.json line 71

Quoted 10 lines
tools/perf/pmu-events/arch/s390/cf_z17/transaction.json new file +10 -0
+  {
+    "BriefDescription": "Estimated TLB CPU percentage of Total CPU",
+    "MetricName": "tlb_percent",
+    "MetricExpr": "((DTLB2_MISSES + ITLB2_MISSES) / CPU_CYCLES) * (L1C_TLB2_MISSES / (L1I_PENALTY_CYCLES + L1D_PENALTY_CYCLES)) * 100 if has_event(CPU_CYCLES) else 0"
+  },
+  {
+    "BriefDescription": "Estimated Cycles per TLB Miss",
+    "MetricName": "tlb_miss",
+    "MetricExpr": "((DTLB2_MISSES + ITLB2_MISSES) / (DTLB2_WRITES + ITLB2_WRITES)) * (L1C_TLB2_MISSES / (L1I_PENALTY_CYCLES + L1D_PENALTY_CYCLES)) if has_event(DTLB2_MISSES) else 0"
+  }

Similar here but with different events.

Thanks,
Ian

#2 lore raw
Quoted 58 lines · Ian Rogers
Quoted 28 lines · Thomas Richter

Update IBM z17 counter description using document SA23-2260-08:
"The Load-Program-Parameter and the CPU-Measurement Facilities" released in May 2025 to include counter definitions for IBM z17 counter sets:
* Basic counter set
* Problem/user counter set
* Crypto counter set.

Use document SA23-2261-09:
"The CPU-Measurement Facility Extended Counters Definition
for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15, z16 and z17"
released on April 2025 to include counter definitions for IBM z17
* Extended counter set
* MT-Diagnostic counter set.

Use document SA22-7832-14:
"z/Architecture Principles of Operation."
released in April 2025 to include counter definitions for IBM z17
* PAI-Crypto counter set
* PAI-Extention counter set.

Use document
"CPU MF Formulas and Updates April 2025" released in April 2025 to include metric calculations.

[snip]

Quoted 7 lines
tools/perf/pmu-events/arch/s390/cf_z17/extended.json new file +7 -0
+       {
+               "Unit": "CPU-M-CF",
+               "EventCode": "143",
+               "EventName": "L1C_TLB2_MISSES",
+               "BriefDescription": "L1C TLB2 Misses",
+               "PublicDescription": "Increments by one for any cycle where a Level-1 cache or Level-2 TLB miss is in progress."
+       },

[snip]

Quoted 5 lines
tools/perf/pmu-events/arch/s390/cf_z17/transaction.json new file +5 -0
+  {
+    "BriefDescription": "Cycles per Instructions from Finite cache/memory",
+    "MetricName": "finite_cpi",
+    "MetricExpr": "L1C_TLB2_MISSES / INSTRUCTIONS if has_event(L1C_TLB2_MISSES) else 0"
+  },

tools/perf/pmu-events/arch/s390/cf_z17/transaction.json line 61

Quoted 10 lines
tools/perf/pmu-events/arch/s390/cf_z17/transaction.json new file +10 -0
+  {
+    "BriefDescription": "Estimated Instruction Complexity CPI infinite Level 1",
+    "MetricName": "est_cpi",
+    "MetricExpr": "(CPU_CYCLES / INSTRUCTIONS) - (L1C_TLB2_MISSES / INSTRUCTIONS) if has_event(INSTRUCTIONS) else 0"
+  },
+  {
+    "BriefDescription": "Estimated Sourcing Cycles per Level 1 Miss",
+    "MetricName": "scpl1m",
+    "MetricExpr": "L1C_TLB2_MISSES / (L1I_DIR_WRITES + L1D_DIR_WRITES) if has_event(L1C_TLB2_MISSES) else 0"
+  },
Quoted 5 lines

Just a quick check. If the PMU CPU-M-CF is always present then the "has_event(L1C_TLB2_MISSES)" check will always be true as the event is in json and not in sysfs. I'm guessing this is being done for the benefit of hypervisors.

The issue is indeed with z/VM, where the CPU Measurement facility is not exported to any guest OS including linux.
If you run Linux on top of z/VM then these events do not exist.

# uname -a
Linux a8345022.lnxne.boe 6.16.0-rc1m-perf #14 SMP Tue Jun 10 07:39:06 CEST 2025 s390x GNU/Linux
# grep VM /proc/sysinfo 
VM00 Name:            A8345022
VM00 Control Program: z/VM    7.4.0   
VM00 Adjustment:      50
VM00 CPUs Total:      4
VM00 CPUs Configured: 4
VM00 CPUs Standby:    0
VM00 CPUs Reserved:   0
# lscpumf 
lscpumf: No CPU-measurement facilities detected
# 

Without this if..else the perf stat -e metric fail when Linux is installed on top of z/VM systems. See commit c2f3d7dfc7373 ("perf stat: Do not fail on metrics on s390 z/VM systems")

which fixed it for z16 machine generation.

Hope this helps.

Quoted 2 lines

Thanks,
Ian

Signature · 9 lines
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
IBM Deutschland Research & Development GmbH

Vorsitzender des Aufsichtsrats: Wolfgang Wendt

Geschäftsführung: David Faller

Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
#3 lore raw

PATCH 1/1 perf list: Add IBM z17 event descriptions

On 6/24/25 08:35, Thomas Richter wrote:

Gently Ping

Ian, I have responded to your comments some days ago. See below.

Thanks a lot.

Quoted 94 lines · Ian Rogers
Quoted 58 lines · Thomas Richter
Quoted 28 lines

Update IBM z17 counter description using document SA23-2260-08:
"The Load-Program-Parameter and the CPU-Measurement Facilities" released in May 2025 to include counter definitions for IBM z17 counter sets:
* Basic counter set
* Problem/user counter set
* Crypto counter set.

Use document SA23-2261-09:
"The CPU-Measurement Facility Extended Counters Definition
for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15, z16 and z17"
released on April 2025 to include counter definitions for IBM z17
* Extended counter set
* MT-Diagnostic counter set.

Use document SA22-7832-14:
"z/Architecture Principles of Operation."
released in April 2025 to include counter definitions for IBM z17
* PAI-Crypto counter set
* PAI-Extention counter set.

Use document
"CPU MF Formulas and Updates April 2025" released in April 2025 to include metric calculations.

[snip]

Quoted 7 lines
tools/perf/pmu-events/arch/s390/cf_z17/extended.json new file +7 -0
+       {
+               "Unit": "CPU-M-CF",
+               "EventCode": "143",
+               "EventName": "L1C_TLB2_MISSES",
+               "BriefDescription": "L1C TLB2 Misses",
+               "PublicDescription": "Increments by one for any cycle where a Level-1 cache or Level-2 TLB miss is in progress."
+       },

[snip]

Quoted 5 lines
tools/perf/pmu-events/arch/s390/cf_z17/transaction.json new file +5 -0
+  {
+    "BriefDescription": "Cycles per Instructions from Finite cache/memory",
+    "MetricName": "finite_cpi",
+    "MetricExpr": "L1C_TLB2_MISSES / INSTRUCTIONS if has_event(L1C_TLB2_MISSES) else 0"
+  },

tools/perf/pmu-events/arch/s390/cf_z17/transaction.json line 61

Quoted 10 lines
tools/perf/pmu-events/arch/s390/cf_z17/transaction.json new file +10 -0
+  {
+    "BriefDescription": "Estimated Instruction Complexity CPI infinite Level 1",
+    "MetricName": "est_cpi",
+    "MetricExpr": "(CPU_CYCLES / INSTRUCTIONS) - (L1C_TLB2_MISSES / INSTRUCTIONS) if has_event(INSTRUCTIONS) else 0"
+  },
+  {
+    "BriefDescription": "Estimated Sourcing Cycles per Level 1 Miss",
+    "MetricName": "scpl1m",
+    "MetricExpr": "L1C_TLB2_MISSES / (L1I_DIR_WRITES + L1D_DIR_WRITES) if has_event(L1C_TLB2_MISSES) else 0"
+  },
Quoted 5 lines

Just a quick check. If the PMU CPU-M-CF is always present then the "has_event(L1C_TLB2_MISSES)" check will always be true as the event is in json and not in sysfs. I'm guessing this is being done for the benefit of hypervisors.

The issue is indeed with z/VM, where the CPU Measurement facility is not exported to any guest OS including linux.
If you run Linux on top of z/VM then these events do not exist.

# uname -a
Linux a8345022.lnxne.boe 6.16.0-rc1m-perf #14 SMP Tue Jun 10 07:39:06 CEST 2025 s390x GNU/Linux
# grep VM /proc/sysinfo 
VM00 Name:            A8345022
VM00 Control Program: z/VM    7.4.0   
VM00 Adjustment:      50
VM00 CPUs Total:      4
VM00 CPUs Configured: 4
VM00 CPUs Standby:    0
VM00 CPUs Reserved:   0
# lscpumf 
lscpumf: No CPU-measurement facilities detected
# 

Without this if..else the perf stat -e metric fail when Linux is installed on top of z/VM systems. See commit c2f3d7dfc7373 ("perf stat: Do not fail on metrics on s390 z/VM systems")

which fixed it for z16 machine generation.

Hope this helps.

Quoted 2 lines

Thanks,
Ian

Signature · 9 lines
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
IBM Deutschland Research & Development GmbH

Vorsitzender des Aufsichtsrats: Wolfgang Wendt

Geschäftsführung: David Faller

Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
reviewer Reviewed-by on v1 1/1
#4 lore raw
Quoted 6 lines · Thomas Richter

On 6/24/25 08:35, Thomas Richter wrote:

Gently Ping

Ian, I have responded to your comments some days ago.

Thanks Thomas, minor nit in your explanation the events must exist as they are in json, but the json events are only exposed if the PMU is present, so the has_event is more of a has_pmu test. Maybe we should add a function like this to the metrics to make this kind of case clearer. Maybe perf list should test the events of a metric and hide metrics when the events aren't available to avoid the have_event logic. I'm a bit uncomfortable with that as the events may not be available because of permission issues, but it'd still be useful to know the metrics are around. Anyway I'm digressing.

Thanks,
Ian

#5 lore raw
Quoted 18 lines · Ian Rogers
Quoted 6 lines · Thomas Richter

On 6/24/25 08:35, Thomas Richter wrote:

Gently Ping

Ian, I have responded to your comments some days ago.

Thanks Thomas, minor nit in your explanation the events must exist as they are in json, but the json events are only exposed if the PMU is present, so the has_event is more of a has_pmu test. Maybe we should add a function like this to the metrics to make this kind of case clearer. Maybe perf list should test the events of a metric and hide metrics when the events aren't available to avoid the have_event logic. I'm a bit uncomfortable with that as the events may not be available because of permission issues, but it'd still be useful to know the metrics are around. Anyway I'm digressing.

Quoted 5 lines

Thanks,
Ian

Arnaldo, Namhyung,

with Ian Rogers Reviewed-by: approval, it is possible to accept this patch soon, so it will land in the next merge-window.

That will give me an commit-id which I need for my addon work.

Thanks a lot for your help.

Signature · 9 lines
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
IBM Deutschland Research & Development GmbH

Vorsitzender des Aufsichtsrats: Wolfgang Wendt

Geschäftsführung: David Faller

Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
maintainer
#6 lore raw

Hello,

Quoted 25 lines · Thomas Richter
Quoted 18 lines · Ian Rogers
Quoted 6 lines · Thomas Richter

On 6/24/25 08:35, Thomas Richter wrote:

Gently Ping

Ian, I have responded to your comments some days ago.

Thanks Thomas, minor nit in your explanation the events must exist as they are in json, but the json events are only exposed if the PMU is present, so the has_event is more of a has_pmu test. Maybe we should add a function like this to the metrics to make this kind of case clearer. Maybe perf list should test the events of a metric and hide metrics when the events aren't available to avoid the have_event logic. I'm a bit uncomfortable with that as the events may not be available because of permission issues, but it'd still be useful to know the metrics are around. Anyway I'm digressing.

Quoted 5 lines

Thanks,
Ian

Quoted 8 lines

Arnaldo, Namhyung,

with Ian Rogers Reviewed-by: approval, it is possible to accept this patch soon, so it will land in the next merge-window.

That will give me an commit-id which I need for my addon work.

Thanks a lot for your help.

Sorry about the delay, I'll process this soon.

Thanks,
Namhyung

maintainer Applied
#7 lore raw
In reply to Thomas Richter
Quoted 9 lines · Thomas Richter

Update IBM z17 counter description using document SA23-2260-08:
"The Load-Program-Parameter and the CPU-Measurement Facilities" released in May 2025 to include counter definitions for IBM z17 counter sets:
* Basic counter set
* Problem/user counter set
* Crypto counter set.

[...]

Applied to perf-tools-next, thanks!

Best regards,
Namhyung