From f0d6df5e0115c339ae31c07f09c6a9a2ee30bea1 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 28 Apr 2020 04:51:59 -0400 Subject: [PATCH] import libpfm-4.10.1-2.el8 --- SOURCES/libpfm-zseries.patch | 128 +++++++++++++++++++++++++++++++++++ SPECS/libpfm.spec | 7 +- 2 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 SOURCES/libpfm-zseries.patch diff --git a/SOURCES/libpfm-zseries.patch b/SOURCES/libpfm-zseries.patch new file mode 100644 index 0000000..e85419f --- /dev/null +++ b/SOURCES/libpfm-zseries.patch @@ -0,0 +1,128 @@ +commit dc643f4a460063a628b4bfba57dbbb36673a0789 +Author: Thomas Richter +Date: Thu Jul 11 17:48:03 2019 -0700 + + s390/cpumf: add IBM z14 ZR1 support + + Add support for machine type 0x3907. + + Signed-off-by: Thomas Richter + +diff --git a/lib/pfmlib_s390x_cpumf.c b/lib/pfmlib_s390x_cpumf.c +index 4e03fc4..7566aa0 100644 +--- a/lib/pfmlib_s390x_cpumf.c ++++ b/lib/pfmlib_s390x_cpumf.c +@@ -192,6 +192,7 @@ static int pfm_cpumcf_init(void *this) + ext_set_count = LIBPFM_ARRAY_SIZE(cpumcf_z13_counters); + break; + case 3906: /* IBM z14 */ ++ case 3907: /* IBM z14 ZR1 */ + ext_set = cpumcf_z14_counters; + ext_set_count = LIBPFM_ARRAY_SIZE(cpumcf_z14_counters); + break; +commit c08003fb085e23f2229e58cc176fcfcf58a3b238 +Author: Thomas Richter +Date: Thu Jul 11 17:49:42 2019 -0700 + + s390/cpumf: add support for counter second version number 6 + + IBM added secound version number 6 in the CPU Measurement + Counter facility to indicate additional counters in the + crypto counter set. + + Signed-off-by: Thomas Richter + +diff --git a/lib/events/s390x_cpumf_events.h b/lib/events/s390x_cpumf_events.h +index 8be1d55..8587a3b 100644 +--- a/lib/events/s390x_cpumf_events.h ++++ b/lib/events/s390x_cpumf_events.h +@@ -13,6 +13,8 @@ + #define CPUMF_CTRSET_EXTENDED 1 + #define CPUMF_CTRSET_MT_DIAG 32 + ++#define CPUMF_SVN6_ECC 4 ++ + + static const pme_cpumf_ctr_t cpumcf_fvn1_counters[] = { + { +@@ -270,6 +272,43 @@ static const pme_cpumf_ctr_t cpumcf_svn_generic_counters[] = { + " coprocessor is busy performing a function issued by" + " another CPU", + }, ++ { ++ .ctrnum = 80, ++ .ctrset = CPUMF_CTRSET_CRYPTO, ++ .name = "ECC_FUNCTION_COUNT", ++ .desc = "This counter counts the" ++ " total number of the elliptic-curve cryptography (ECC)" ++ " functions issued by the CPU.", ++ }, ++ { ++ .ctrnum = 81, ++ .ctrset = CPUMF_CTRSET_CRYPTO, ++ .name = "ECC_CYCLES_COUNT", ++ .desc = "This counter counts the total" ++ " number of CPU cycles when the ECC coprocessor is" ++ " busy performing the elliptic-curve cryptography" ++ " (ECC) functions issued by the CPU.", ++ }, ++ { ++ .ctrnum = 82, ++ .ctrset = CPUMF_CTRSET_CRYPTO, ++ .name = "ECC_BLOCKED_FUNCTION_COUNT", ++ .desc = "This counter counts the total number of the" ++ " elliptic-curve cryptography (ECC) functions that are" ++ " issued by the CPU and are blocked because the ECC" ++ " coprocessor is busy performing a function issued by" ++ " another CPU.", ++ }, ++ { ++ .ctrnum = 83, ++ .ctrset = CPUMF_CTRSET_CRYPTO, ++ .name = "ECC_BLOCKED_CYCLES_COUNT", ++ .desc = "This counter counts the total number of CPU cycles " ++ " blocked for the elliptic-curve cryptography (ECC) " ++ " functions issued by the CPU because the ECC" ++ " coprocessor is busy perform ing a function issued" ++ " by another CPU.", ++ }, + }; + + static const pme_cpumf_ctr_t cpumcf_z10_counters[] = { +diff --git a/lib/pfmlib_s390x_cpumf.c b/lib/pfmlib_s390x_cpumf.c +index 7566aa0..e68b000 100644 +--- a/lib/pfmlib_s390x_cpumf.c ++++ b/lib/pfmlib_s390x_cpumf.c +@@ -168,6 +168,8 @@ static int pfm_cpumcf_init(void *this) + /* counters based on second version number */ + csvn_set = cpumcf_svn_generic_counters; + csvn_set_count = LIBPFM_ARRAY_SIZE(cpumcf_svn_generic_counters); ++ if (csvn < 6) /* Crypto counter set enlarged for SVN == 6 */ ++ csvn_set_count -= CPUMF_SVN6_ECC; + + /* check and assign a machine-specific extended counter set */ + switch (get_machine_type()) { +commit b831b04254ac7fd1700b20b349799810952ff66e +Author: Thomas Richter +Date: Thu Jul 11 17:51:03 2019 -0700 + + s390/cpumf: add support for machine type 8561 + + Add extended counter set support for s390 machine types + 8561 and 8562. + + Signed-off-by: Thomas Richter + +diff --git a/lib/pfmlib_s390x_cpumf.c b/lib/pfmlib_s390x_cpumf.c +index e68b000..c11f9d9 100644 +--- a/lib/pfmlib_s390x_cpumf.c ++++ b/lib/pfmlib_s390x_cpumf.c +@@ -195,6 +195,8 @@ static int pfm_cpumcf_init(void *this) + break; + case 3906: /* IBM z14 */ + case 3907: /* IBM z14 ZR1 */ ++ case 8561: /* IBM Machine types 8561 and 8562 */ ++ case 8562: + ext_set = cpumcf_z14_counters; + ext_set_count = LIBPFM_ARRAY_SIZE(cpumcf_z14_counters); + break; diff --git a/SPECS/libpfm.spec b/SPECS/libpfm.spec index 1337b04..25bc028 100644 --- a/SPECS/libpfm.spec +++ b/SPECS/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -19,6 +19,7 @@ License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch +Patch3: libpfm-zseries.patch %if %{with python} BuildRequires: python3 @@ -69,6 +70,7 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q %patch2 -p1 -b .python3 +%patch3 -p1 -b .zseries %build %if %{with python} @@ -117,6 +119,9 @@ make \ %endif %changelog +* Tue Oct 15 2019 William Cohen - 4.10.1-2 +- Add IBM zseries support. (RHBZ #1731019) + * Fri Jun 15 2018 William Cohen - 4.10.1-1 - Rebase on libpfm-4.10.1.