Blame SOURCES/oprofile-zseries.patch

75c84f
From 966ef44b8c049b135773f1c6b71ab35b265e6356 Mon Sep 17 00:00:00 2001
75c84f
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
75c84f
Date: Mon, 23 May 2016 16:51:04 +0200
75c84f
Subject: [PATCH 18/18] s390: Add support for z13
75c84f
75c84f
On Wed, May 11 2016, Andreas Arnez wrote:
75c84f
75c84f
> So far oprofile supported z Systems (s390) machines up to zEC12.  This
75c84f
> adds support for z13 as well.
75c84f
>
75c84f
> Signed-off-by: Andreas Arnez <arnez@linux.vnet.ibm.com>
75c84f
> ---
75c84f
>  events/Makefile.am  | 3 ++-
75c84f
>  libop/op_cpu_type.c | 3 +++
75c84f
>  libop/op_cpu_type.h | 1 +
75c84f
>  libop/op_events.c   | 1 +
75c84f
>  utils/ophelp.c      | 1 +
75c84f
>  5 files changed, 8 insertions(+), 1 deletion(-)
75c84f
75c84f
Oops, that patch lacked the files in the new directory
75c84f
"events/s390/z13".  Corrected version below.  Is this OK?
75c84f
75c84f
-- >8 --
75c84f
Subject: [PATCH] s390: Add support for z13
75c84f
75c84f
So far oprofile supported z Systems (s390) machines up to zEC12.  This
75c84f
adds support for z13 as well.
75c84f
75c84f
Signed-off-by: Andreas Arnez <arnez@linux.vnet.ibm.com>
75c84f
---
75c84f
 events/Makefile.am         | 3 ++-
75c84f
 events/s390/z13/events     | 8 ++++++++
75c84f
 events/s390/z13/unit_masks | 7 +++++++
75c84f
 libop/op_cpu_type.c        | 3 +++
75c84f
 libop/op_cpu_type.h        | 1 +
75c84f
 libop/op_events.c          | 1 +
75c84f
 utils/ophelp.c             | 1 +
75c84f
 7 files changed, 23 insertions(+), 1 deletion(-)
75c84f
 create mode 100644 events/s390/z13/events
75c84f
 create mode 100644 events/s390/z13/unit_masks
75c84f
75c84f
diff --git a/events/Makefile.am b/events/Makefile.am
75c84f
index 677b05f..29d4b5f 100644
75c84f
--- a/events/Makefile.am
75c84f
+++ b/events/Makefile.am
75c84f
@@ -81,7 +81,8 @@ event_files = \
75c84f
 	tile/tilegx/events tile/tilegx/unit_masks \
75c84f
 	s390/z10/events s390/z10/unit_masks \
75c84f
 	s390/z196/events s390/z196/unit_masks \
75c84f
-	s390/zEC12/events s390/zEC12/unit_masks
75c84f
+	s390/zEC12/events s390/zEC12/unit_masks \
75c84f
+	s390/z13/events s390/z13/unit_masks
75c84f
 
75c84f
 install-data-local:
75c84f
 	for i in ${event_files} ; do \
75c84f
diff --git a/events/s390/z13/events b/events/s390/z13/events
75c84f
new file mode 100644
75c84f
index 0000000..313f5b0
75c84f
--- /dev/null
75c84f
+++ b/events/s390/z13/events
75c84f
@@ -0,0 +1,8 @@
75c84f
+# Copyright OProfile authors
75c84f
+# Copyright (c) International Business Machines, 2016.
75c84f
+# Contributed by Andreas Arnez <arnez@linux.vnet.ibm.com>.
75c84f
+#
75c84f
+# IBM Enterprise z13 events for operf/ocount
75c84f
+#
75c84f
+event:0x00 counters:0 um:zero minimum:19264 name:CPU_CYCLES : Processor cycles
75c84f
+event:0x01 counters:0 um:zero minimum:19264 name:INSTRUCTIONS : Instructions completed
75c84f
diff --git a/events/s390/z13/unit_masks b/events/s390/z13/unit_masks
75c84f
new file mode 100644
75c84f
index 0000000..4cf2842
75c84f
--- /dev/null
75c84f
+++ b/events/s390/z13/unit_masks
75c84f
@@ -0,0 +1,7 @@
75c84f
+# Copyright OProfile authors
75c84f
+# Copyright (c) International Business Machines, 2016.
75c84f
+# Contributed by Andreas Arnez <arnez@linux.vnet.ibm.com>.
75c84f
+#
75c84f
+# S/390 Basic Mode Hardware Sampling unit masks
75c84f
+#
75c84f
+include:s390/z10
75c84f
diff --git a/libop/op_cpu_type.c b/libop/op_cpu_type.c
75c84f
index 7bdde53..e70e4f6 100644
75c84f
--- a/libop/op_cpu_type.c
75c84f
+++ b/libop/op_cpu_type.c
75c84f
@@ -123,6 +123,7 @@ static struct cpu_descr const cpu_descrs[MAX_CPU_TYPE] = {
75c84f
 	{ "ARM Cortex-A53", "arm/armv8-ca53", CPU_ARM_V8_CA53, 6},
75c84f
 	{ "Intel Skylake microarchitecture", "i386/skylake", CPU_SKYLAKE, 4 },
75c84f
 	{ "Intel Goldmont microarchitecture", "i386/goldmont", CPU_GOLDMONT, 4 },
75c84f
+	{ "IBM z13", "s390/z13", CPU_S390_Z13, 1 },
75c84f
 };
75c84f
  
75c84f
 static size_t const nr_cpu_descrs = sizeof(cpu_descrs) / sizeof(struct cpu_descr);
75c84f
@@ -680,6 +681,8 @@ static op_cpu _get_s390_cpu_type(void)
75c84f
 	case 2827:
75c84f
 	case 2828:
75c84f
 		return CPU_S390_ZEC12;
75c84f
+	case 2964:
75c84f
+		return CPU_S390_Z13;
75c84f
 	}
75c84f
 	return CPU_NO_GOOD;
75c84f
 }
75c84f
diff --git a/libop/op_cpu_type.h b/libop/op_cpu_type.h
75c84f
index 98289c5..4f896a0 100644
75c84f
--- a/libop/op_cpu_type.h
75c84f
+++ b/libop/op_cpu_type.h
75c84f
@@ -103,6 +103,7 @@ typedef enum {
75c84f
 	CPU_ARM_V8_CA53, /* ARM Cortex-A53 */
75c84f
 	CPU_SKYLAKE, /** < Intel Skylake microarchitecture */
75c84f
 	CPU_GOLDMONT, /** < Intel Goldmont microarchitecture */
75c84f
+	CPU_S390_Z13, /** < IBM z13 */
75c84f
 	MAX_CPU_TYPE
75c84f
 } op_cpu;
75c84f
 
75c84f
diff --git a/libop/op_events.c b/libop/op_events.c
75c84f
index cdd0409..ea6ced3 100644
75c84f
--- a/libop/op_events.c
75c84f
+++ b/libop/op_events.c
75c84f
@@ -1307,6 +1307,7 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr)
75c84f
 		case CPU_S390_Z10:
75c84f
 		case CPU_S390_Z196:
75c84f
 		case CPU_S390_ZEC12:
75c84f
+		case CPU_S390_Z13:
75c84f
 			descr->name = "CPU_CYCLES";
75c84f
 			descr->count = 4127518;
75c84f
 			break;
75c84f
diff --git a/utils/ophelp.c b/utils/ophelp.c
75c84f
index 5821593..3cb1c08 100644
75c84f
--- a/utils/ophelp.c
75c84f
+++ b/utils/ophelp.c
75c84f
@@ -779,6 +779,7 @@ int main(int argc, char const * argv[])
75c84f
 	case CPU_S390_Z10:
75c84f
 	case CPU_S390_Z196:
75c84f
 	case CPU_S390_ZEC12:
75c84f
+	case CPU_S390_Z13:
75c84f
 		event_doc = "IBM System z CPU Measurement Facility\n"
75c84f
 				"http://www-01.ibm.com/support/docview.wss"
75c84f
 				"?uid=isg26fcd1cc32246f4c8852574ce0044734a\n";
75c84f
-- 
75c84f
2.7.4
75c84f