linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] tools/perf/json: Add common metrics for s390
@ 2023-03-13  8:01 Thomas Richter
  2023-03-13  8:01 ` [PATCH 2/6] tools/perf/json: Add cache metrics for s390 z16 Thomas Richter
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Thomas Richter @ 2023-03-13  8:01 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, sumanthk
  Cc: svens, gor, hca, Thomas Richter

Add 3 metrics for s390 machines:
- Cycles per instruction: Amount of CPU cycles used per instructions,
  named cpi.
- Problem state ratio: Ratio of instructions executed in problem state
  compared to total number of instructions, named prbstate.
- Level one instruction and data cache misses per 100 instructions,
  named l1mp.

For details about the formulas see this documentation:
https://www.ibm.com/support/pages/system/files/inline-files/CPU%20MF%20Formulas%20including%20z16%20-%20May%202022_1.pdf

Outpuf after:
 # ./perf stat -M cpi -- dd if=/dev/zero of=/dev/null bs=1M count=10K
 10240+0 records in
 10240+0 records out
 10737418240 bytes (11 GB, 10 GiB) copied, 1.30151 s, 8.2 GB/s

Performance counter stats for 'dd if=/dev/zero of=/dev/null .....':

  6,779,778,802      CPU_CYCLES              #     1.96 cpi
  3,461,975,090      INSTRUCTIONS

  1.306873021 seconds time elapsed

  0.001034000 seconds user
  1.305677000 seconds sys
 #

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-By: Sumanth Korikkar <sumanthk@linux.ibm.com>
---
 .../pmu-events/arch/s390/cf_z13/transaction.json  | 15 +++++++++++++++
 .../pmu-events/arch/s390/cf_z14/transaction.json  | 15 +++++++++++++++
 .../pmu-events/arch/s390/cf_z15/transaction.json  | 15 +++++++++++++++
 .../pmu-events/arch/s390/cf_z16/transaction.json  | 15 +++++++++++++++
 4 files changed, 60 insertions(+)

diff --git a/tools/perf/pmu-events/arch/s390/cf_z13/transaction.json b/tools/perf/pmu-events/arch/s390/cf_z13/transaction.json
index 1a0034f79f73..86bf83b4504e 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z13/transaction.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z13/transaction.json
@@ -3,5 +3,20 @@
     "BriefDescription": "Transaction count",
     "MetricName": "transaction",
     "MetricExpr": "TX_C_TEND + TX_NC_TEND + TX_NC_TABORT + TX_C_TABORT_SPECIAL + TX_C_TABORT_NO_SPECIAL"
+  },
+  {
+    "BriefDescription": "Cycles per Instruction",
+    "MetricName": "cpi",
+    "MetricExpr": "CPU_CYCLES / INSTRUCTIONS"
+  },
+  {
+    "BriefDescription": "Problem State Instruction Ratio",
+    "MetricName": "prbstate",
+    "MetricExpr": "(PROBLEM_STATE_INSTRUCTIONS / INSTRUCTIONS) * 100"
+  },
+  {
+    "BriefDescription": "Level One Miss per 100 Instructions",
+    "MetricName": "l1mp",
+    "MetricExpr": "((L1I_DIR_WRITES + L1D_DIR_WRITES) / INSTRUCTIONS) * 100"
   }
 ]
diff --git a/tools/perf/pmu-events/arch/s390/cf_z14/transaction.json b/tools/perf/pmu-events/arch/s390/cf_z14/transaction.json
index 1a0034f79f73..86bf83b4504e 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z14/transaction.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z14/transaction.json
@@ -3,5 +3,20 @@
     "BriefDescription": "Transaction count",
     "MetricName": "transaction",
     "MetricExpr": "TX_C_TEND + TX_NC_TEND + TX_NC_TABORT + TX_C_TABORT_SPECIAL + TX_C_TABORT_NO_SPECIAL"
+  },
+  {
+    "BriefDescription": "Cycles per Instruction",
+    "MetricName": "cpi",
+    "MetricExpr": "CPU_CYCLES / INSTRUCTIONS"
+  },
+  {
+    "BriefDescription": "Problem State Instruction Ratio",
+    "MetricName": "prbstate",
+    "MetricExpr": "(PROBLEM_STATE_INSTRUCTIONS / INSTRUCTIONS) * 100"
+  },
+  {
+    "BriefDescription": "Level One Miss per 100 Instructions",
+    "MetricName": "l1mp",
+    "MetricExpr": "((L1I_DIR_WRITES + L1D_DIR_WRITES) / INSTRUCTIONS) * 100"
   }
 ]
diff --git a/tools/perf/pmu-events/arch/s390/cf_z15/transaction.json b/tools/perf/pmu-events/arch/s390/cf_z15/transaction.json
index 1a0034f79f73..86bf83b4504e 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z15/transaction.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z15/transaction.json
@@ -3,5 +3,20 @@
     "BriefDescription": "Transaction count",
     "MetricName": "transaction",
     "MetricExpr": "TX_C_TEND + TX_NC_TEND + TX_NC_TABORT + TX_C_TABORT_SPECIAL + TX_C_TABORT_NO_SPECIAL"
+  },
+  {
+    "BriefDescription": "Cycles per Instruction",
+    "MetricName": "cpi",
+    "MetricExpr": "CPU_CYCLES / INSTRUCTIONS"
+  },
+  {
+    "BriefDescription": "Problem State Instruction Ratio",
+    "MetricName": "prbstate",
+    "MetricExpr": "(PROBLEM_STATE_INSTRUCTIONS / INSTRUCTIONS) * 100"
+  },
+  {
+    "BriefDescription": "Level One Miss per 100 Instructions",
+    "MetricName": "l1mp",
+    "MetricExpr": "((L1I_DIR_WRITES + L1D_DIR_WRITES) / INSTRUCTIONS) * 100"
   }
 ]
diff --git a/tools/perf/pmu-events/arch/s390/cf_z16/transaction.json b/tools/perf/pmu-events/arch/s390/cf_z16/transaction.json
index 1a0034f79f73..86bf83b4504e 100644
--- a/tools/perf/pmu-events/arch/s390/cf_z16/transaction.json
+++ b/tools/perf/pmu-events/arch/s390/cf_z16/transaction.json
@@ -3,5 +3,20 @@
     "BriefDescription": "Transaction count",
     "MetricName": "transaction",
     "MetricExpr": "TX_C_TEND + TX_NC_TEND + TX_NC_TABORT + TX_C_TABORT_SPECIAL + TX_C_TABORT_NO_SPECIAL"
+  },
+  {
+    "BriefDescription": "Cycles per Instruction",
+    "MetricName": "cpi",
+    "MetricExpr": "CPU_CYCLES / INSTRUCTIONS"
+  },
+  {
+    "BriefDescription": "Problem State Instruction Ratio",
+    "MetricName": "prbstate",
+    "MetricExpr": "(PROBLEM_STATE_INSTRUCTIONS / INSTRUCTIONS) * 100"
+  },
+  {
+    "BriefDescription": "Level One Miss per 100 Instructions",
+    "MetricName": "l1mp",
+    "MetricExpr": "((L1I_DIR_WRITES + L1D_DIR_WRITES) / INSTRUCTIONS) * 100"
   }
 ]
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2023-03-23 12:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-13  8:01 [PATCH 1/6] tools/perf/json: Add common metrics for s390 Thomas Richter
2023-03-13  8:01 ` [PATCH 2/6] tools/perf/json: Add cache metrics for s390 z16 Thomas Richter
2023-03-13 15:22   ` Ian Rogers
2023-03-13 18:33     ` Arnaldo Carvalho de Melo
2023-03-14  8:20       ` Thomas Richter
2023-03-14 16:34         ` Ian Rogers
2023-03-14 21:36           ` Arnaldo Carvalho de Melo
2023-03-22 20:59             ` Arnaldo Carvalho de Melo
2023-03-23  9:51               ` Thomas Richter
2023-03-23 10:06                 ` Heiko Carstens
2023-03-23 12:59                   ` Arnaldo Carvalho de Melo
2023-03-15  7:21           ` Thomas Richter
2023-03-13  8:01 ` [PATCH 3/6] tools/perf/json: Add cache metrics for s390 z15 Thomas Richter
2023-03-13 15:24   ` Ian Rogers
2023-03-13  8:01 ` [PATCH 4/6] tools/perf/json: Add cache metrics for s390 z14 Thomas Richter
2023-03-13 15:25   ` Ian Rogers
2023-03-13  8:02 ` [PATCH 5/6] tools/perf/json: Add cache metrics for s390 z13 Thomas Richter
2023-03-13 15:28   ` Ian Rogers
2023-03-13  8:02 ` [PATCH 6/6] tools/perf/json: Add metric for tlb and cache s390 Thomas Richter
2023-03-13 15:32   ` Ian Rogers
2023-03-13 15:21 ` [PATCH 1/6] tools/perf/json: Add common metrics for s390 Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).