Compare commits
No commits in common. "c8" and "c10s" have entirely different histories.
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
15
.gitignore
vendored
15
.gitignore
vendored
@ -1 +1,14 @@
|
||||
SOURCES/libpfm-4.13.0.tar.gz
|
||||
/libpfm-4.3.0.tar.gz
|
||||
/libpfm-4.4.0.tar.gz
|
||||
/libpfm-4.4.0-3.199.g0b87987.tar.gz
|
||||
/libpfm-4.4.0-3.200.g9df2031.tar.gz
|
||||
/libpfm-4.4.0-5.217.gbca43a5.tar.gz
|
||||
/libpfm-4.5.0.tar.gz
|
||||
/libpfm-4.6.0.tar.gz
|
||||
/libpfm-4.7.0.tar.gz
|
||||
/libpfm-4.8.0.tar.gz
|
||||
/libpfm-4.9.0.tar.gz
|
||||
/libpfm-4.10.0.tar.gz
|
||||
/libpfm-4.10.1.tar.gz
|
||||
/libpfm-4.11.0.tar.gz
|
||||
/libpfm-4.13.0.tar.gz
|
||||
|
@ -1,31 +0,0 @@
|
||||
commit 874feacbbe97fe567d3d8b1582d881d1b424dd5e
|
||||
Author: William Cohen <wcohen@redhat.com>
|
||||
Date: Fri Apr 14 16:07:07 2023 -0400
|
||||
|
||||
Make sure that p is set to a known value before using.
|
||||
|
||||
Need to ensure that p was initialized at the start of function
|
||||
gen_tracepoint_table otherwise on some architectures such as s390x
|
||||
will get the following error when compiling with -Werror:
|
||||
|
||||
make[1]: Entering directory '/root/rpmbuild/BUILD/libpfm-4.13.0/lib'
|
||||
cc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=z14 -mtune=z15 -fasynchronous-unwind-tables -fstack-clash-protection -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/root/rpmbuild/BUILD/libpfm-4.13.0/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_S390X -I. -c pfmlib_perf_event_pmu.c
|
||||
pfmlib_perf_event_pmu.c: In function 'gen_tracepoint_table':
|
||||
pfmlib_perf_event_pmu.c:434:35: error: 'p' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|
||||
434 | p->modmsk = 0;
|
||||
| ~~~~~~~~~~^~~
|
||||
cc1: all warnings being treated as errors
|
||||
|
||||
diff --git a/lib/pfmlib_perf_event_pmu.c b/lib/pfmlib_perf_event_pmu.c
|
||||
index 637c5b1..8f7d7d1 100644
|
||||
--- a/lib/pfmlib_perf_event_pmu.c
|
||||
+++ b/lib/pfmlib_perf_event_pmu.c
|
||||
@@ -361,7 +361,7 @@ gen_tracepoint_table(void)
|
||||
{
|
||||
DIR *dir1, *dir2;
|
||||
struct dirent *d1, *d2;
|
||||
- perf_event_t *p;
|
||||
+ perf_event_t *p = NULL;
|
||||
perf_umask_t *um;
|
||||
char d2path[MAXPATHLEN];
|
||||
char idpath[MAXPATHLEN];
|
@ -1,29 +0,0 @@
|
||||
commit 1befa3d200cc17d5a278fcb2f597c4876c58f949
|
||||
Author: Stephane Eranian <eranian@gmail.com>
|
||||
Date: Tue Apr 25 00:35:41 2023 -0700
|
||||
|
||||
fix AMD Zen3/Zen4 detection
|
||||
|
||||
To cover more models of Zen4.
|
||||
|
||||
Signed-off-by: Stephane Eranian <eranian@gmail.com>
|
||||
|
||||
diff --git a/lib/pfmlib_amd64.c b/lib/pfmlib_amd64.c
|
||||
index e51a43d..0c6702d 100644
|
||||
--- a/lib/pfmlib_amd64.c
|
||||
+++ b/lib/pfmlib_amd64.c
|
||||
@@ -181,10 +181,10 @@ amd64_get_revision(pfm_amd64_config_t *cfg)
|
||||
} else if (cfg->family == 22) { /* family 16h */
|
||||
rev = PFM_PMU_AMD64_FAM16H;
|
||||
} else if (cfg->family == 25) { /* family 19h */
|
||||
- if (cfg->model <= 0x0f || (cfg->model >= 0x20 && cfg->model <= 0x5f)) {
|
||||
- rev = PFM_PMU_AMD64_FAM19H_ZEN3;
|
||||
- } else if (cfg->model == 17) {
|
||||
- rev = PFM_PMU_AMD64_FAM19H_ZEN4;
|
||||
+ if (cfg->model >= 0x60 || (cfg->model >= 0x10 && cfg->model <= 0x1f)) {
|
||||
+ rev = PFM_PMU_AMD64_FAM19H_ZEN4;
|
||||
+ } else {
|
||||
+ rev = PFM_PMU_AMD64_FAM19H_ZEN3;
|
||||
}
|
||||
}
|
||||
|
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-10
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1-gating.functional}
|
21
libpfm-gcc14.patch
Normal file
21
libpfm-gcc14.patch
Normal file
@ -0,0 +1,21 @@
|
||||
commit cb944829e0940d74009e09b8985b4f2139f5cb3b
|
||||
Author: William Cohen <wcohen@redhat.com>
|
||||
Date: Mon Jan 29 16:23:43 2024 -0500
|
||||
|
||||
Correct s390x code to avoid GCC-14 -Werror=calloc-transposed-args errors
|
||||
|
||||
diff --git a/lib/pfmlib_s390x_cpumf.c b/lib/pfmlib_s390x_cpumf.c
|
||||
index d8ce22d..718f5f8 100644
|
||||
--- a/lib/pfmlib_s390x_cpumf.c
|
||||
+++ b/lib/pfmlib_s390x_cpumf.c
|
||||
@@ -216,8 +216,8 @@ static int pfm_cpumcf_init(void *this)
|
||||
break;
|
||||
}
|
||||
|
||||
- cpumcf_pe = calloc(sizeof(*cpumcf_pe),
|
||||
- cfvn_set_count + csvn_set_count + ext_set_count);
|
||||
+ cpumcf_pe = calloc(cfvn_set_count + csvn_set_count + ext_set_count,
|
||||
+ sizeof(*cpumcf_pe));
|
||||
if (cpumcf_pe == NULL)
|
||||
return PFM_ERR_NOMEM;
|
||||
|
@ -1,27 +1,29 @@
|
||||
# Default to no static libraries
|
||||
%{!?with_static: %global with_static 1}
|
||||
%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_provides_in %{python3_sitearch}/perfmon/.*\.so$
|
||||
%filter_setup
|
||||
}
|
||||
%endif
|
||||
|
||||
Name: libpfm
|
||||
Version: 4.13.0
|
||||
Release: 4%{?dist}
|
||||
Release: 10%{?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-initp.patch
|
||||
Patch4: libpfm-zen4.patch
|
||||
Patch3: libpfm-gcc14.patch
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
%if %{with python}
|
||||
BuildRequires: python3
|
||||
BuildRequires: python3-devel
|
||||
@ -36,32 +38,34 @@ 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
|
||||
License: MIT
|
||||
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.
|
||||
|
||||
%if %{with_static}
|
||||
%package static
|
||||
License: MIT
|
||||
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.
|
||||
%endif
|
||||
|
||||
%if %{with python}
|
||||
%package -n python3-libpfm
|
||||
License: MIT AND LicenseRef-Fedora-UltraPermissive
|
||||
%{?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
|
||||
@ -70,9 +74,12 @@ Python bindings for libpfm4 and perf_event_open system call.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch2 -p1 -b .python3
|
||||
%patch3 -p1 -b .test
|
||||
%patch4 -p1 -b .zen4
|
||||
%patch -P2 -p1 -b .python3
|
||||
%patch -P3 -p1 -b .gcc14
|
||||
# to prevent setuptools from installing an .egg, we need to pass --root to setup.py install
|
||||
# see https://github.com/pypa/setuptools/issues/3143
|
||||
# and https://github.com/pypa/pip/issues/11501
|
||||
sed -i 's/--prefix=$(DESTDIR)$(PYTHON_PREFIX)/--root=$(DESTDIR) --prefix=$(PYTHON_PREFIX)/' python/Makefile
|
||||
|
||||
%build
|
||||
%if %{with python}
|
||||
@ -80,7 +87,7 @@ Python bindings for libpfm4 and perf_event_open system call.
|
||||
%else
|
||||
%global python_config CONFIG_PFMLIB_NOPYTHON=y
|
||||
%endif
|
||||
make %{python_config} %{?_smp_mflags} \
|
||||
%make_build %{python_config} \
|
||||
OPTIM="%{optflags}" LDFLAGS="%{build_ldflags}"
|
||||
|
||||
|
||||
@ -88,20 +95,24 @@ make %{python_config} %{?_smp_mflags} \
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%if %{with python}
|
||||
%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=$RPM_BUILD_ROOT/%{python_prefix}
|
||||
%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=%{python_prefix}
|
||||
%else
|
||||
%global python_config CONFIG_PFMLIB_NOPYTHON=y
|
||||
%endif
|
||||
|
||||
make \
|
||||
PREFIX=$RPM_BUILD_ROOT%{_prefix} \
|
||||
LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
|
||||
DESTDIR=$RPM_BUILD_ROOT \
|
||||
PREFIX=%{_prefix} \
|
||||
LIBDIR=%{_libdir} \
|
||||
%{python_config} \
|
||||
LDCONFIG=/bin/true \
|
||||
install
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
%postun -p /sbin/ldconfig
|
||||
%if !%{with_static}
|
||||
rm $RPM_BUILD_ROOT%{_libdir}/lib*.a
|
||||
%endif
|
||||
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%files
|
||||
%doc README
|
||||
@ -112,35 +123,122 @@ make \
|
||||
%{_mandir}/man3/*
|
||||
%{_libdir}/lib*.so
|
||||
|
||||
%if %{with_static}
|
||||
%files static
|
||||
%{_libdir}/lib*.a
|
||||
%endif
|
||||
|
||||
%if %{with python}
|
||||
%files -n python3-libpfm
|
||||
%{python_sitearch}/*
|
||||
%{python3_sitearch}/perfmon-*.egg-info/
|
||||
%{python3_sitearch}/perfmon/
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Jun 12 2023 William cohen <wcohen@redhat.com> - 4.13.0-4
|
||||
- Identify AMD Bergamo processors.
|
||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 4.13.0-10
|
||||
- Bump release for October 2024 mass rebuild:
|
||||
Resolves: RHEL-64018
|
||||
|
||||
* Wed May 3 2023 William cohen <wcohen@redhat.com> - 4.13.0-3
|
||||
- Rebuild for rhbz #2161146.
|
||||
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 4.13.0-9
|
||||
- Bump release for June 2024 mass rebuild
|
||||
|
||||
* Fri Apr 14 2023 William Cohen <wcohen@redhat.com> - 4.13.0-1
|
||||
- Rebase to libpfm-4.13.0 (RHBZ #2185653)
|
||||
* Mon Jan 29 2024 William Cohen <wcohen@redhat.com> - 4.13.0-8
|
||||
- Fix gcc-14 -Werror=calloc-transposed-args compatibility
|
||||
|
||||
* Sun May 8 2022 William Cohen <wcohen@redhat.com> - 4.10.1-5
|
||||
- Add AMD Zen 2/3 support (RHBZ #2067218)
|
||||
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.13.0-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Thu May 20 2021 William Cohen <wcohen@redhat.com> - 4.10.1-4
|
||||
- Add Fujitsu A64FX support (RHBZ #1908126)
|
||||
|
||||
* Wed May 27 2020 William Cohen <wcohen@redhat.com> - 4.10.1-3
|
||||
- Add Marvell TunderX2 UNC support. (RHBZ #1726070)
|
||||
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.13.0-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Tue Oct 15 2019 William Cohen <wcohen@redhat.com> - 4.10.1-2
|
||||
- Add IBM zseries support. (RHBZ #1731019)
|
||||
* Tue Aug 1 2023 William Cohen <wcohen@redhat.com> - 4.13.0-5
|
||||
- migrated to SPDX license
|
||||
|
||||
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.13.0-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 4.13.0-3
|
||||
- Rebuilt for Python 3.12
|
||||
|
||||
* Tue Apr 25 2023 Miro Hrončok <mhroncok@redhat.com> - 4.13.0-2
|
||||
- Don't install a Python .egg
|
||||
|
||||
* Tue Mar 28 2023 William Cohen <wcohen@redhat.com> - 4.13.0-1
|
||||
- Rebase on libpfm-4.13.0.
|
||||
|
||||
* Tue Mar 14 2023 William Cohen <wcohen@redhat.com> - 4.11.0-12
|
||||
- Add libpfm upstream patch to allow papi-7.0.1 to build.
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.11.0-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.11.0-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Tue Jun 21 2022 Python Maint <python-maint@redhat.com> - 4.11.0-9
|
||||
- Fix FTBFS due to gcc12. (rhbz2045823)
|
||||
|
||||
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 4.11.0-8
|
||||
- Rebuilt for Python 3.11
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.11.0-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.11.0-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 4.11.0-5
|
||||
- Rebuilt for Python 3.10
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.11.0-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Sat Jan 23 2021 William Cohen <wcohen@redhat.com> - 4.11.0-3
|
||||
- Reenable generation of static libraries for time being.
|
||||
|
||||
* Fri Jan 22 2021 William Cohen <wcohen@redhat.com> - 4.11.0-2
|
||||
- By default disable generation of static libraries
|
||||
|
||||
* Tue Sep 08 2020 William Cohen <wcohen@redhat.com> - 4.11.0-1
|
||||
- Rebase on libpfm-4.11.0.
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.1-13
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 4.10.1-12
|
||||
- Use make macros
|
||||
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
|
||||
|
||||
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 4.10.1-11
|
||||
- Rebuilt for Python 3.9
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.1-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 4.10.1-9
|
||||
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
||||
|
||||
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 4.10.1-8
|
||||
- Rebuilt for Python 3.8
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.1-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.1-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Tue Jul 17 2018 Miro Hrončok <mhroncok@redhat.com> - 4.10.1-5
|
||||
- Update Python macros to new packaging standards
|
||||
(See https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package)
|
||||
|
||||
* Sun Jul 15 2018 William Cohen <wcohen@redhat.com> - 4.10.1-4
|
||||
- Add gcc Buildrequires.
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 4.10.1-2
|
||||
- Rebuilt for Python 3.7
|
||||
|
||||
* Fri Jun 15 2018 William Cohen <wcohen@redhat.com> - 4.10.1-1
|
||||
- Rebase on libpfm-4.10.1.
|
6
plans/ci.fmf
Normal file
6
plans/ci.fmf
Normal file
@ -0,0 +1,6 @@
|
||||
summary: CI Gating Plan
|
||||
discover:
|
||||
how: fmf
|
||||
directory: tests
|
||||
execute:
|
||||
how: beakerlib
|
1
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
||||
SHA512 (libpfm-4.13.0.tar.gz) = e61b210aa2ce80f0e47603c88eee2e4f2fe30ca2c0e194a5472b6a8de3bf9dc1085e5261bbb9ddbe5b6531c4b391fb34f20d038e5ebd8e6f4c14c2112aee508f
|
63
tests/libpfm-testsuite/Makefile
Normal file
63
tests/libpfm-testsuite/Makefile
Normal file
@ -0,0 +1,63 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/libpfm/Sanity/libpfm-testsuite
|
||||
# Description: libpfm-testsuite testing by upstream testsuite
|
||||
# Author: Michal Kolar <mkolar@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2021 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=/tools/libpfm/Sanity/libpfm-testsuite
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Michal Kolar <mkolar@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: libpfm-testsuite testing by upstream testsuite" >> $(METADATA)
|
||||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 1h" >> $(METADATA)
|
||||
@echo "RunFor: libpfm" >> $(METADATA)
|
||||
@echo "Requires: libpfm rpm-build yum-utils make gcc" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6 -RHEL7" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
3
tests/libpfm-testsuite/PURPOSE
Normal file
3
tests/libpfm-testsuite/PURPOSE
Normal file
@ -0,0 +1,3 @@
|
||||
PURPOSE of /tools/libpfm/Sanity/libpfm-testsuite
|
||||
Description: libpfm-testsuite testing by upstream testsuite
|
||||
Author: Michal Kolar <mkolar@redhat.com>
|
16
tests/libpfm-testsuite/main.fmf
Normal file
16
tests/libpfm-testsuite/main.fmf
Normal file
@ -0,0 +1,16 @@
|
||||
summary: libpfm-testsuite testing by upstream testsuite
|
||||
description: ''
|
||||
contact: Michal Kolar <mkolar@redhat.com>
|
||||
component:
|
||||
- libpfm
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- libpfm
|
||||
- rpm-build
|
||||
- yum-utils
|
||||
- make
|
||||
- gcc
|
||||
duration: 1h
|
||||
extra-summary: /tools/libpfm/Sanity/libpfm-testsuite
|
||||
extra-task: /tools/libpfm/Sanity/libpfm-testsuite
|
82
tests/libpfm-testsuite/runtest.sh
Executable file
82
tests/libpfm-testsuite/runtest.sh
Executable file
@ -0,0 +1,82 @@
|
||||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/libpfm/Sanity/libpfm-testsuite
|
||||
# Description: libpfm-testsuite testing by upstream testsuite
|
||||
# Author: Michal Kolar <mkolar@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2021 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
BUILD_USER=${BUILD_USER:-lbpfmbld}
|
||||
TESTS_COUNT_MIN=${TESTS_COUNT_MIN:-1}
|
||||
PACKAGE="libpfm"
|
||||
REQUIRES="$PACKAGE rpm-build make gcc"
|
||||
if rlIsFedora; then
|
||||
REQUIRES="$REQUIRES dnf-utils"
|
||||
else
|
||||
REQUIRES="$REQUIRES yum-utils"
|
||||
fi
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlShowRunningKernel
|
||||
rlAssertRpm --all
|
||||
rlRun "TmpDir=\$(mktemp -d)"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlFetchSrcForInstalled $PACKAGE
|
||||
rlRun "useradd -M -N $BUILD_USER" 0,9
|
||||
[ "$?" == "0" ] && rlRun "del=yes"
|
||||
rlRun "chown -R $BUILD_USER:users $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartSetup "build libpfm"
|
||||
rlRun "rpm -D \"_topdir $TmpDir\" -U *.src.rpm"
|
||||
rlRun "yum-builddep -y $TmpDir/SPECS/*.spec"
|
||||
rlRun "su -c 'rpmbuild -D \"_topdir $TmpDir\" -bp $TmpDir/SPECS/*.spec &>$TmpDir/rpmbuild.log' $BUILD_USER"
|
||||
rlRun "rlFileSubmit $TmpDir/rpmbuild.log"
|
||||
rlRun "cd $TmpDir/BUILD/libpfm-*/tests"
|
||||
rlRun "su -c 'make PFMLIB=`rpm -ql libpfm | grep .so | head -n 1`' $BUILD_USER"
|
||||
rlRun "ldd validate | tee $TmpDir/ldd.log"
|
||||
rlRun "grep -q 'libpfm.so' $TmpDir/ldd.log"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "run testsuite"
|
||||
rlRun "su -c './validate &>$TmpDir/testsuite.log' $BUILD_USER"
|
||||
rlRun "rlFileSubmit $TmpDir/testsuite.log"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "evaluate results"
|
||||
rlRun "cd $TmpDir"
|
||||
rlRun "grep -q 'All tests passed' testsuite.log"
|
||||
rlRun "tests_count=\$(grep -o -E '^\s*[0-9]+' testsuite.log | awk '{sum+=\$1} END {print sum}')"
|
||||
[ "$tests_count" -ge "$TESTS_COUNT_MIN" ] && rlLogInfo "Test counter: $tests_count" || rlFail "Test counter $tests_count should be greater than or equal to $TESTS_COUNT_MIN"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir"
|
||||
[ "$del" == "yes" ] && rlRun "userdel -f $BUILD_USER"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
Loading…
Reference in New Issue
Block a user