f1d3e6
%bcond_without python
f1d3e6
%if %{with python}
f1d3e6
%define python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
f1d3e6
%define python_prefix %(python -c "import sys; print sys.prefix")
f1d3e6
%{?filter_setup:
f1d3e6
%filter_provides_in %{python_sitearch}/perfmon/.*\.so$
f1d3e6
%filter_setup
f1d3e6
}
f1d3e6
%endif
f1d3e6
f1d3e6
Name:		libpfm
b8e619
Version:	4.7.0
2671f5
Release:	10%{?dist}
f1d3e6
f1d3e6
Summary:	Library to encode performance events for use by perf tool
f1d3e6
f1d3e6
Group:		System Environment/Libraries
f1d3e6
License:	MIT
f1d3e6
URL:		http://perfmon2.sourceforge.net/
f1d3e6
Source0:	http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz
4e2f91
Patch1: libpfm-updates.patch
4e2f91
Patch2: libpfm-rhbz1440249.patch
55cf49
Patch3: libpfm-power9.patch
55cf49
Patch4: libpfm-bdx_unc.patch
55cf49
Patch5: libpfm-p9_alt.patch
55cf49
Patch6: libpfm-p9_uniq.patch
55cf49
Patch7: libpfm-intel_1port.patch
2671f5
Patch8: libpfm-s390.patch
f1d3e6
f1d3e6
%if %{with python}
f1d3e6
BuildRequires:	python-devel
f1d3e6
BuildRequires:	python-setuptools-devel
f1d3e6
BuildRequires:	swig
f1d3e6
%endif
f1d3e6
f1d3e6
%description
f1d3e6
f1d3e6
libpfm4 is a library to help encode events for use with operating system
f1d3e6
kernels performance monitoring interfaces. The current version provides support
f1d3e6
for the perf_events interface available in upstream Linux kernels since v2.6.31.
f1d3e6
f1d3e6
%package devel
f1d3e6
Summary:	Development library to encode performance events for perf_events based tools
f1d3e6
Group:		Development/Libraries
8ac2aa
Requires:	%{name}%{?_isa} = %{version}-%{release}
f1d3e6
f1d3e6
%description devel
f1d3e6
Development library and header files to create performance monitoring
f1d3e6
applications for the perf_events interface.
f1d3e6
f1d3e6
%package static
f1d3e6
Summary:	Static library to encode performance events for perf_events based tools
f1d3e6
Group:		Development/Libraries
8ac2aa
Requires:	%{name}%{?_isa} = %{version}-%{release}
f1d3e6
f1d3e6
%description static
f1d3e6
Static version of the libpfm library for performance monitoring
f1d3e6
applications for the perf_events interface.
f1d3e6
f1d3e6
%if %{with python}
f1d3e6
%package python
f1d3e6
Summary:	Python bindings for libpfm and perf_event_open system call
f1d3e6
Group:		Development/Languages
8ac2aa
Requires:	%{name}%{?_isa} = %{version}-%{release}
f1d3e6
f1d3e6
%description python
f1d3e6
Python bindings for libpfm4 and perf_event_open system call.
f1d3e6
%endif
f1d3e6
f1d3e6
%prep
f1d3e6
%setup -q
4e2f91
%patch1 -p1
4e2f91
%patch2 -p1
55cf49
%patch3 -p1
55cf49
%patch4 -p1
55cf49
%patch5 -p 1 -b .p9_alt
55cf49
%patch6 -p 1 -b .p9_uniq
55cf49
%patch7 -p 1 -b .1port
2671f5
%patch8 -p 1 -b .s390
f1d3e6
f1d3e6
%build
f1d3e6
%if %{with python}
f1d3e6
%global python_config CONFIG_PFMLIB_NOPYTHON=n
f1d3e6
%else
f1d3e6
%global python_config CONFIG_PFMLIB_NOPYTHON=y
f1d3e6
%endif
f1d3e6
make %{python_config} %{?_smp_mflags}
f1d3e6
f1d3e6
f1d3e6
%install
f1d3e6
rm -rf $RPM_BUILD_ROOT
f1d3e6
f1d3e6
%if %{with python}
f1d3e6
%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=$RPM_BUILD_ROOT/%{python_prefix}
f1d3e6
%else
f1d3e6
%global python_config CONFIG_PFMLIB_NOPYTHON=y
f1d3e6
%endif
f1d3e6
f1d3e6
make \
f1d3e6
    PREFIX=$RPM_BUILD_ROOT%{_prefix} \
f1d3e6
    LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
f1d3e6
    %{python_config} \
f1d3e6
    LDCONFIG=/bin/true \
f1d3e6
    install
f1d3e6
f1d3e6
%post -p /sbin/ldconfig
f1d3e6
%postun	-p /sbin/ldconfig
f1d3e6
f1d3e6
%files
f1d3e6
%doc README
f1d3e6
%{_libdir}/lib*.so.*
f1d3e6
f1d3e6
%files devel
f1d3e6
%{_includedir}/*
f1d3e6
%{_mandir}/man3/*
f1d3e6
%{_libdir}/lib*.so
f1d3e6
f1d3e6
%files static
f1d3e6
%{_libdir}/lib*.a
f1d3e6
f1d3e6
%if %{with python}
f1d3e6
%files python
f1d3e6
%{python_sitearch}/*
f1d3e6
%endif
f1d3e6
f1d3e6
%changelog
2671f5
* Mon Apr 16 2018 William Cohen <wcohen@redhat.com> - 4.7.0-10
2671f5
- Add support for z13/z13s. rhbz1548505
2671f5
55cf49
* Tue Dec 5 2017 William Cohen <wcohen@redhat.com> - 4.7.0-9
55cf49
- Correct x86 unit mask naming. rhbz1521076
55cf49
55cf49
* Mon Dec 4 2017 William Cohen <wcohen@redhat.com> - 4.7.0-8
55cf49
- Update IBM Power 9 events. rhbz1510684
55cf49
55cf49
* Wed Nov 29 2017 William Cohen <wcohen@redhat.com> - 4.7.0-7
55cf49
- Update IBM Power 9 events. rhbz1510684
55cf49
55cf49
* Mon Sep 25 2017 William Cohen <wcohen@redhat.com> - 4.7.0-6
55cf49
- Add access to Broadwell Uncore Counters. rhbz1474999
55cf49
55cf49
* Tue Jun 20 2017 William Cohen <wcohen@redhat.com> - 4.7.0-5
55cf49
- Add IBM Power9 support.
55cf49
4e2f91
* Wed Apr 12 2017 William Cohen <wcohen@redhat.com> - 4.7.0-4
4e2f91
- Correct handling of raw offcore umask handling. rhbz1440249
4e2f91
4e2f91
* Thu Mar 23 2017 William Cohen <wcohen@redhat.com> - 4.7.0-3
4e2f91
- Avoid ABI breakage caused by some Intel KNL related patches. rhbz1412950
4e2f91
4e2f91
* Tue Mar 21 2017 William Cohen <wcohen@redhat.com> - 4.7.0-2
4e2f91
- Updates for IBM Power and Intel KNL. rhbz1385009, rhbz1412950
4e2f91
b8e619
* Thu May 12 2016 William Cohen <wcohen@redhat.com> - 4.7.0-1
b8e619
- Rebase to libpfm-4.7.0.
b8e619
8ac2aa
* Thu Jun 4 2015 William Cohen <wcohen@redhat.com> - 4.4.0-11
8ac2aa
- Add additional s390 support. rhbz1182187
8ac2aa
8ac2aa
* Fri May 15 2015 William Cohen <wcohen@redhat.com> - 4.4.0-10
8ac2aa
- Add additional s390 support. rhbz1182187
8ac2aa
5e8f80
* Thu Oct 16 2014 William Cohen <wcohen@redhat.com> - 4.4.0-9
5e8f80
- Bump and rebuid for chained build. rhbz1126091
5e8f80
5e8f80
* Fri Sep 26 2014 William Cohen <wcohen@redhat.com> - 4.4.0-8
5e8f80
- Update Intel processor support. rhbz1126091
5e8f80
5e8f80
* Wed Sep 3 2014 William Cohen <wcohen@redhat.com> - 4.4.0-7
5e8f80
- Add aarch64 and power8 support for rhbz963457 and rhbz1088557
5e8f80
7c630d
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 4.4.0-6
7c630d
- Mass rebuild 2014-01-24
7c630d
7c630d
* Tue Jan 14 2014 William Cohen <wcohen@redhat.com> - 4.4.0-5
7c630d
- Update event descriptions.
7c630d
7c630d
* Mon Jan 13 2014 William Cohen <wcohen@redhat.com> - 4.4.0-4
7c630d
- Add Haswell model numbers.
7c630d
7c630d
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 4.4.0-3
7c630d
- Mass rebuild 2013-12-27
7c630d
f1d3e6
* Fri Jul 19 2013 William Cohen <wcohen@redhat.com> 4.4.0-2
f1d3e6
- Add IBM power 8 support.
f1d3e6
f1d3e6
* Mon Jun 17 2013 William Cohen <wcohen@redhat.com> 4.4.0-1
f1d3e6
- Rebase on libpfm-4.4.0.
f1d3e6
f1d3e6
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.0-3
f1d3e6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
f1d3e6
f1d3e6
* Tue Aug 28 2012 William Cohen <wcohen@redhat.com> 4.3.0-2
f1d3e6
- Turn off LDCONFIG and remove patch.
f1d3e6
f1d3e6
* Tue Aug 28 2012 William Cohen <wcohen@redhat.com> 4.3.0-1
f1d3e6
- Rebase on libpfm-4.3.0.
f1d3e6
f1d3e6
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.0-8
f1d3e6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
f1d3e6
f1d3e6
* Fri Jun 8 2012 William Cohen <wcohen@redhat.com> 4.2.0-7
f1d3e6
- Eliminate swig error.
f1d3e6
f1d3e6
* Thu Jun 7 2012 William Cohen <wcohen@redhat.com> 4.2.0-6
f1d3e6
- Eliminate rpm_build_root macro in build section.
f1d3e6
- Correct location of shared library files.
f1d3e6
f1d3e6
* Thu Jun 7 2012 William Cohen <wcohen@redhat.com> 4.2.0-5
f1d3e6
- Use siginfo_t for some examples.
f1d3e6
f1d3e6
* Mon Jun 4 2012 William Cohen <wcohen@redhat.com> 4.2.0-4
f1d3e6
- Correct python files.
f1d3e6
f1d3e6
* Wed Mar 28 2012 William Cohen <wcohen@redhat.com> 4.2.0-3
f1d3e6
- Additional spec file fixup for rhbz804666.
f1d3e6
f1d3e6
* Wed Mar 14 2012 William Cohen <wcohen@redhat.com> 4.2.0-2
f1d3e6
- Some spec file fixup.
f1d3e6
f1d3e6
* Wed Jan 12 2011 Arun Sharma <asharma@fb.com> 4.2.0-0
f1d3e6
Initial revision