SHA256
1
0
forked from pool/libpfm

Accepting request 567404 from devel:libraries:c_c++

- Add patch to build and work with python3:
  * libpfm-python3.patch
- Build the python parts using singlespec macros to allow switching
  as needed

- 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

OBS-URL: https://build.opensuse.org/request/show/567404
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libpfm?expand=0&rev=15
This commit is contained in:
Dominique Leuenberger 2018-01-20 10:19:42 +00:00 committed by Git OBS Bridge
commit 2e8869e896
9 changed files with 127 additions and 18907 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9193787a73201b4254e3669243fd71d15a9550486920861912090a09f366cf68
size 828853

3
libpfm-4.9.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:db0fbe8ee28fd9beeb5d3e80b7cb3b104debcf6a9fcf5cb8b882f0662c79e4e2
size 933147

63
libpfm-python3.patch Normal file
View File

@ -0,0 +1,63 @@
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))

View File

@ -1,3 +1,27 @@
-------------------------------------------------------------------
Wed Jan 17 15:52:07 UTC 2018 - tchvatal@suse.com
- 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 - tchvatal@suse.com
- 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
-------------------------------------------------------------------
Wed Aug 16 17:06:19 UTC 2017 - tonyj@suse.com

View File

@ -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 @@ Group: Development/Libraries/C and C++
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 @@ Requires: %{name}-devel = %{version}
%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 @@ sed -i \
%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 examples/showevtinfo \
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 @@ python -c 'import compileall; compileall.compile_dir("%{buildroot}%{python_sitea
%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 @@ python -c 'import compileall; compileall.compile_dir("%{buildroot}%{python_sitea
%{_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

View File

@ -1,59 +0,0 @@
From: Will Schmidt <will_schmidt@vnet.ibm.com>
Date: Tue, 6 Jun 2017 11:09:17 -0500
Subject: add power9 entries to validate_power.c
Git-repo: git://git.code.sf.net/p/perfmon2/libpfm4
Git-commit: ce5b320031f75f9a9881333c13902d5541f91cc8
References: FATE#322254
Signed-off-by: Tony Jones <tonyj@suse.de>
Hi,
Update the validate_power test to include power9 entries.
sniff-test run output:
$ ./validate
Libpfm structure tests:
libpfm ABI version : 0
pfm_pmu_info_t : Passed
pfm_event_info_t : Passed
pfm_event_attr_info_t : Passed
pfm_pmu_encode_arg_t : Passed
pfm_perf_encode_arg_t : Passed
Libpfm internal table tests:
<snip...>
checking power9 (946 events): Passed
Architecture specific tests:
20 PowerPC events: 0 errors
All tests passed
Signed-off-by: Will Schmidt <will_schmidt@vnet.ibm.com>
---
tests/validate_power.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tests/validate_power.c b/tests/validate_power.c
index 74ab30c..617efca 100644
--- a/tests/validate_power.c
+++ b/tests/validate_power.c
@@ -157,6 +157,20 @@ static const test_event_t ppc_test_events[]={
.codes[0] = 0xde200201e6ull,
.fstr = "power8::PM_RC_LIFETIME_EXC_32",
},
+ { SRC_LINE,
+ .name = "power9::PM_CYC",
+ .ret = PFM_SUCCESS,
+ .count = 1,
+ .codes[0] = 0x1001e,
+ .fstr = "power9::PM_CYC",
+ },
+ { SRC_LINE,
+ .name = "power9::PM_INST_DISP",
+ .ret = PFM_SUCCESS,
+ .count = 1,
+ .codes[0] = 0x200f2,
+ .fstr = "power9::PM_INST_DISP",
+ },
{ SRC_LINE,
.name = "powerpc_nest_mcs_read::MCS_00",
.ret = PFM_SUCCESS,

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@
From: Stephane Eranian <eranian@gmail.com>
Date: Fri, 2 Jun 2017 12:10:17 -0700
Subject: fix Power9 event file header
Git-repo: git://git.code.sf.net/p/perfmon2/libpfm4
Git-commit: 930ef5dbcc5d0d663979e16079aac12a7872d44d
References: FATE#322254
Signed-off-by: Tony Jones <tonyj@suse.de>
Had __POWER8_EVENTS_H__ instead of __POWER9_EVENTS_H__
Signed-off-by: Stephane Eranian <eranian@gmail.com>
---
lib/events/power9_events.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/events/power9_events.h b/lib/events/power9_events.h
index 7414687..765e9bd 100644
--- a/lib/events/power9_events.h
+++ b/lib/events/power9_events.h
@@ -20,7 +20,7 @@
*/
#ifndef __POWER9_EVENTS_H__
-#define __POWER8_EVENTS_H__
+#define __POWER9_EVENTS_H__
#define POWER9_PME_PM_IERAT_RELOAD 0
#define POWER9_PME_PM_TM_OUTER_TEND 1

File diff suppressed because it is too large Load Diff