From 4d81b17a3b7c4dd6b69e833113012b53522c66dd Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 21 Jan 2020 10:57:42 -0500 Subject: [PATCH] import libpfm-4.10.1-2.el8 --- .gitignore | 1 + .libpfm.metadata | 1 + SOURCES/libpfm-python3-setup.patch | 10 ++ SOURCES/libpfm-zseries.patch | 128 +++++++++++++++ SPECS/libpfm.spec | 253 +++++++++++++++++++++++++++++ 5 files changed, 393 insertions(+) create mode 100644 .gitignore create mode 100644 .libpfm.metadata create mode 100644 SOURCES/libpfm-python3-setup.patch create mode 100644 SOURCES/libpfm-zseries.patch create mode 100644 SPECS/libpfm.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..23384cf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libpfm-4.10.1.tar.gz diff --git a/.libpfm.metadata b/.libpfm.metadata new file mode 100644 index 0000000..a67ca84 --- /dev/null +++ b/.libpfm.metadata @@ -0,0 +1 @@ +78599e1668142f48c24afb1f79ca00a89df51b65 SOURCES/libpfm-4.10.1.tar.gz diff --git a/SOURCES/libpfm-python3-setup.patch b/SOURCES/libpfm-python3-setup.patch new file mode 100644 index 0000000..f43187a --- /dev/null +++ b/SOURCES/libpfm-python3-setup.patch @@ -0,0 +1,10 @@ +diff --git a/python/setup.py b/python/setup.py +index eda8fa5..dff0f27 100755 +--- a/python/setup.py ++++ b/python/setup.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + from distutils.core import setup, Extension + from distutils.command.install_data import install_data 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 new file mode 100644 index 0000000..25bc028 --- /dev/null +++ b/SPECS/libpfm.spec @@ -0,0 +1,253 @@ +%bcond_without python +%if %{with python} +%define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") +%define python_prefix %(python3 -c "import sys; print (sys.prefix)") +%{?filter_setup: +%filter_provides_in %{python_sitearch}/perfmon/.*\.so$ +%filter_setup +} +%endif + +Name: libpfm +Version: 4.10.1 +Release: 2%{?dist} + +Summary: Library to encode performance events for use by perf tool + +Group: System Environment/Libraries +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 +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: swig +%endif + +%description + +libpfm4 is a library to help encode events for use with operating system +kernels performance monitoring interfaces. The current version provides support +for the perf_events interface available in upstream Linux kernels since v2.6.31. + +%package devel +Summary: Development library to encode performance events for perf_events based tools +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Development library and header files to create performance monitoring +applications for the perf_events interface. + +%package static +Summary: Static library to encode performance events for perf_events based tools +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description static +Static version of the libpfm library for performance monitoring +applications for the perf_events interface. + +%if %{with python} +%package -n python3-libpfm +%{?python_provide:%python_provide python3-libpfm} +# Remove before F30 +Provides: %{name}-python = %{version}-%{release} +Provides: %{name}-python%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-python < %{version}-%{release} +Summary: Python bindings for libpfm and perf_event_open system call +Group: Development/Languages +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description -n python3-libpfm +Python bindings for libpfm4 and perf_event_open system call. +%endif + +%prep +%setup -q +%patch2 -p1 -b .python3 +%patch3 -p1 -b .zseries + +%build +%if %{with python} +%global python_config CONFIG_PFMLIB_NOPYTHON=n +%else +%global python_config CONFIG_PFMLIB_NOPYTHON=y +%endif +make %{python_config} %{?_smp_mflags} \ + OPTIM="%{optflags}" LDFLAGS="%{build_ldflags}" + + +%install +rm -rf $RPM_BUILD_ROOT + +%if %{with python} +%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=$RPM_BUILD_ROOT/%{python_prefix} +%else +%global python_config CONFIG_PFMLIB_NOPYTHON=y +%endif + +make \ + PREFIX=$RPM_BUILD_ROOT%{_prefix} \ + LIBDIR=$RPM_BUILD_ROOT%{_libdir} \ + %{python_config} \ + LDCONFIG=/bin/true \ + install + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%doc README +%{_libdir}/lib*.so.* + +%files devel +%{_includedir}/* +%{_mandir}/man3/* +%{_libdir}/lib*.so + +%files static +%{_libdir}/lib*.a + +%if %{with python} +%files -n python3-libpfm +%{python_sitearch}/* +%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. + +* Tue Jun 12 2018 William Cohen - 4.10.0-2 +- Use upstream libpfm cavium patch. + +* Fri Jun 8 2018 William Cohen - 4.10.0-1 +- Rebase on libpfm-4.10.0. +- Use Python 3. + +* Mon Feb 26 2018 Fedora Release Engineering - 4.9.0-6 +- Pass in LDFLAGS for build. + +* Wed Feb 07 2018 Fedora Release Engineering - 4.9.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Jan 30 2018 William Cohen - 4.9.0-4 +- Address truncation issues. + +* Tue Jan 30 2018 William Cohen - 4.9.0-3 +- Use the RPM build flags. (RHBZ #1540262) + +* Tue Jan 09 2018 Iryna Shcherbina - 4.9.0-2 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Thu Jan 4 2018 William Cohen - 4.9.0-1 +- Rebase on libpfm-4.9.0. + +* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek - 4.8.0-8 +- Add Provides for the old name without %%_isa + +* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 4.8.0-7 +- Python 2 binary package renamed to python2-libpfm + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 + +* Thu Aug 03 2017 Fedora Release Engineering - 4.8.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 4.8.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Jul 07 2017 Igor Gnatenko - 4.8.0-4 +- Rebuild due to bug in RPM (RHBZ #1468476) + +* Fri Feb 10 2017 Fedora Release Engineering - 4.8.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Nov 7 2016 William Cohen - 4.8.0-1 +- Rebase on libpfm-4.8.0. + +* Tue Jul 19 2016 Fedora Release Engineering - 4.7.0-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Thu Feb 11 2016 William Cohen - 4.7.0-1 +- Rebase on libpfm-4.7.0. + +* Thu Feb 04 2016 Fedora Release Engineering - 4.6.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 4.6.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu Jun 4 2015 William Cohen - 4.6.0-2 +- Correct requires for subpackages. + +* Thu Mar 5 2015 William Cohen - 4.6.0-1 +- Rebase on libpfm-4.6.0. + +* Wed Feb 11 2015 William Cohen - 4.5.0-6 +- Bump version and rebuild. + +* Sun Aug 17 2014 Fedora Release Engineering - 4.5.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Mon Jun 30 2014 Toshio Kuratomi - 4.5.0-4 +- Replace python-setuptools-devel BR with python-setuptools + +* Sat Jun 07 2014 Fedora Release Engineering - 4.5.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri May 23 2014 William Cohen 4.5.0-2 +- Add cortex a53 support. + +* Fri May 23 2014 William Cohen 4.5.0-1 +- Rebase on libpfm-4.5.0. + +* Sat Aug 03 2013 Fedora Release Engineering - 4.4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Fri Jul 19 2013 William Cohen 4.4.0-2 +- Add IBM power 8 support. + +* Mon Jun 17 2013 William Cohen 4.4.0-1 +- Rebase on libpfm-4.4.0. + +* Thu Feb 14 2013 Fedora Release Engineering - 4.3.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Aug 28 2012 William Cohen 4.3.0-2 +- Turn off LDCONFIG and remove patch. + +* Tue Aug 28 2012 William Cohen 4.3.0-1 +- Rebase on libpfm-4.3.0. + +* Thu Jul 19 2012 Fedora Release Engineering - 4.2.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jun 8 2012 William Cohen 4.2.0-7 +- Eliminate swig error. + +* Thu Jun 7 2012 William Cohen 4.2.0-6 +- Eliminate rpm_build_root macro in build section. +- Correct location of shared library files. + +* Thu Jun 7 2012 William Cohen 4.2.0-5 +- Use siginfo_t for some examples. + +* Mon Jun 4 2012 William Cohen 4.2.0-4 +- Correct python files. + +* Wed Mar 28 2012 William Cohen 4.2.0-3 +- Additional spec file fixup for rhbz804666. + +* Wed Mar 14 2012 William Cohen 4.2.0-2 +- Some spec file fixup. + +* Wed Jan 12 2011 Arun Sharma 4.2.0-0 +Initial revision