Hello community, here is the log from the commit of package libpfm for openSUSE:Factory checked in at 2018-01-20 11:19:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libpfm (Old) and /work/SRC/openSUSE:Factory/.libpfm.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libpfm" Sat Jan 20 11:19:42 2018 rev:15 rq:567404 version:4.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libpfm/libpfm.changes 2017-08-24 18:27:38.014721325 +0200 +++ /work/SRC/openSUSE:Factory/.libpfm.new/libpfm.changes 2018-01-20 11:19:44.731916075 +0100 @@ -1,0 +2,24 @@ +Wed Jan 17 15:52:07 UTC 2018 - [email protected] + +- Add patch to build and work with python3: + * libpfm-python3.patch +- Build the python parts using singlespec macros to allow switching + as needed + +------------------------------------------------------------------- +Wed Jan 17 15:30:33 UTC 2018 - [email protected] + +- Update to 4.9.0: + * Intel Broadwell EP uncore PMUs support (all PMU boxes) + * AMD Fam17h (Zen) core PMU support + * IBM Power9 core PMU support + * AMD Fam16h (Jaguar) support + * various event table updates + * various bug fixes +- Drop upstream merged patches: + * libpfm_add-power9-entries-to-validate_power-c.patch + * libpfm_enable-ibm-power9-core-pmu-support-beta.patch + * libpfm_fix-power9-event-file-header.patch + * libpfm_power9-event-list-update-for-perfmon2.patch + +------------------------------------------------------------------- Old: ---- libpfm-4.8.0.tar.gz libpfm_add-power9-entries-to-validate_power-c.patch libpfm_enable-ibm-power9-core-pmu-support-beta.patch libpfm_fix-power9-event-file-header.patch libpfm_power9-event-list-update-for-perfmon2.patch New: ---- libpfm-4.9.0.tar.gz libpfm-python3.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libpfm.spec ++++++ --- /var/tmp/diff_new_pack.APqQvg/_old 2018-01-20 11:19:45.795866335 +0100 +++ /var/tmp/diff_new_pack.APqQvg/_new 2018-01-20 11:19:45.795866335 +0100 @@ -1,7 +1,7 @@ # # spec file for package libpfm # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,9 +16,12 @@ # +%global python_config CONFIG_PFMLIB_NOPYTHON=y +%bcond_without python2 +%{?!python_module:%define python_module() python-%{**} python3-%{**}} %define vname libpfm4 Name: libpfm -Version: 4.8.0 +Version: 4.9.0 Release: 0 Summary: Library to encode performance events License: MIT @@ -26,14 +29,11 @@ Url: http://perfmon2.sourceforge.net/ Source: http://downloads.sourceforge.net/project/perfmon2/libpfm4/%{name}-%{version}.tar.gz Source1: baselibs.conf -Patch1: libpfm_enable-ibm-power9-core-pmu-support-beta.patch -Patch2: libpfm_fix-power9-event-file-header.patch -Patch3: libpfm_power9-event-list-update-for-perfmon2.patch -Patch4: libpfm_add-power9-entries-to-validate_power-c.patch - -BuildRequires: python-devel +Patch0: libpfm-python3.patch +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: python-rpm-macros BuildRequires: swig >= 2.0.5 -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description This package provides a library that can be used to encode events into the @@ -70,20 +70,26 @@ %description devel-static This package contains the static variant of libpfm. -%package -n python-%{name} +%package -n python2-%{name} Summary: Python bindings for libpfm and perf_event_open system call Group: Development/Libraries/Python Requires: %{vname} = %{version} -%description -n python-%{name} +%description -n python2-%{name} This package provides python bindings for the libpfm4 package and the perf_event_open system call. +%package -n python3-%{name} +Summary: Python3 bindings for libpfm and perf_event_open system call +Group: Development/Libraries/Python +Requires: %{vname} = %{version} + +%description -n python3-%{name} +This package provides python3 bindings for the libpfm4 package and the perf_event_open system call. + + %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 +%patch0 -p1 # disable werror sed -i \ -e 's:-Werror::g' \ @@ -91,11 +97,14 @@ %build export CFLAGS="%{optflags}" -%global python_config CONFIG_PFMLIB_NOPYTHON=n make %{?_smp_mflags} %{python_config} +pushd python +%python_build +popd + %install -%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX="%{buildroot}/%{py_prefix}" +%global python_config %{python_config} make \ PREFIX="%{buildroot}/%{_prefix}" \ LIBDIR="%{buildroot}/%{_libdir}" \ @@ -109,6 +118,10 @@ install -D -p -m 0755 perf_examples/evt2raw \ %{buildroot}/%{_bindir}/evt2raw +pushd python +%python_install +popd + # temp hack to fix rpmlint file-contains-buildroot for *.pyc # http://lists.opensuse.org/opensuse-factory/2012-01/msg00235.html find "%{buildroot}/%{python_sitearch}/" -name '*.pyc' -delete @@ -118,12 +131,10 @@ %postun -n %{vname} -p /sbin/ldconfig %files -n %{vname} -%defattr(-,root,root) %doc README %{_libdir}/libpfm.so.* %files devel -%defattr(-,root,root) %{_includedir}/* %{_mandir}/man3/* %{_libdir}/lib*.so @@ -132,11 +143,14 @@ %{_bindir}/evt2raw %files devel-static -%defattr(-,root,root) %{_libdir}/lib*.a -%files -n python-%{name} -%defattr(-,root,root) -%{python_sitearch}/* +%if %{with python2} +%files -n python2-%{name} +%{python2_sitearch}/* +%endif + +%files -n python3-%{name} +%{python3_sitearch}/* %changelog ++++++ libpfm-4.8.0.tar.gz -> libpfm-4.9.0.tar.gz ++++++ ++++ 22392 lines of diff (skipped) ++++++ libpfm-python3.patch ++++++ Index: libpfm-4.9.0/python/src/pmu.py =================================================================== --- libpfm-4.9.0.orig/python/src/pmu.py +++ libpfm-4.9.0/python/src/pmu.py @@ -26,7 +26,7 @@ from perfmon import * def public_members(self): s = "{ " - for k, v in self.__dict__.iteritems(): + for k, v in self.__dict__.items(): if not k[0] == '_': s += "%s : %s, " % (k, v) s += " }" @@ -94,8 +94,8 @@ if __name__ == '__main__': for pmu in s.pmus: info = pmu.info if info.flags.is_present: - print info.name, info.size, info.nevents + print(info.name, info.size, info.nevents) for e in pmu.events(): - print e.info.name, e.info.code + print(e.info.name, e.info.code) for a in e.attrs(): - print '\t\t', a.name, a.code + print('\t\t', a.name, a.code) Index: libpfm-4.9.0/python/sys.py =================================================================== --- libpfm-4.9.0.orig/python/sys.py +++ libpfm-4.9.0/python/sys.py @@ -48,7 +48,7 @@ if __name__ == '__main__': if options.events: events = options.events.split(",") else: - raise "You need to specify events to monitor" + raise Exception("You need to specify events to monitor") s = perfmon.SystemWideSession(cpus, events) @@ -60,4 +60,4 @@ if __name__ == '__main__': for c in cpus: for i in range(0, len(events)): count = struct.unpack("L", s.read(c, i))[0] - print """CPU%d: %s\t%lu""" % (c, events[i], count) + print("""CPU%d: %s\t%lu""" % (c, events[i], count)) Index: libpfm-4.9.0/python/self.py =================================================================== --- libpfm-4.9.0.orig/python/self.py +++ libpfm-4.9.0/python/self.py @@ -40,7 +40,7 @@ if __name__ == '__main__': if options.events: events = options.events.split(",") else: - raise "You need to specify events to monitor" + raise Exception("You need to specify events to monitor") s = perfmon.PerThreadSession(int(os.getpid()), events) s.start() @@ -55,4 +55,4 @@ if __name__ == '__main__': # read the counts for i in range(0, len(events)): count = struct.unpack("L", s.read(i))[0] - print """%s\t%lu""" % (events[i], count) + print("""%s\t%lu""" % (events[i], count))
