From 033c6fd25c94f68c972c30c564dd52c873e92b8a Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 7 Nov 2016 11:12:28 -0500 Subject: [PATCH 01/65] Rebase on libpfm-4.8.0. --- .gitignore | 1 + libpfm.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b7d5276..0da00a7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /libpfm-4.5.0.tar.gz /libpfm-4.6.0.tar.gz /libpfm-4.7.0.tar.gz +/libpfm-4.8.0.tar.gz diff --git a/libpfm.spec b/libpfm.spec index 39ae958..a0e91ea 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ %endif Name: libpfm -Version: 4.7.0 +Version: 4.8.0 Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* 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 diff --git a/sources b/sources index dcd270d..00d131c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -44c171be724e3945b6b587c20d27a3fa libpfm-4.7.0.tar.gz +730383896db92e12fb2cc10f2d41dd43 libpfm-4.8.0.tar.gz From 4867e1344e06b3d761c7931f88610ad4c33079ac Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 10 Feb 2017 19:16:31 +0000 Subject: [PATCH 02/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index a0e91ea..4c59938 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* 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. From b00e6540d3a05b79d6ff17bc19fdb2478353d0fc Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Fri, 7 Jul 2017 12:21:13 +0200 Subject: [PATCH 03/65] Rebuild due to bug in RPM (RHBZ #1468476) Signed-off-by: Igor Gnatenko --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 4c59938..41f08be 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* 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 From 5059dba16747f30017314b52b6a037465d5710bc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 26 Jul 2017 19:31:15 +0000 Subject: [PATCH 04/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 41f08be..ade969f 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* 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) From 91533d7a468d60404b991947b6b683c571667b73 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 3 Aug 2017 02:05:00 +0000 Subject: [PATCH 05/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index ade969f..336648d 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* 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 From 557d7065fbc47ed5dd9fe66e51c8f8da8d53a36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 19 Aug 2017 09:38:38 -0400 Subject: [PATCH 06/65] Python 2 binary package renamed to python2-libpfm --- libpfm.spec | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 336648d..f35c721 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Library to encode performance events for use by perf tool @@ -50,12 +50,16 @@ Static version of the libpfm library for performance monitoring applications for the perf_events interface. %if %{with python} -%package python +%package -n python2-libpfm +%{?python_provide:%python_provide python2-libpfm} +# Remove before F30 +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 python +%description -n python2-libpfm Python bindings for libpfm4 and perf_event_open system call. %endif @@ -103,11 +107,15 @@ make \ %{_libdir}/lib*.a %if %{with python} -%files python +%files -n python2-libpfm %{python_sitearch}/* %endif %changelog +* 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 From f7b910a2823da243f3dc31ec6036fe5d94129373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 20 Aug 2017 10:36:50 -0400 Subject: [PATCH 07/65] Add Provides for the old name without %_isa --- libpfm.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index f35c721..a13b460 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Library to encode performance events for use by perf tool @@ -53,6 +53,7 @@ applications for the perf_events interface. %package -n python2-libpfm %{?python_provide:%python_provide python2-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 @@ -112,6 +113,9 @@ make \ %endif %changelog +* 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 From 37725593f352cd421fabf1a149b7396f87680303 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 4 Jan 2018 09:01:59 -0500 Subject: [PATCH 08/65] Rebase on libpfm-4.9.0. --- .gitignore | 1 + libpfm.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0da00a7..abfa124 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /libpfm-4.6.0.tar.gz /libpfm-4.7.0.tar.gz /libpfm-4.8.0.tar.gz +/libpfm-4.9.0.tar.gz diff --git a/libpfm.spec b/libpfm.spec index a13b460..216d457 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.8.0 -Release: 8%{?dist} +Version: 4.9.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* 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 diff --git a/sources b/sources index 00d131c..41e74a5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -730383896db92e12fb2cc10f2d41dd43 libpfm-4.8.0.tar.gz +SHA512 (libpfm-4.9.0.tar.gz) = 9e62556a5e8029b94383bd54176c5171fec7f919b6826d5d348837540922874c922eb0e01d7835c388ae28809c798f4b3da8ba751777767ce4a0e47ddab2b645 From d5efe98c8d612e91c43470389e932fe8368d54f4 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Tue, 9 Jan 2018 18:57:30 +0100 Subject: [PATCH 09/65] Update Python 2 dependency declarations to new packaging standards --- libpfm.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 216d457..f372ee1 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.9.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,8 +20,8 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz %if %{with python} -BuildRequires: python-devel -BuildRequires: python-setuptools +BuildRequires: python2-devel +BuildRequires: python2-setuptools BuildRequires: swig %endif @@ -113,6 +113,10 @@ make \ %endif %changelog +* 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. From b3bd2d418d1ad54ef43214c7da31e5be24b0bbed Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 30 Jan 2018 13:57:18 -0500 Subject: [PATCH 10/65] Related: rhbz1540262 --- libpfm.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index f372ee1..eb0ed58 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.9.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -73,7 +73,8 @@ 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 %{python_config} %{?_smp_mflags} \ + OPTIM="%{optflags}" %install @@ -113,6 +114,9 @@ make \ %endif %changelog +* 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) From c307e8c48d339bd470e4ddb410af065c46e51fe2 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 31 Jan 2018 11:47:46 -0500 Subject: [PATCH 11/65] Fixes due to compiler checks for possible truncation by snprintf. --- libpfm-truncation.patch | 85 +++++++++++++++++++++++++++++++++++++++++ libpfm.spec | 7 +++- 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 libpfm-truncation.patch diff --git a/libpfm-truncation.patch b/libpfm-truncation.patch new file mode 100644 index 0000000..99170f3 --- /dev/null +++ b/libpfm-truncation.patch @@ -0,0 +1,85 @@ +diff --git a/lib/pfmlib_perf_event_pmu.c b/lib/pfmlib_perf_event_pmu.c +index 86ff824..ca371d8 100644 +--- a/lib/pfmlib_perf_event_pmu.c ++++ b/lib/pfmlib_perf_event_pmu.c +@@ -344,6 +344,7 @@ gen_tracepoint_table(void) + + err = 0; + while((d1 = readdir(dir1)) && err >= 0) { ++ int retlen; + + if (!strcmp(d1->d_name, ".")) + continue; +@@ -351,7 +352,10 @@ gen_tracepoint_table(void) + if (!strcmp(d1->d_name, "..")) + continue; + +- snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name); ++ retlen = snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name); ++ /* if string truncated do not try to open the corrupted path */ ++ if (retlen < 0 || retlen >= MAXPATHLEN) ++ continue; + + /* fails if d2path is not a directory */ + dir2 = opendir(d2path); +@@ -398,10 +402,16 @@ gen_tracepoint_table(void) + continue; + + #ifdef HAS_OPENAT +- snprintf(idpath, MAXPATHLEN, "%s/id", d2->d_name); ++ retlen = snprintf(idpath, MAXPATHLEN, "%s/id", d2->d_name); ++ /* if string truncated do not try to open the corrupted path */ ++ if (retlen < 0 || retlen >= MAXPATHLEN) ++ continue; + fd = openat(dir2_fd, idpath, O_RDONLY); + #else +- snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name); ++ retlen = snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name); ++ /* if string truncated do not try to open the corrupted path */ ++ if (retlen < 0 || retlen >= MAXPATHLEN) ++ continue; + fd = open(idpath, O_RDONLY); + #endif + if (fd == -1) +diff --git a/perf_examples/syst_count.c b/perf_examples/syst_count.c +index e0fa42e..7841d01 100644 +--- a/perf_examples/syst_count.c ++++ b/perf_examples/syst_count.c +@@ -112,12 +112,14 @@ open_cgroup(char *name) + { + char path[MAX_PATH+1]; + char mnt[MAX_PATH+1]; +- int cfd; ++ int cfd, retlen; + + if (cgroupfs_find_mountpoint(mnt, MAX_PATH+1)) + errx(1, "cannot find cgroup fs mount point"); + +- snprintf(path, MAX_PATH, "%s/%s", mnt, name); ++ retlen = snprintf(path, MAX_PATH, "%s/%s", mnt, name); ++ if (retlen < 0 || retlen >= MAX_PATH) ++ warn("path truncated %s/%s\n", mnt, name); + + cfd = open(path, O_RDONLY); + if (cfd == -1) +diff --git a/perf_examples/syst_smpl.c b/perf_examples/syst_smpl.c +index 6b70e0e..a8b00df 100755 +--- a/perf_examples/syst_smpl.c ++++ b/perf_examples/syst_smpl.c +@@ -278,12 +278,14 @@ open_cgroup(char *name) + { + char path[MAX_PATH+1]; + char mnt[MAX_PATH+1]; +- int cfd; ++ int cfd, retlen; + + if (cgroupfs_find_mountpoint(mnt, MAX_PATH+1)) + errx(1, "cannot find cgroup fs mount point"); + +- snprintf(path, MAX_PATH, "%s/%s", mnt, name); ++ retlen = snprintf(path, MAX_PATH, "%s/%s", mnt, name); ++ if (retlen < 0 || retlen >= MAX_PATH) ++ warn("path truncated %s/%s\n", mnt, name); + + cfd = open(path, O_RDONLY); + if (cfd == -1) diff --git a/libpfm.spec b/libpfm.spec index eb0ed58..0424a04 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.9.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -18,6 +18,7 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz +Patch1: libpfm-truncation.patch %if %{with python} BuildRequires: python2-devel @@ -66,6 +67,7 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q +%patch1 -p1 -b .trun %build %if %{with python} @@ -114,6 +116,9 @@ make \ %endif %changelog +* 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) From 4225d4f522ae203169f2e12d7ec0d73c9c413d81 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 7 Feb 2018 23:02:18 +0000 Subject: [PATCH 12/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 0424a04..0fadf16 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.9.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -116,6 +116,9 @@ make \ %endif %changelog +* 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. From 75e5fed5ded6dbbbf7c3020732d00c119f3d4961 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 26 Feb 2018 11:42:26 -0500 Subject: [PATCH 13/65] Pass in LDFLAGS rhbz1540262 --- libpfm.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 0fadf16..f30ab21 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.9.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -76,7 +76,7 @@ Python bindings for libpfm4 and perf_event_open system call. %global python_config CONFIG_PFMLIB_NOPYTHON=y %endif make %{python_config} %{?_smp_mflags} \ - OPTIM="%{optflags}" + OPTIM="%{optflags}" LDFLAGS="%{build_ldflags}" %install @@ -116,6 +116,9 @@ make \ %endif %changelog +* 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 From 360481a7b305ddba46c9fa6c026f8d3f6815596b Mon Sep 17 00:00:00 2001 From: William Cohen Date: Sun, 10 Jun 2018 23:03:58 -0400 Subject: [PATCH 14/65] - Rebase on libpfm-4.10.0. - Use Python 3. --- .gitignore | 1 + libpfm-cavium-tx2.patch | 13 ++++++ libpfm-python3-setup.patch | 10 +++++ libpfm-truncation.patch | 85 -------------------------------------- libpfm.spec | 31 ++++++++------ sources | 2 +- 6 files changed, 44 insertions(+), 98 deletions(-) create mode 100644 libpfm-cavium-tx2.patch create mode 100644 libpfm-python3-setup.patch delete mode 100644 libpfm-truncation.patch diff --git a/.gitignore b/.gitignore index abfa124..f98c1f0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /libpfm-4.7.0.tar.gz /libpfm-4.8.0.tar.gz /libpfm-4.9.0.tar.gz +/libpfm-4.10.0.tar.gz diff --git a/libpfm-cavium-tx2.patch b/libpfm-cavium-tx2.patch new file mode 100644 index 0000000..77c58b3 --- /dev/null +++ b/libpfm-cavium-tx2.patch @@ -0,0 +1,13 @@ +diff --git a/lib/Makefile b/lib/Makefile +index 129db90..f1241ad 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -360,7 +360,7 @@ INC_ARM=pfmlib_arm_priv.h \ + events/arm_cortex_a15_events.h \ + events/arm_cortex_a57_events.h \ + events/arm_cortex_a53_events.h \ +- events/arm_thunderx2_events.h ++ events/arm_cavium_tx2_events.h + + INC_ARM64=events/arm_cortex_a57_events.h \ + events/arm_cortex_a53_events.h diff --git a/libpfm-python3-setup.patch b/libpfm-python3-setup.patch new file mode 100644 index 0000000..f43187a --- /dev/null +++ b/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/libpfm-truncation.patch b/libpfm-truncation.patch deleted file mode 100644 index 99170f3..0000000 --- a/libpfm-truncation.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff --git a/lib/pfmlib_perf_event_pmu.c b/lib/pfmlib_perf_event_pmu.c -index 86ff824..ca371d8 100644 ---- a/lib/pfmlib_perf_event_pmu.c -+++ b/lib/pfmlib_perf_event_pmu.c -@@ -344,6 +344,7 @@ gen_tracepoint_table(void) - - err = 0; - while((d1 = readdir(dir1)) && err >= 0) { -+ int retlen; - - if (!strcmp(d1->d_name, ".")) - continue; -@@ -351,7 +352,10 @@ gen_tracepoint_table(void) - if (!strcmp(d1->d_name, "..")) - continue; - -- snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name); -+ retlen = snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name); -+ /* if string truncated do not try to open the corrupted path */ -+ if (retlen < 0 || retlen >= MAXPATHLEN) -+ continue; - - /* fails if d2path is not a directory */ - dir2 = opendir(d2path); -@@ -398,10 +402,16 @@ gen_tracepoint_table(void) - continue; - - #ifdef HAS_OPENAT -- snprintf(idpath, MAXPATHLEN, "%s/id", d2->d_name); -+ retlen = snprintf(idpath, MAXPATHLEN, "%s/id", d2->d_name); -+ /* if string truncated do not try to open the corrupted path */ -+ if (retlen < 0 || retlen >= MAXPATHLEN) -+ continue; - fd = openat(dir2_fd, idpath, O_RDONLY); - #else -- snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name); -+ retlen = snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name); -+ /* if string truncated do not try to open the corrupted path */ -+ if (retlen < 0 || retlen >= MAXPATHLEN) -+ continue; - fd = open(idpath, O_RDONLY); - #endif - if (fd == -1) -diff --git a/perf_examples/syst_count.c b/perf_examples/syst_count.c -index e0fa42e..7841d01 100644 ---- a/perf_examples/syst_count.c -+++ b/perf_examples/syst_count.c -@@ -112,12 +112,14 @@ open_cgroup(char *name) - { - char path[MAX_PATH+1]; - char mnt[MAX_PATH+1]; -- int cfd; -+ int cfd, retlen; - - if (cgroupfs_find_mountpoint(mnt, MAX_PATH+1)) - errx(1, "cannot find cgroup fs mount point"); - -- snprintf(path, MAX_PATH, "%s/%s", mnt, name); -+ retlen = snprintf(path, MAX_PATH, "%s/%s", mnt, name); -+ if (retlen < 0 || retlen >= MAX_PATH) -+ warn("path truncated %s/%s\n", mnt, name); - - cfd = open(path, O_RDONLY); - if (cfd == -1) -diff --git a/perf_examples/syst_smpl.c b/perf_examples/syst_smpl.c -index 6b70e0e..a8b00df 100755 ---- a/perf_examples/syst_smpl.c -+++ b/perf_examples/syst_smpl.c -@@ -278,12 +278,14 @@ open_cgroup(char *name) - { - char path[MAX_PATH+1]; - char mnt[MAX_PATH+1]; -- int cfd; -+ int cfd, retlen; - - if (cgroupfs_find_mountpoint(mnt, MAX_PATH+1)) - errx(1, "cannot find cgroup fs mount point"); - -- snprintf(path, MAX_PATH, "%s/%s", mnt, name); -+ retlen = snprintf(path, MAX_PATH, "%s/%s", mnt, name); -+ if (retlen < 0 || retlen >= MAX_PATH) -+ warn("path truncated %s/%s\n", mnt, name); - - cfd = open(path, O_RDONLY); - if (cfd == -1) diff --git a/libpfm.spec b/libpfm.spec index f30ab21..24fad5d 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -1,7 +1,7 @@ %bcond_without python %if %{with python} -%define python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") -%define python_prefix %(python -c "import sys; print sys.prefix") +%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 @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.9.0 -Release: 6%{?dist} +Version: 4.10.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -18,11 +18,13 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz -Patch1: libpfm-truncation.patch +Patch1: libpfm-cavium-tx2.patch +Patch2: libpfm-python3-setup.patch %if %{with python} -BuildRequires: python2-devel -BuildRequires: python2-setuptools +BuildRequires: python3 +BuildRequires: python3-devel +BuildRequires: python3-setuptools BuildRequires: swig %endif @@ -51,8 +53,8 @@ Static version of the libpfm library for performance monitoring applications for the perf_events interface. %if %{with python} -%package -n python2-libpfm -%{?python_provide:%python_provide python2-libpfm} +%package -n python3-libpfm +%{?python_provide:%python_provide python3-libpfm} # Remove before F30 Provides: %{name}-python = %{version}-%{release} Provides: %{name}-python%{?_isa} = %{version}-%{release} @@ -61,13 +63,14 @@ Summary: Python bindings for libpfm and perf_event_open system call Group: Development/Languages Requires: %{name}%{?_isa} = %{version}-%{release} -%description -n python2-libpfm +%description -n python3-libpfm Python bindings for libpfm4 and perf_event_open system call. %endif %prep %setup -q -%patch1 -p1 -b .trun +%patch1 -p1 -b .cavium +%patch2 -p1 -b .python3 %build %if %{with python} @@ -111,11 +114,15 @@ make \ %{_libdir}/lib*.a %if %{with python} -%files -n python2-libpfm +%files -n python3-libpfm %{python_sitearch}/* %endif %changelog +* 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. diff --git a/sources b/sources index 41e74a5..d847ef1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libpfm-4.9.0.tar.gz) = 9e62556a5e8029b94383bd54176c5171fec7f919b6826d5d348837540922874c922eb0e01d7835c388ae28809c798f4b3da8ba751777767ce4a0e47ddab2b645 +SHA512 (libpfm-4.10.0.tar.gz) = c2e1a7d389efebc27a32dd3a5a6f3e8e8d624347616e06daf7bf06c0d5b8ca39cee5821ad5cf23330d47ed987697fcc05aa54660b8f6899f62aad9cd05e908f9 From d7cc62017d5251bfd1ca7b8830e417611f192971 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 12 Jun 2018 11:58:41 -0400 Subject: [PATCH 15/65] Use upstream libpfm cavium patch. --- libpfm-cavium-tx2.patch | 37 ++++++++++++++++++++++++++++++++++--- libpfm.spec | 5 ++++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/libpfm-cavium-tx2.patch b/libpfm-cavium-tx2.patch index 77c58b3..bea57af 100644 --- a/libpfm-cavium-tx2.patch +++ b/libpfm-cavium-tx2.patch @@ -1,8 +1,22 @@ +commit c3ca7e011e7ad23df326d9817453674d1290fb1a +Author: Stephane Eranian +Date: Tue Jun 12 08:26:53 2018 -0700 + + Fix Cavium Thunder X2 build issues + + Release v4.10.0 had a few bugs related to Cavium Thunder X2 build. + + - lib/Makefile dependency was pointing to the wrong Cavium Thunder X2 event file name + - lib/Makefile was missing Cavium event file dependency for ARM64 + - lib/pfmlib_commmon.c was missing support for Cavium Thunder X2 in 32-bit mode + + Signed-off-by: Stephane Eranian + diff --git a/lib/Makefile b/lib/Makefile -index 129db90..f1241ad 100644 +index 129db90..2eb3ebb 100644 --- a/lib/Makefile +++ b/lib/Makefile -@@ -360,7 +360,7 @@ INC_ARM=pfmlib_arm_priv.h \ +@@ -360,10 +360,11 @@ INC_ARM=pfmlib_arm_priv.h \ events/arm_cortex_a15_events.h \ events/arm_cortex_a57_events.h \ events/arm_cortex_a53_events.h \ @@ -10,4 +24,21 @@ index 129db90..f1241ad 100644 + events/arm_cavium_tx2_events.h INC_ARM64=events/arm_cortex_a57_events.h \ - events/arm_cortex_a53_events.h +- events/arm_cortex_a53_events.h ++ events/arm_cortex_a53_events.h \ ++ events/arm_cavium_tx2_events.h + + INCDEP=$(INC_COMMON) $(INCARCH) + +diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c +index f5bce8b..ca93d72 100644 +--- a/lib/pfmlib_common.c ++++ b/lib/pfmlib_common.c +@@ -482,6 +482,7 @@ static pfmlib_pmu_t *pfmlib_pmus[]= + &arm_cortex_a57_support, + &arm_cortex_a53_support, + &arm_xgene_support, ++ &arm_thunderx2_support, + #endif + #ifdef CONFIG_PFMLIB_ARCH_ARM64 + &arm_cortex_a57_support, diff --git a/libpfm.spec b/libpfm.spec index 24fad5d..7f6a301 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -119,6 +119,9 @@ make \ %endif %changelog +* 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. From e8ae3bf138b227402584b27ba0fbc4355c052b47 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 15 Jun 2018 09:40:41 -0400 Subject: [PATCH 16/65] Rebase 4.10.1. --- .gitignore | 1 + libpfm-cavium-tx2.patch | 44 ----------------------------------------- libpfm.spec | 9 +++++---- sources | 2 +- 4 files changed, 7 insertions(+), 49 deletions(-) delete mode 100644 libpfm-cavium-tx2.patch diff --git a/.gitignore b/.gitignore index f98c1f0..74baaf8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /libpfm-4.8.0.tar.gz /libpfm-4.9.0.tar.gz /libpfm-4.10.0.tar.gz +/libpfm-4.10.1.tar.gz diff --git a/libpfm-cavium-tx2.patch b/libpfm-cavium-tx2.patch deleted file mode 100644 index bea57af..0000000 --- a/libpfm-cavium-tx2.patch +++ /dev/null @@ -1,44 +0,0 @@ -commit c3ca7e011e7ad23df326d9817453674d1290fb1a -Author: Stephane Eranian -Date: Tue Jun 12 08:26:53 2018 -0700 - - Fix Cavium Thunder X2 build issues - - Release v4.10.0 had a few bugs related to Cavium Thunder X2 build. - - - lib/Makefile dependency was pointing to the wrong Cavium Thunder X2 event file name - - lib/Makefile was missing Cavium event file dependency for ARM64 - - lib/pfmlib_commmon.c was missing support for Cavium Thunder X2 in 32-bit mode - - Signed-off-by: Stephane Eranian - -diff --git a/lib/Makefile b/lib/Makefile -index 129db90..2eb3ebb 100644 ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -360,10 +360,11 @@ INC_ARM=pfmlib_arm_priv.h \ - events/arm_cortex_a15_events.h \ - events/arm_cortex_a57_events.h \ - events/arm_cortex_a53_events.h \ -- events/arm_thunderx2_events.h -+ events/arm_cavium_tx2_events.h - - INC_ARM64=events/arm_cortex_a57_events.h \ -- events/arm_cortex_a53_events.h -+ events/arm_cortex_a53_events.h \ -+ events/arm_cavium_tx2_events.h - - INCDEP=$(INC_COMMON) $(INCARCH) - -diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c -index f5bce8b..ca93d72 100644 ---- a/lib/pfmlib_common.c -+++ b/lib/pfmlib_common.c -@@ -482,6 +482,7 @@ static pfmlib_pmu_t *pfmlib_pmus[]= - &arm_cortex_a57_support, - &arm_cortex_a53_support, - &arm_xgene_support, -+ &arm_thunderx2_support, - #endif - #ifdef CONFIG_PFMLIB_ARCH_ARM64 - &arm_cortex_a57_support, diff --git a/libpfm.spec b/libpfm.spec index 7f6a301..1337b04 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.10.0 -Release: 2%{?dist} +Version: 4.10.1 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -18,7 +18,6 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz -Patch1: libpfm-cavium-tx2.patch Patch2: libpfm-python3-setup.patch %if %{with python} @@ -69,7 +68,6 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q -%patch1 -p1 -b .cavium %patch2 -p1 -b .python3 %build @@ -119,6 +117,9 @@ make \ %endif %changelog +* 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. diff --git a/sources b/sources index d847ef1..2f0b0d2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libpfm-4.10.0.tar.gz) = c2e1a7d389efebc27a32dd3a5a6f3e8e8d624347616e06daf7bf06c0d5b8ca39cee5821ad5cf23330d47ed987697fcc05aa54660b8f6899f62aad9cd05e908f9 +SHA512 (libpfm-4.10.1.tar.gz) = 33d99824216b4d83784e0db9f1aae3b39f84c2ba42dee64dde0b3c43cc5ee3a18c206d9044e75bf10867768add7cb9967c6318f7aa196f178f334271fa05e1aa From d69ef2206baab648838c0cfef4cf920beaa93eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 19 Jun 2018 10:46:14 +0200 Subject: [PATCH 17/65] Rebuilt for Python 3.7 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 1337b04..8d6ffdf 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -117,6 +117,9 @@ make \ %endif %changelog +* Tue Jun 19 2018 Miro Hrončok - 4.10.1-2 +- Rebuilt for Python 3.7 + * Fri Jun 15 2018 William Cohen - 4.10.1-1 - Rebase on libpfm-4.10.1. From 7f4ef1dde1e63373af66e4b2ed29658e9848dda5 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 13 Jul 2018 08:39:19 +0000 Subject: [PATCH 18/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 8d6ffdf..8df0334 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -117,6 +117,9 @@ make \ %endif %changelog +* Fri Jul 13 2018 Fedora Release Engineering - 4.10.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Tue Jun 19 2018 Miro Hrončok - 4.10.1-2 - Rebuilt for Python 3.7 From af5418c81ea36547c3cdd46d819869263ad5fe6a Mon Sep 17 00:00:00 2001 From: William Cohen Date: Sun, 15 Jul 2018 20:05:06 -0400 Subject: [PATCH 19/65] Add gcc Buildrequires. --- libpfm.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 8df0334..71a3c76 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,6 +20,7 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch +BuildRequires: gcc %if %{with python} BuildRequires: python3 BuildRequires: python3-devel @@ -117,6 +118,9 @@ make \ %endif %changelog +* Sun Jul 15 2018 William Cohen - 4.10.1-4 +- Add gcc Buildrequires. + * Fri Jul 13 2018 Fedora Release Engineering - 4.10.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 686670e6179832d2d5f6e94c45f7bf31e7e57a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 17 Jul 2018 17:10:59 +0200 Subject: [PATCH 20/65] Update Python macros to new packaging standards --- libpfm.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 71a3c76..f612f58 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -3,14 +3,14 @@ %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 %{python2_sitearch}/perfmon/.*\.so$ %filter_setup } %endif Name: libpfm Version: 4.10.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -114,10 +114,14 @@ make \ %if %{with python} %files -n python3-libpfm -%{python_sitearch}/* +%{python2_sitearch}/* %endif %changelog +* Tue Jul 17 2018 Miro Hrončok - 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 - 4.10.1-4 - Add gcc Buildrequires. From 393b4b06e6836124ac862974ec5a17a56653854b Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 24 Jul 2018 11:41:08 -0400 Subject: [PATCH 21/65] Should be using python3 macros. --- libpfm.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index f612f58..746fc6a 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -3,7 +3,7 @@ %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 %{python2_sitearch}/perfmon/.*\.so$ +%filter_provides_in %{python3_sitearch}/perfmon/.*\.so$ %filter_setup } %endif @@ -114,7 +114,7 @@ make \ %if %{with python} %files -n python3-libpfm -%{python2_sitearch}/* +%{python3_sitearch}/* %endif %changelog From f1bd5ac9655d3938696d400d790586176a52f39c Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 22 Jan 2019 18:40:01 +0100 Subject: [PATCH 22/65] Remove obsolete ldconfig scriptlets References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets Signed-off-by: Igor Gnatenko --- libpfm.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 746fc6a..e71a692 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -97,8 +97,7 @@ make \ LDCONFIG=/bin/true \ install -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%ldconfig_scriptlets %files %doc README From 5577a0591b9ae8ebaea57bfc044844b957bb8ad0 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:17:52 +0100 Subject: [PATCH 23/65] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- libpfm.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index e71a692..b148203 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -14,7 +14,6 @@ Release: 5%{?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 @@ -36,7 +35,6 @@ 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 @@ -45,7 +43,6 @@ 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 @@ -60,7 +57,6 @@ 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 From 6e29b869b351165976912f00da71e05a6cacc093 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 1 Feb 2019 07:57:27 +0000 Subject: [PATCH 24/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index b148203..15b759f 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Fri Feb 01 2019 Fedora Release Engineering - 4.10.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Tue Jul 17 2018 Miro Hrončok - 4.10.1-5 - Update Python macros to new packaging standards (See https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package) From 1eb63415a4973518612a277f0c2d0a3257153b1d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jul 2019 14:07:29 +0000 Subject: [PATCH 25/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 15b759f..42cb76c 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Thu Jul 25 2019 Fedora Release Engineering - 4.10.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Fri Feb 01 2019 Fedora Release Engineering - 4.10.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From d4b053985647e430e1e645d50edf1824935fa9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 19 Aug 2019 10:18:18 +0200 Subject: [PATCH 26/65] Rebuilt for Python 3.8 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 42cb76c..e980828 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Mon Aug 19 2019 Miro Hrončok - 4.10.1-8 +- Rebuilt for Python 3.8 + * Thu Jul 25 2019 Fedora Release Engineering - 4.10.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From c5e835f5e85af74d80350e19da366124353538e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 3 Oct 2019 13:55:53 +0200 Subject: [PATCH 27/65] Rebuilt for Python 3.8.0rc1 (#1748018) --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index e980828..894ccf9 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Thu Oct 03 2019 Miro Hrončok - 4.10.1-9 +- Rebuilt for Python 3.8.0rc1 (#1748018) + * Mon Aug 19 2019 Miro Hrončok - 4.10.1-8 - Rebuilt for Python 3.8 From a7cd34e5cbe5b9b51576b57858027d6b4b73fa5e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jan 2020 10:03:11 +0000 Subject: [PATCH 28/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 894ccf9..c536376 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Wed Jan 29 2020 Fedora Release Engineering - 4.10.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Thu Oct 03 2019 Miro Hrončok - 4.10.1-9 - Rebuilt for Python 3.8.0rc1 (#1748018) From f4ffc7d5601b497f43c0d64584ee1c35026d66e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 26 May 2020 02:51:00 +0200 Subject: [PATCH 29/65] Rebuilt for Python 3.9 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index c536376..f456e65 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Tue May 26 2020 Miro Hrončok - 4.10.1-11 +- Rebuilt for Python 3.9 + * Wed Jan 29 2020 Fedora Release Engineering - 4.10.1-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 13951d41422a60bb79b438abf5ac16e8b2abeaa1 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 13 Jul 2020 21:21:46 +0000 Subject: [PATCH 30/65] Use make macros https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro --- libpfm.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index f456e65..358a31e 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Library to encode performance events for use by perf tool @@ -73,7 +73,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}" @@ -113,6 +113,10 @@ make \ %endif %changelog +* Mon Jul 13 2020 Tom Stellard - 4.10.1-12 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + * Tue May 26 2020 Miro Hrončok - 4.10.1-11 - Rebuilt for Python 3.9 From a05595b455f32b92d1a4d4a19deb7eb2f519a54f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 28 Jul 2020 05:20:17 +0000 Subject: [PATCH 31/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 358a31e..c6fd1e1 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Tue Jul 28 2020 Fedora Release Engineering - 4.10.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Mon Jul 13 2020 Tom Stellard - 4.10.1-12 - Use make macros - https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro From be509d634ca6fb4275472b73c06ca7b618203f56 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 8 Sep 2020 11:09:03 -0400 Subject: [PATCH 32/65] Rebase to libpfm-4.11.0. --- .gitignore | 1 + libpfm.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 74baaf8..df137f8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /libpfm-4.9.0.tar.gz /libpfm-4.10.0.tar.gz /libpfm-4.10.1.tar.gz +/libpfm-4.11.0.tar.gz diff --git a/libpfm.spec b/libpfm.spec index c6fd1e1..ab04d61 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.10.1 -Release: 13%{?dist} +Version: 4.11.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Tue Sep 08 2020 William Cohen - 4.11.0-1 +- Rebase on libpfm-4.11.0. + * Tue Jul 28 2020 Fedora Release Engineering - 4.10.1-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 2f0b0d2..3d5afdf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libpfm-4.10.1.tar.gz) = 33d99824216b4d83784e0db9f1aae3b39f84c2ba42dee64dde0b3c43cc5ee3a18c206d9044e75bf10867768add7cb9967c6318f7aa196f178f334271fa05e1aa +SHA512 (libpfm-4.11.0.tar.gz) = 633035b8a7b35973437572095cdc80d422b2a1a61e74e14f106db95fa8e44e4518e591699cc457f828b8f2fb63f60eef6d0c7535c6b4c9a6c3a70d4550b3c3c7 From 035bc07c0b6de22393e26b7b976e50fc447303a6 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 6 Jan 2021 19:45:02 +0000 Subject: [PATCH 33/65] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- libpfm.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/libpfm.spec b/libpfm.spec index ab04d61..04350d9 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -19,6 +19,7 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch +BuildRequires: make BuildRequires: gcc %if %{with python} BuildRequires: python3 From fab1ad1b122671c5862842378860061bfa114e0d Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 22 Jan 2021 13:30:29 -0500 Subject: [PATCH 34/65] Related #1918922 --- libpfm.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 04350d9..d25908b 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -1,3 +1,5 @@ +# Default to no static libraries +%{!?with_static: %global with_static 0} %bcond_without python %if %{with python} %define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") @@ -10,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -42,6 +44,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Development library and header files to create performance monitoring applications for the perf_events interface. +%if %{with_static} %package static Summary: Static library to encode performance events for perf_events based tools Requires: %{name}%{?_isa} = %{version}-%{release} @@ -49,6 +52,7 @@ 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 @@ -94,6 +98,10 @@ make \ LDCONFIG=/bin/true \ install +%if !%{with_static} +rm $RPM_BUILD_ROOT%{_libdir}/lib*.a +%endif + %ldconfig_scriptlets %files @@ -105,8 +113,10 @@ make \ %{_mandir}/man3/* %{_libdir}/lib*.so +%if %{with_static} %files static %{_libdir}/lib*.a +%endif %if %{with python} %files -n python3-libpfm @@ -114,6 +124,9 @@ make \ %endif %changelog +* Fri Jan 22 2021 William Cohen - 4.11.0-2 +- By default disable generation of static libraries + * Tue Sep 08 2020 William Cohen - 4.11.0-1 - Rebase on libpfm-4.11.0. From 06bbef121d7df66d2b702d5cd2c4ddbb23736efd Mon Sep 17 00:00:00 2001 From: William Cohen Date: Sat, 23 Jan 2021 14:52:27 -0500 Subject: [PATCH 35/65] Re-enable libpfm-static for time being. --- libpfm.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index d25908b..cdccd52 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -1,5 +1,5 @@ # Default to no static libraries -%{!?with_static: %global with_static 0} +%{!?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))") @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Sat Jan 23 2021 William Cohen - 4.11.0-3 +- Reenable generation of static libraries for time being. + * Fri Jan 22 2021 William Cohen - 4.11.0-2 - By default disable generation of static libraries From 12dbc8b7aeac00fccadc9fe0142a4a26615c3088 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 17:45:21 +0000 Subject: [PATCH 36/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index cdccd52..f47edbf 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 4.11.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Sat Jan 23 2021 William Cohen - 4.11.0-3 - Reenable generation of static libraries for time being. From e5d977450b543353cbf6514ad6ba9a2442aa6917 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 4 Jun 2021 20:09:41 +0200 Subject: [PATCH 37/65] Rebuilt for Python 3.10 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index f47edbf..3ced186 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Fri Jun 04 2021 Python Maint - 4.11.0-5 +- Rebuilt for Python 3.10 + * Tue Jan 26 2021 Fedora Release Engineering - 4.11.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 1e30143a01c044b2c7a7df6ddaeaeef40b2d1383 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 22 Jul 2021 12:06:05 +0000 Subject: [PATCH 38/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 3ced186..beac79b 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jul 22 2021 Fedora Release Engineering - 4.11.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Fri Jun 04 2021 Python Maint - 4.11.0-5 - Rebuilt for Python 3.10 From dcd2f17914203c24c08d88f991066b1432f7e062 Mon Sep 17 00:00:00 2001 From: Michal Kolar Date: Mon, 20 Sep 2021 21:22:34 +0000 Subject: [PATCH 39/65] init FMF CI gating --- .fmf/version | 1 + gating.yaml | 19 +++++++ plans/ci.fmf | 6 +++ tests/libpfm-testsuite/Makefile | 63 ++++++++++++++++++++++++ tests/libpfm-testsuite/PURPOSE | 3 ++ tests/libpfm-testsuite/main.fmf | 16 ++++++ tests/libpfm-testsuite/runtest.sh | 82 +++++++++++++++++++++++++++++++ 7 files changed, 190 insertions(+) create mode 100644 .fmf/version create mode 100644 gating.yaml create mode 100644 plans/ci.fmf create mode 100644 tests/libpfm-testsuite/Makefile create mode 100644 tests/libpfm-testsuite/PURPOSE create mode 100644 tests/libpfm-testsuite/main.fmf create mode 100755 tests/libpfm-testsuite/runtest.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..ce3cdc1 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,19 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} +--- !Policy +product_versions: + - rhel-8 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..1ad2c12 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,6 @@ +summary: CI Gating Plan +discover: + how: fmf + directory: tests +execute: + how: beakerlib diff --git a/tests/libpfm-testsuite/Makefile b/tests/libpfm-testsuite/Makefile new file mode 100644 index 0000000..ba93382 --- /dev/null +++ b/tests/libpfm-testsuite/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/libpfm/Sanity/libpfm-testsuite +# Description: libpfm-testsuite testing by upstream testsuite +# Author: Michal Kolar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 " > $(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) diff --git a/tests/libpfm-testsuite/PURPOSE b/tests/libpfm-testsuite/PURPOSE new file mode 100644 index 0000000..9c4a286 --- /dev/null +++ b/tests/libpfm-testsuite/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/libpfm/Sanity/libpfm-testsuite +Description: libpfm-testsuite testing by upstream testsuite +Author: Michal Kolar diff --git a/tests/libpfm-testsuite/main.fmf b/tests/libpfm-testsuite/main.fmf new file mode 100644 index 0000000..8b5c8cf --- /dev/null +++ b/tests/libpfm-testsuite/main.fmf @@ -0,0 +1,16 @@ +summary: libpfm-testsuite testing by upstream testsuite +description: '' +contact: Michal Kolar +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 diff --git a/tests/libpfm-testsuite/runtest.sh b/tests/libpfm-testsuite/runtest.sh new file mode 100755 index 0000000..7c8e03d --- /dev/null +++ b/tests/libpfm-testsuite/runtest.sh @@ -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 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 From abee1be380c20c5b105e3cc30f0394894ab76e5c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 16:58:00 +0000 Subject: [PATCH 40/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index beac79b..9a6177a 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 4.11.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Thu Jul 22 2021 Fedora Release Engineering - 4.11.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From da6000bab90b7caea53fff0972e8e568e060396b Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 13 Jun 2022 15:08:54 +0200 Subject: [PATCH 41/65] Rebuilt for Python 3.11 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 9a6177a..e6cacf3 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Mon Jun 13 2022 Python Maint - 4.11.0-8 +- Rebuilt for Python 3.11 + * Thu Jan 20 2022 Fedora Release Engineering - 4.11.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 99bed259508cf61fed622eec45f0d5f897532975 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 21 Jun 2022 12:07:42 -0400 Subject: [PATCH 42/65] Resolve: rhbz2045823 --- libpfm-gcc12.patch | 89 ++++++++++++++++++++++++++++++++++++++++++++++ libpfm.spec | 7 +++- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 libpfm-gcc12.patch diff --git a/libpfm-gcc12.patch b/libpfm-gcc12.patch new file mode 100644 index 0000000..af3bf2c --- /dev/null +++ b/libpfm-gcc12.patch @@ -0,0 +1,89 @@ +commit a7b26272d8327ad1c001456a18518a0ac65dc2bb +Author: Stephane Eranian +Date: Wed Jun 8 06:55:36 2022 -0700 + + avoid GCC-12 use-after-free warnings + + gcc-12 seems to complain about bogus use-after-free situations in the + libpfm4 code: + + p = realloc(q, ...) + if (!p) + return NULL + + s = p + (q - z) + + It complains because of the use of q after realloc in this case. + Yet q - z is just pointer artihmetic and is not dereferencing any + memory through the pointer q which may have been freed by realloc. + + Fix is to pre-computer the delta before realloc to avoid using the + pointer after the call. + + Reported-by: Vitaly Chikunov + Signed-off-by: Stephane Eranian + +diff --git a/lib/pfmlib_perf_event_pmu.c b/lib/pfmlib_perf_event_pmu.c +index c3386aa..637c5b1 100644 +--- a/lib/pfmlib_perf_event_pmu.c ++++ b/lib/pfmlib_perf_event_pmu.c +@@ -268,6 +268,7 @@ perf_table_alloc_event(void) + perf_table_alloc_event(void) + { + perf_event_t *new_pe; ++ size_t num_free; + + retry: + if (perf_pe_free < perf_pe_end) +@@ -286,11 +287,20 @@ retry: + + perf_pe_count += PERF_ALLOC_EVENT_COUNT; + ++ /* ++ * compute number of free events left ++ * before realloc() to avoid compiler warning (use-after-free) ++ * even though we are simply doing pointer arithmetic and not ++ * dereferencing the perf_pe after realloc when it may be stale ++ * in case the memory was moved. ++ */ ++ num_free = perf_pe_free - perf_pe; ++ + new_pe = realloc(perf_pe, perf_pe_count * sizeof(perf_event_t)); + if (!new_pe) + return NULL; + +- perf_pe_free = new_pe + (perf_pe_free - perf_pe); ++ perf_pe_free = new_pe + num_free; + perf_pe_end = perf_pe_free + PERF_ALLOC_EVENT_COUNT; + perf_pe = new_pe; + +@@ -315,18 +325,27 @@ static perf_umask_t * + perf_table_alloc_umask(void) + { + perf_umask_t *new_um; ++ size_t num_free; + + retry: + if (perf_um_free < perf_um_end) + return perf_um_free++; + + perf_um_count += PERF_ALLOC_UMASK_COUNT; +- ++ ++ /* ++ * compute number of free unmasks left ++ * before realloc() to avoid compiler warning (use-after-free) ++ * even though we are simply doing pointer arithmetic and not ++ * dereferencing the perf_um after realloc when it may be stale ++ * in case the memory was moved. ++ */ ++ num_free = perf_um_free - perf_um; + new_um = realloc(perf_um, perf_um_count * sizeof(*new_um)); + if (!new_um) + return NULL; + +- perf_um_free = new_um + (perf_um_free - perf_um); ++ perf_um_free = new_um + num_free; + perf_um_end = perf_um_free + PERF_ALLOC_UMASK_COUNT; + perf_um = new_um; + diff --git a/libpfm.spec b/libpfm.spec index e6cacf3..16e4d66 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,6 +20,7 @@ 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-gcc12.patch BuildRequires: make BuildRequires: gcc @@ -71,6 +72,7 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q %patch2 -p1 -b .python3 +%patch3 -p1 -b .gcc12 %build %if %{with python} @@ -124,6 +126,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Jun 21 2022 Python Maint - 4.11.0-9 +- Fix FTBFS due to gcc12. (rhbz2045823) + * Mon Jun 13 2022 Python Maint - 4.11.0-8 - Rebuilt for Python 3.11 From fb415892efc712ba8208eb0be76ce36bf1a4c105 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 21 Jul 2022 18:40:28 +0000 Subject: [PATCH 43/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 16e4d66..d0d3d7c 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Library to encode performance events for use by perf tool @@ -126,6 +126,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jul 21 2022 Fedora Release Engineering - 4.11.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Tue Jun 21 2022 Python Maint - 4.11.0-9 - Fix FTBFS due to gcc12. (rhbz2045823) From 4e095bbe903c77ca184772fa0a05e4149c3b5c41 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 17:09:29 +0000 Subject: [PATCH 44/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index d0d3d7c..679bc06 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Library to encode performance events for use by perf tool @@ -126,6 +126,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 4.11.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Thu Jul 21 2022 Fedora Release Engineering - 4.11.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From a5d81468548000cb31c6587323494f8870efcb06 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 14 Mar 2023 10:52:30 -0400 Subject: [PATCH 45/65] Add libpfm upstream patch to allow papi-7.0.1 to build. --- libpfm-kernel518.patch | 266 +++++++++++++++++++++++++++++++++++++++++ libpfm.spec | 7 +- 2 files changed, 272 insertions(+), 1 deletion(-) create mode 100644 libpfm-kernel518.patch diff --git a/libpfm-kernel518.patch b/libpfm-kernel518.patch new file mode 100644 index 0000000..67cc260 --- /dev/null +++ b/libpfm-kernel518.patch @@ -0,0 +1,266 @@ +commit 8c606bc2f2d186c2797d9f013283c9150f594f93 +Author: Masahiko, Yamada +Date: Tue Sep 20 14:04:31 2022 +0900 + + update perf_event.h to Linux 5.18 + + The perf_events interface for directly accessing PMU registers + from userspace for arm64 has been formally implemented in the + kernel v5.18. + + Update perf_event.h header used to build perf_event based examples. + + Signed-off-by: Masahiko Yamada + +diff --git a/include/perfmon/perf_event.h b/include/perfmon/perf_event.h +index 81e02a2..a3bbb14 100644 +--- a/include/perfmon/perf_event.h ++++ b/include/perfmon/perf_event.h +@@ -143,7 +143,12 @@ enum perf_event_sample_format { + PERF_SAMPLE_TRANSACTION = 1U << 17, + PERF_SAMPLE_REGS_INTR = 1U << 18, + PERF_SAMPLE_PHYS_ADDR = 1U << 19, +- PERF_SAMPLE_MAX = 1U << 19, ++ PERF_SAMPLE_AUX = 1U << 20, ++ PERF_SAMPLE_CGROUP = 1U << 21, ++ PERF_SAMPLE_DATA_PAGE_SIZE = 1U << 22, ++ PERF_SAMPLE_CODE_PAGE_SIZE = 1U << 23, ++ PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24, ++ PERF_SAMPLE_MAX = 1U << 25, + }; + enum { + PERF_TXN_ELISION = (1 << 0), +@@ -180,6 +185,7 @@ enum perf_branch_sample_type_shift { + PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT = 14, + PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT = 15, + PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 16, ++ PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17, + + PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */ + }; +@@ -204,6 +210,7 @@ enum perf_branch_sample_type { + PERF_SAMPLE_BRANCH_NO_FLAGS = 1U << PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT, + PERF_SAMPLE_BRANCH_NO_CYCLES = 1U << PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT, + PERF_SAMPLE_BRANCH_TYPE_SAVE = 1U << PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT, ++ PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT, + + PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT, + }; +@@ -232,6 +239,8 @@ enum perf_event_read_format { + /* add: sample_stack_user */ + #define PERF_ATTR_SIZE_VER4 104 /* add: sample_regs_intr */ + #define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */ ++#define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */ ++#define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */ + + + /* +@@ -289,7 +298,16 @@ typedef struct perf_event_attr { + context_switch : 1, + write_backward : 1, + namespaces : 1, +- __reserved_1 : 35; ++ ksymbol : 1, ++ bpf_event : 1, ++ aux_output : 1, ++ cgroup : 1, ++ text_poke : 1, ++ build_id : 1, ++ inherit_thread : 1, ++ remove_on_exec : 1, ++ sigtrap : 1, ++ __reserved_1 : 26; + + union { + uint32_t wakeup_events; +@@ -311,7 +329,11 @@ typedef struct perf_event_attr { + int32_t clockid; + uint64_t sample_regs_intr; + uint32_t aux_watermark; +- uint32_t __reserved_2; ++ uint16_t sample_max_stack; ++ uint16_t __reserved_2; ++ uint32_t aux_sample_size; ++ uint32_t __reserved_3; ++ uint64_t sig_data; + } perf_event_attr_t; + + struct perf_branch_entry { +@@ -340,19 +362,32 @@ struct perf_branch_stack { + struct perf_branch_entry entries[0]; + }; + ++/* ++ * Structure used by below PERF_EVENT_IOC_QUERY_BPF command ++ * to query bpf programs attached to the same perf tracepoint ++ * as the given perf event. ++ */ ++struct perf_event_query_bpf { ++ uint32_t ids_len; ++ uint32_t prog_cnt; ++ uint32_t ids[0]; ++}; ++ + /* + * perf_events ioctl commands, use with event fd + */ +-#define PERF_EVENT_IOC_ENABLE _IO ('$', 0) +-#define PERF_EVENT_IOC_DISABLE _IO ('$', 1) +-#define PERF_EVENT_IOC_REFRESH _IO ('$', 2) +-#define PERF_EVENT_IOC_RESET _IO ('$', 3) +-#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t) +-#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) +-#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) +-#define PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *) +-#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t) +-#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) ++#define PERF_EVENT_IOC_ENABLE _IO ('$', 0) ++#define PERF_EVENT_IOC_DISABLE _IO ('$', 1) ++#define PERF_EVENT_IOC_REFRESH _IO ('$', 2) ++#define PERF_EVENT_IOC_RESET _IO ('$', 3) ++#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t) ++#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) ++#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) ++#define PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *) ++#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t) ++#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) ++#define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *) ++#define PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW('$', 11, struct perf_event_attr *) + + /* + * ioctl() 3rd argument +@@ -381,7 +416,8 @@ struct perf_event_mmap_page { + cap_usr_rdpmc:1, + cap_user_time:1, + cap_user_time_zero:1, +- cap_____res:59; ++ cap_user_time_short:1, ++ cap_____res:58; + } SWIG_NAME(rdmap_cap_s); + } SWIG_NAME(rdmap_cap_u); + uint16_t pmc_width; +@@ -391,7 +427,10 @@ struct perf_event_mmap_page { + + uint64_t time_zero; + uint32_t size; +- uint8_t __reserved[118*8+4]; ++ uint32_t __reserved_1; ++ uint64_t time_cycles; ++ uint64_t time_mask; ++ uint8_t __reserved[116*8]; + + uint64_t data_head; + uint64_t data_tail; +@@ -450,9 +489,38 @@ enum perf_event_type { + PERF_RECORD_SWITCH = 14, + PERF_RECORD_SWITCH_CPU_WIDE = 15, + PERF_RECORD_NAMESPACES = 16, ++ PERF_RECORD_KSYMBOL = 17, ++ PERF_RECORD_BPF_EVENT = 18, ++ PERF_RECORD_CGROUP = 19, ++ PERF_RECORD_TEXT_POKE = 20, ++ PERF_RECORD_AUX_OUTPUT_HW_ID = 21, + PERF_RECORD_MAX + }; + ++enum perf_record_ksymbol_type { ++ PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0, ++ PERF_RECORD_KSYMBOL_TYPE_BPF = 1, ++ /* ++ * Out of line code such as kprobe-replaced instructions or optimized ++ * kprobes or ftrace trampolines. ++ */ ++ PERF_RECORD_KSYMBOL_TYPE_OOL = 2, ++ PERF_RECORD_KSYMBOL_TYPE_MAX /* non-ABI */ ++}; ++ ++#define PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER (1 << 0) ++ ++enum perf_bpf_event_type { ++ PERF_BPF_EVENT_UNKNOWN = 0, ++ PERF_BPF_EVENT_PROG_LOAD = 1, ++ PERF_BPF_EVENT_PROG_UNLOAD = 2, ++ PERF_BPF_EVENT_MAX, /* non-ABI */ ++}; ++ ++#define PERF_MAX_STACK_DEPTH 127 ++#define PERF_MAX_CONTEXTS_PER_STACK 8 ++ ++ + enum perf_callchain_context { + PERF_CONTEXT_HV = (uint64_t)-32, + PERF_CONTEXT_KERNEL = (uint64_t)-128, +@@ -465,8 +533,16 @@ enum perf_callchain_context { + PERF_CONTEXT_MAX = (uint64_t)-4095, + }; + +-#define PERF_AUX_FLAG_TRUNCATED 0x01 +-#define PERF_AUX_FLAG_OVERWRITE 0x02 ++#define PERF_AUX_FLAG_TRUNCATED 0x01 ++#define PERF_AUX_FLAG_OVERWRITE 0x02 ++#define PERF_AUX_FLAG_PARTIAL 0x04 ++#define PERF_AUX_FLAG_COLLISION 0x08 ++#define PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK 0xff00 ++ ++/* CoreSight PMU AUX buffer formats */ ++#define PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT 0x0000 ++#define PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW 0x0100 ++ + + /* + * flags for perf_event_open() +@@ -544,12 +620,17 @@ perf_event_open( + union perf_mem_data_src { + uint64_t val; + struct { +- uint64_t mem_op:5, /* type of opcode */ +- mem_lvl:14, /* memory hierarchy level */ +- mem_snoop:5, /* snoop mode */ +- mem_lock:2, /* lock instr */ +- mem_dtlb:7, /* tlb access */ +- mem_rsvd:31; ++ uint64_t mem_op:5, /* type of opcode */ ++ mem_lvl:14, /* memory hierarchy level */ ++ mem_snoop:5, /* snoop mode */ ++ mem_lock:2, /* lock instr */ ++ mem_dtlb:7, /* tlb access */ ++ mem_lvl_num:4, /* memory hierarchy level number */ ++ mem_remote:1, /* remote */ ++ mem_snoopx:2, /* snoop mode, ext */ ++ mem_blk:3, /* access blocked */ ++ mem_hops:3, /* hop level */ ++ mem_rsvd:18; + }; + }; + +@@ -590,7 +671,8 @@ union perf_mem_data_src { + #define PERF_MEM_SNOOP_SHIFT 19 + + #define PERF_MEM_SNOOPX_FWD 0x01 /* forward */ +-#define PERF_MEM_SNOOPX_SHIFT 37 ++/* 1 free */ ++#define PERF_MEM_SNOOPX_SHIFT 38 + + /* locked instruction */ + #define PERF_MEM_LOCK_NA 0x01 /* not available */ +@@ -607,6 +689,20 @@ union perf_mem_data_src { + #define PERF_MEM_TLB_OS 0x40 /* OS fault handler */ + #define PERF_MEM_TLB_SHIFT 26 + ++/* Access blocked */ ++#define PERF_MEM_BLK_NA 0x01 /* not available */ ++#define PERF_MEM_BLK_DATA 0x02 /* data could not be forwarded */ ++#define PERF_MEM_BLK_ADDR 0x04 /* address conflict */ ++#define PERF_MEM_BLK_SHIFT 40 ++ ++/* hop level */ ++#define PERF_MEM_HOPS_0 0x01 /* remote core, same node */ ++#define PERF_MEM_HOPS_1 0x02 /* remote node, same socket */ ++#define PERF_MEM_HOPS_2 0x03 /* remote socket, same board */ ++#define PERF_MEM_HOPS_3 0x04 /* remote board */ ++/* 5-7 available */ ++#define PERF_MEM_HOPS_SHIFT 43 ++ + #define PERF_MEM_S(a, s) \ + (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) + diff --git a/libpfm.spec b/libpfm.spec index 679bc06..bb1fa70 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Library to encode performance events for use by perf tool @@ -21,6 +21,7 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch Patch3: libpfm-gcc12.patch +Patch4: libpfm-kernel518.patch BuildRequires: make BuildRequires: gcc @@ -73,6 +74,7 @@ Python bindings for libpfm4 and perf_event_open system call. %setup -q %patch2 -p1 -b .python3 %patch3 -p1 -b .gcc12 +%patch4 -p1 -b .kernel518 %build %if %{with python} @@ -126,6 +128,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Mar 14 2023 William Cohen - 4.11.0-12 +- Add libpfm upstream patch to allow papi-7.0.1 to build. + * Thu Jan 19 2023 Fedora Release Engineering - 4.11.0-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From face84c751eeb8488ba37dd603eda6294104f5c9 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 28 Mar 2023 23:31:46 -0400 Subject: [PATCH 46/65] Rebase on libpfm-4.13.0. --- .gitignore | 1 + libpfm-gcc12.patch | 89 -------------- libpfm-kernel518.patch | 266 ----------------------------------------- libpfm.spec | 11 +- sources | 2 +- 5 files changed, 7 insertions(+), 362 deletions(-) delete mode 100644 libpfm-gcc12.patch delete mode 100644 libpfm-kernel518.patch diff --git a/.gitignore b/.gitignore index df137f8..0f753c1 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /libpfm-4.10.0.tar.gz /libpfm-4.10.1.tar.gz /libpfm-4.11.0.tar.gz +/libpfm-4.13.0.tar.gz diff --git a/libpfm-gcc12.patch b/libpfm-gcc12.patch deleted file mode 100644 index af3bf2c..0000000 --- a/libpfm-gcc12.patch +++ /dev/null @@ -1,89 +0,0 @@ -commit a7b26272d8327ad1c001456a18518a0ac65dc2bb -Author: Stephane Eranian -Date: Wed Jun 8 06:55:36 2022 -0700 - - avoid GCC-12 use-after-free warnings - - gcc-12 seems to complain about bogus use-after-free situations in the - libpfm4 code: - - p = realloc(q, ...) - if (!p) - return NULL - - s = p + (q - z) - - It complains because of the use of q after realloc in this case. - Yet q - z is just pointer artihmetic and is not dereferencing any - memory through the pointer q which may have been freed by realloc. - - Fix is to pre-computer the delta before realloc to avoid using the - pointer after the call. - - Reported-by: Vitaly Chikunov - Signed-off-by: Stephane Eranian - -diff --git a/lib/pfmlib_perf_event_pmu.c b/lib/pfmlib_perf_event_pmu.c -index c3386aa..637c5b1 100644 ---- a/lib/pfmlib_perf_event_pmu.c -+++ b/lib/pfmlib_perf_event_pmu.c -@@ -268,6 +268,7 @@ perf_table_alloc_event(void) - perf_table_alloc_event(void) - { - perf_event_t *new_pe; -+ size_t num_free; - - retry: - if (perf_pe_free < perf_pe_end) -@@ -286,11 +287,20 @@ retry: - - perf_pe_count += PERF_ALLOC_EVENT_COUNT; - -+ /* -+ * compute number of free events left -+ * before realloc() to avoid compiler warning (use-after-free) -+ * even though we are simply doing pointer arithmetic and not -+ * dereferencing the perf_pe after realloc when it may be stale -+ * in case the memory was moved. -+ */ -+ num_free = perf_pe_free - perf_pe; -+ - new_pe = realloc(perf_pe, perf_pe_count * sizeof(perf_event_t)); - if (!new_pe) - return NULL; - -- perf_pe_free = new_pe + (perf_pe_free - perf_pe); -+ perf_pe_free = new_pe + num_free; - perf_pe_end = perf_pe_free + PERF_ALLOC_EVENT_COUNT; - perf_pe = new_pe; - -@@ -315,18 +325,27 @@ static perf_umask_t * - perf_table_alloc_umask(void) - { - perf_umask_t *new_um; -+ size_t num_free; - - retry: - if (perf_um_free < perf_um_end) - return perf_um_free++; - - perf_um_count += PERF_ALLOC_UMASK_COUNT; -- -+ -+ /* -+ * compute number of free unmasks left -+ * before realloc() to avoid compiler warning (use-after-free) -+ * even though we are simply doing pointer arithmetic and not -+ * dereferencing the perf_um after realloc when it may be stale -+ * in case the memory was moved. -+ */ -+ num_free = perf_um_free - perf_um; - new_um = realloc(perf_um, perf_um_count * sizeof(*new_um)); - if (!new_um) - return NULL; - -- perf_um_free = new_um + (perf_um_free - perf_um); -+ perf_um_free = new_um + num_free; - perf_um_end = perf_um_free + PERF_ALLOC_UMASK_COUNT; - perf_um = new_um; - diff --git a/libpfm-kernel518.patch b/libpfm-kernel518.patch deleted file mode 100644 index 67cc260..0000000 --- a/libpfm-kernel518.patch +++ /dev/null @@ -1,266 +0,0 @@ -commit 8c606bc2f2d186c2797d9f013283c9150f594f93 -Author: Masahiko, Yamada -Date: Tue Sep 20 14:04:31 2022 +0900 - - update perf_event.h to Linux 5.18 - - The perf_events interface for directly accessing PMU registers - from userspace for arm64 has been formally implemented in the - kernel v5.18. - - Update perf_event.h header used to build perf_event based examples. - - Signed-off-by: Masahiko Yamada - -diff --git a/include/perfmon/perf_event.h b/include/perfmon/perf_event.h -index 81e02a2..a3bbb14 100644 ---- a/include/perfmon/perf_event.h -+++ b/include/perfmon/perf_event.h -@@ -143,7 +143,12 @@ enum perf_event_sample_format { - PERF_SAMPLE_TRANSACTION = 1U << 17, - PERF_SAMPLE_REGS_INTR = 1U << 18, - PERF_SAMPLE_PHYS_ADDR = 1U << 19, -- PERF_SAMPLE_MAX = 1U << 19, -+ PERF_SAMPLE_AUX = 1U << 20, -+ PERF_SAMPLE_CGROUP = 1U << 21, -+ PERF_SAMPLE_DATA_PAGE_SIZE = 1U << 22, -+ PERF_SAMPLE_CODE_PAGE_SIZE = 1U << 23, -+ PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24, -+ PERF_SAMPLE_MAX = 1U << 25, - }; - enum { - PERF_TXN_ELISION = (1 << 0), -@@ -180,6 +185,7 @@ enum perf_branch_sample_type_shift { - PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT = 14, - PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT = 15, - PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 16, -+ PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17, - - PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */ - }; -@@ -204,6 +210,7 @@ enum perf_branch_sample_type { - PERF_SAMPLE_BRANCH_NO_FLAGS = 1U << PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT, - PERF_SAMPLE_BRANCH_NO_CYCLES = 1U << PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT, - PERF_SAMPLE_BRANCH_TYPE_SAVE = 1U << PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT, -+ PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT, - - PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT, - }; -@@ -232,6 +239,8 @@ enum perf_event_read_format { - /* add: sample_stack_user */ - #define PERF_ATTR_SIZE_VER4 104 /* add: sample_regs_intr */ - #define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */ -+#define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */ -+#define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */ - - - /* -@@ -289,7 +298,16 @@ typedef struct perf_event_attr { - context_switch : 1, - write_backward : 1, - namespaces : 1, -- __reserved_1 : 35; -+ ksymbol : 1, -+ bpf_event : 1, -+ aux_output : 1, -+ cgroup : 1, -+ text_poke : 1, -+ build_id : 1, -+ inherit_thread : 1, -+ remove_on_exec : 1, -+ sigtrap : 1, -+ __reserved_1 : 26; - - union { - uint32_t wakeup_events; -@@ -311,7 +329,11 @@ typedef struct perf_event_attr { - int32_t clockid; - uint64_t sample_regs_intr; - uint32_t aux_watermark; -- uint32_t __reserved_2; -+ uint16_t sample_max_stack; -+ uint16_t __reserved_2; -+ uint32_t aux_sample_size; -+ uint32_t __reserved_3; -+ uint64_t sig_data; - } perf_event_attr_t; - - struct perf_branch_entry { -@@ -340,19 +362,32 @@ struct perf_branch_stack { - struct perf_branch_entry entries[0]; - }; - -+/* -+ * Structure used by below PERF_EVENT_IOC_QUERY_BPF command -+ * to query bpf programs attached to the same perf tracepoint -+ * as the given perf event. -+ */ -+struct perf_event_query_bpf { -+ uint32_t ids_len; -+ uint32_t prog_cnt; -+ uint32_t ids[0]; -+}; -+ - /* - * perf_events ioctl commands, use with event fd - */ --#define PERF_EVENT_IOC_ENABLE _IO ('$', 0) --#define PERF_EVENT_IOC_DISABLE _IO ('$', 1) --#define PERF_EVENT_IOC_REFRESH _IO ('$', 2) --#define PERF_EVENT_IOC_RESET _IO ('$', 3) --#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t) --#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) --#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) --#define PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *) --#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t) --#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) -+#define PERF_EVENT_IOC_ENABLE _IO ('$', 0) -+#define PERF_EVENT_IOC_DISABLE _IO ('$', 1) -+#define PERF_EVENT_IOC_REFRESH _IO ('$', 2) -+#define PERF_EVENT_IOC_RESET _IO ('$', 3) -+#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t) -+#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) -+#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) -+#define PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *) -+#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t) -+#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) -+#define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *) -+#define PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW('$', 11, struct perf_event_attr *) - - /* - * ioctl() 3rd argument -@@ -381,7 +416,8 @@ struct perf_event_mmap_page { - cap_usr_rdpmc:1, - cap_user_time:1, - cap_user_time_zero:1, -- cap_____res:59; -+ cap_user_time_short:1, -+ cap_____res:58; - } SWIG_NAME(rdmap_cap_s); - } SWIG_NAME(rdmap_cap_u); - uint16_t pmc_width; -@@ -391,7 +427,10 @@ struct perf_event_mmap_page { - - uint64_t time_zero; - uint32_t size; -- uint8_t __reserved[118*8+4]; -+ uint32_t __reserved_1; -+ uint64_t time_cycles; -+ uint64_t time_mask; -+ uint8_t __reserved[116*8]; - - uint64_t data_head; - uint64_t data_tail; -@@ -450,9 +489,38 @@ enum perf_event_type { - PERF_RECORD_SWITCH = 14, - PERF_RECORD_SWITCH_CPU_WIDE = 15, - PERF_RECORD_NAMESPACES = 16, -+ PERF_RECORD_KSYMBOL = 17, -+ PERF_RECORD_BPF_EVENT = 18, -+ PERF_RECORD_CGROUP = 19, -+ PERF_RECORD_TEXT_POKE = 20, -+ PERF_RECORD_AUX_OUTPUT_HW_ID = 21, - PERF_RECORD_MAX - }; - -+enum perf_record_ksymbol_type { -+ PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0, -+ PERF_RECORD_KSYMBOL_TYPE_BPF = 1, -+ /* -+ * Out of line code such as kprobe-replaced instructions or optimized -+ * kprobes or ftrace trampolines. -+ */ -+ PERF_RECORD_KSYMBOL_TYPE_OOL = 2, -+ PERF_RECORD_KSYMBOL_TYPE_MAX /* non-ABI */ -+}; -+ -+#define PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER (1 << 0) -+ -+enum perf_bpf_event_type { -+ PERF_BPF_EVENT_UNKNOWN = 0, -+ PERF_BPF_EVENT_PROG_LOAD = 1, -+ PERF_BPF_EVENT_PROG_UNLOAD = 2, -+ PERF_BPF_EVENT_MAX, /* non-ABI */ -+}; -+ -+#define PERF_MAX_STACK_DEPTH 127 -+#define PERF_MAX_CONTEXTS_PER_STACK 8 -+ -+ - enum perf_callchain_context { - PERF_CONTEXT_HV = (uint64_t)-32, - PERF_CONTEXT_KERNEL = (uint64_t)-128, -@@ -465,8 +533,16 @@ enum perf_callchain_context { - PERF_CONTEXT_MAX = (uint64_t)-4095, - }; - --#define PERF_AUX_FLAG_TRUNCATED 0x01 --#define PERF_AUX_FLAG_OVERWRITE 0x02 -+#define PERF_AUX_FLAG_TRUNCATED 0x01 -+#define PERF_AUX_FLAG_OVERWRITE 0x02 -+#define PERF_AUX_FLAG_PARTIAL 0x04 -+#define PERF_AUX_FLAG_COLLISION 0x08 -+#define PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK 0xff00 -+ -+/* CoreSight PMU AUX buffer formats */ -+#define PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT 0x0000 -+#define PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW 0x0100 -+ - - /* - * flags for perf_event_open() -@@ -544,12 +620,17 @@ perf_event_open( - union perf_mem_data_src { - uint64_t val; - struct { -- uint64_t mem_op:5, /* type of opcode */ -- mem_lvl:14, /* memory hierarchy level */ -- mem_snoop:5, /* snoop mode */ -- mem_lock:2, /* lock instr */ -- mem_dtlb:7, /* tlb access */ -- mem_rsvd:31; -+ uint64_t mem_op:5, /* type of opcode */ -+ mem_lvl:14, /* memory hierarchy level */ -+ mem_snoop:5, /* snoop mode */ -+ mem_lock:2, /* lock instr */ -+ mem_dtlb:7, /* tlb access */ -+ mem_lvl_num:4, /* memory hierarchy level number */ -+ mem_remote:1, /* remote */ -+ mem_snoopx:2, /* snoop mode, ext */ -+ mem_blk:3, /* access blocked */ -+ mem_hops:3, /* hop level */ -+ mem_rsvd:18; - }; - }; - -@@ -590,7 +671,8 @@ union perf_mem_data_src { - #define PERF_MEM_SNOOP_SHIFT 19 - - #define PERF_MEM_SNOOPX_FWD 0x01 /* forward */ --#define PERF_MEM_SNOOPX_SHIFT 37 -+/* 1 free */ -+#define PERF_MEM_SNOOPX_SHIFT 38 - - /* locked instruction */ - #define PERF_MEM_LOCK_NA 0x01 /* not available */ -@@ -607,6 +689,20 @@ union perf_mem_data_src { - #define PERF_MEM_TLB_OS 0x40 /* OS fault handler */ - #define PERF_MEM_TLB_SHIFT 26 - -+/* Access blocked */ -+#define PERF_MEM_BLK_NA 0x01 /* not available */ -+#define PERF_MEM_BLK_DATA 0x02 /* data could not be forwarded */ -+#define PERF_MEM_BLK_ADDR 0x04 /* address conflict */ -+#define PERF_MEM_BLK_SHIFT 40 -+ -+/* hop level */ -+#define PERF_MEM_HOPS_0 0x01 /* remote core, same node */ -+#define PERF_MEM_HOPS_1 0x02 /* remote node, same socket */ -+#define PERF_MEM_HOPS_2 0x03 /* remote socket, same board */ -+#define PERF_MEM_HOPS_3 0x04 /* remote board */ -+/* 5-7 available */ -+#define PERF_MEM_HOPS_SHIFT 43 -+ - #define PERF_MEM_S(a, s) \ - (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) - diff --git a/libpfm.spec b/libpfm.spec index bb1fa70..8d6e2c4 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -11,8 +11,8 @@ %endif Name: libpfm -Version: 4.11.0 -Release: 12%{?dist} +Version: 4.13.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,8 +20,6 @@ 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-gcc12.patch -Patch4: libpfm-kernel518.patch BuildRequires: make BuildRequires: gcc @@ -73,8 +71,6 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q %patch2 -p1 -b .python3 -%patch3 -p1 -b .gcc12 -%patch4 -p1 -b .kernel518 %build %if %{with python} @@ -128,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Mar 28 2023 William Cohen - 4.13.0-1 +- Rebase on libpfm-4.13.0. + * Tue Mar 14 2023 William Cohen - 4.11.0-12 - Add libpfm upstream patch to allow papi-7.0.1 to build. diff --git a/sources b/sources index 3d5afdf..b2d4ea3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libpfm-4.11.0.tar.gz) = 633035b8a7b35973437572095cdc80d422b2a1a61e74e14f106db95fa8e44e4518e591699cc457f828b8f2fb63f60eef6d0c7535c6b4c9a6c3a70d4550b3c3c7 +SHA512 (libpfm-4.13.0.tar.gz) = e61b210aa2ce80f0e47603c88eee2e4f2fe30ca2c0e194a5472b6a8de3bf9dc1085e5261bbb9ddbe5b6531c4b391fb34f20d038e5ebd8e6f4c14c2112aee508f From 0f9c88b81f951d126ac2c53f7fdf24ca24c0d1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 25 Apr 2023 14:13:18 +0200 Subject: [PATCH 47/65] Don't install a Python .egg Due to an upcoming deprecation of .eggs in pip, we'd like to avoid all Python .eggs in Fedora. setuptools forces installation of an .egg when --prefix is set without --root. To make this work, we set the make's DESTDIR variable rather than prefixing other values with it. To assert this works, we list the Python files explicitly, as required by https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_explicit_lists --- libpfm.spec | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 8d6e2c4..66d92f4 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -71,6 +71,10 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q %patch2 -p1 -b .python3 +# 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} @@ -86,14 +90,15 @@ Python bindings for libpfm4 and perf_event_open system call. 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 @@ -120,10 +125,14 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %if %{with python} %files -n python3-libpfm -%{python3_sitearch}/* +%{python3_sitearch}/perfmon-*.egg-info/ +%{python3_sitearch}/perfmon/ %endif %changelog +* Tue Apr 25 2023 Miro Hrončok - 4.13.0-2 +- Don't install a Python .egg + * Tue Mar 28 2023 William Cohen - 4.13.0-1 - Rebase on libpfm-4.13.0. From 2d5dcdf0e7fe33efea8e0da642fbd4f43a736751 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Tue, 13 Jun 2023 20:43:09 +0200 Subject: [PATCH 48/65] Rebuilt for Python 3.12 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 66d92f4..d806936 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -130,6 +130,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Jun 13 2023 Python Maint - 4.13.0-3 +- Rebuilt for Python 3.12 + * Tue Apr 25 2023 Miro Hrončok - 4.13.0-2 - Don't install a Python .egg From 22274b8db4c93af0f63611d8ba5ebb4f43466490 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 11:45:57 +0000 Subject: [PATCH 49/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index d806936..baec9e3 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -130,6 +130,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 4.13.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue Jun 13 2023 Python Maint - 4.13.0-3 - Rebuilt for Python 3.12 From 109072acb0151a65f618f627957f23685d13f615 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 1 Aug 2023 09:48:34 -0400 Subject: [PATCH 50/65] migrated to SPDX license --- libpfm.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index baec9e3..0bb1e41 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -37,6 +37,7 @@ 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 Requires: %{name}%{?_isa} = %{version}-%{release} @@ -46,6 +47,7 @@ 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 Requires: %{name}%{?_isa} = %{version}-%{release} @@ -56,6 +58,7 @@ applications for the perf_events interface. %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} @@ -130,6 +133,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Aug 1 2023 William Cohen - 4.13.0-5 +- migrated to SPDX license + * Thu Jul 20 2023 Fedora Release Engineering - 4.13.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 0697d01219e46a0c4cf4b72aff06385fedf4e519 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 05:00:03 +0000 Subject: [PATCH 51/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 0bb1e41..51cd03a 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -133,6 +133,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 4.13.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Tue Aug 1 2023 William Cohen - 4.13.0-5 - migrated to SPDX license From 461c2dd0bd9a31f0f6e7c5755804e6f97a2354ef Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 03:13:09 +0000 Subject: [PATCH 52/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 51cd03a..699adb1 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Library to encode performance events for use by perf tool @@ -133,6 +133,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 4.13.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 4.13.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From dcb84740cd296a92ffc8598b7318faa6c457096a Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 29 Jan 2024 16:34:57 -0500 Subject: [PATCH 53/65] Fix gcc-14 -Werror=calloc-transposed-args compatibility --- libpfm-gcc14.patch | 21 +++++++++++++++++++++ libpfm.spec | 9 +++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 libpfm-gcc14.patch diff --git a/libpfm-gcc14.patch b/libpfm-gcc14.patch new file mode 100644 index 0000000..9f2a62d --- /dev/null +++ b/libpfm-gcc14.patch @@ -0,0 +1,21 @@ +commit cb944829e0940d74009e09b8985b4f2139f5cb3b +Author: William Cohen +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; + diff --git a/libpfm.spec b/libpfm.spec index 699adb1..bd80765 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,6 +20,7 @@ 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-gcc14.patch BuildRequires: make BuildRequires: gcc @@ -73,7 +74,8 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q -%patch2 -p1 -b .python3 +%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 @@ -133,6 +135,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Mon Jan 29 2024 William Cohen - 4.13.0-8 +- Fix gcc-14 -Werror=calloc-transposed-args compatibility + * Thu Jan 25 2024 Fedora Release Engineering - 4.13.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From e8e4c2f2e9a0db1b35984de163068639facadb7c Mon Sep 17 00:00:00 2001 From: Michal Kolar Date: Fri, 2 Feb 2024 09:11:21 +0000 Subject: [PATCH 54/65] plans/ci.fmf: fix deprecated fmf plan attribute --- plans/ci.fmf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plans/ci.fmf b/plans/ci.fmf index 1ad2c12..3fd3ab7 100644 --- a/plans/ci.fmf +++ b/plans/ci.fmf @@ -1,6 +1,5 @@ summary: CI Gating Plan discover: how: fmf - directory: tests execute: - how: beakerlib + how: tmt From 5b33854516e671b5dcc693b4d4c4ed5b5ffbc303 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 23 Jan 2024 15:47:16 -0500 Subject: [PATCH 55/65] Modernize provides filter https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndRequiresFiltering/ --- libpfm.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index bd80765..093ff6e 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -4,10 +4,7 @@ %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 %{python3_sitearch}/perfmon/.*\.so$ -%filter_setup -} +%global __provides_exclude_from ^%{python3_sitearch}/perfmon/.*\.so$ %endif Name: libpfm From 9c38e7ca4d14ddecd9137e45b475a3173de67b1b Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 7 Jun 2024 08:51:39 +0200 Subject: [PATCH 56/65] Rebuilt for Python 3.13 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 093ff6e..ebd1d73 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Fri Jun 07 2024 Python Maint - 4.13.0-9 +- Rebuilt for Python 3.13 + * Mon Jan 29 2024 William Cohen - 4.13.0-8 - Fix gcc-14 -Werror=calloc-transposed-args compatibility From d9915b348de8759e2a31690c755d23cb1882434a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 14:46:25 +0000 Subject: [PATCH 57/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index ebd1d73..afcbc0d 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 4.13.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Fri Jun 07 2024 Python Maint - 4.13.0-9 - Rebuilt for Python 3.13 From c9663bf9f8d06cf44a0a055ff1480f3b9448bef4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 12:58:01 +0000 Subject: [PATCH 58/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index afcbc0d..10c14f9 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 4.13.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Thu Jul 18 2024 Fedora Release Engineering - 4.13.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From fab74e854f1a6f0106eea0746fc92e568a8e3179 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 2 Jun 2025 20:26:21 +0200 Subject: [PATCH 59/65] Rebuilt for Python 3.14 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 10c14f9..d478b11 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Mon Jun 02 2025 Python Maint - 4.13.0-12 +- Rebuilt for Python 3.14 + * Fri Jan 17 2025 Fedora Release Engineering - 4.13.0-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 12330968afe4d47e389a8242296bb9634058bbef Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 20:10:36 +0000 Subject: [PATCH 60/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index d478b11..79bca51 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 4.13.0-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Mon Jun 02 2025 Python Maint - 4.13.0-12 - Rebuilt for Python 3.14 From 9b4205af69aa73b02e72726991365d5f870048d3 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 15 Aug 2025 12:56:39 +0200 Subject: [PATCH 61/65] Rebuilt for Python 3.14.0rc2 bytecode --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 79bca51..fef78c1 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 13%{?dist} +Release: 14%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Fri Aug 15 2025 Python Maint - 4.13.0-14 +- Rebuilt for Python 3.14.0rc2 bytecode + * Thu Jul 24 2025 Fedora Release Engineering - 4.13.0-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 91fced006a95ab85a5c30a572a81f870fc9b0f87 Mon Sep 17 00:00:00 2001 From: Aaron Merey Date: Mon, 25 Aug 2025 11:18:03 -0400 Subject: [PATCH 62/65] tests/runtest.sh: Fix path to tests Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2389127 --- tests/libpfm-testsuite/runtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libpfm-testsuite/runtest.sh b/tests/libpfm-testsuite/runtest.sh index 7c8e03d..a5997d6 100755 --- a/tests/libpfm-testsuite/runtest.sh +++ b/tests/libpfm-testsuite/runtest.sh @@ -55,7 +55,7 @@ rlJournalStart 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 "cd \"$TmpDir\"/BUILD/libpfm-*-build/libpfm-*/tests 2>/dev/null || 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" From 0bfaf1d1cb79cffd156b0ea7a73095c9eb07d2ff Mon Sep 17 00:00:00 2001 From: Aaron Merey Date: Mon, 25 Aug 2025 12:04:16 -0400 Subject: [PATCH 63/65] libpfm.spec: bump release number --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index fef78c1..409d65b 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Mon Aug 25 2025 Aaron Merey - 4.13.0-15 +- Fix path in tests/runtest.sh + * Fri Aug 15 2025 Python Maint - 4.13.0-14 - Rebuilt for Python 3.14.0rc2 bytecode From 37780f084700403189de71ed0f73776008123bf3 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 19 Sep 2025 12:27:20 +0200 Subject: [PATCH 64/65] Rebuilt for Python 3.14.0rc3 bytecode --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 409d65b..f9fb838 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 15%{?dist} +Release: 16%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Fri Sep 19 2025 Python Maint - 4.13.0-16 +- Rebuilt for Python 3.14.0rc3 bytecode + * Mon Aug 25 2025 Aaron Merey - 4.13.0-15 - Fix path in tests/runtest.sh From 7581f961126a36779ddff1aa5f81497a2fe1a7f7 Mon Sep 17 00:00:00 2001 From: Aaron Merey Date: Tue, 16 Dec 2025 10:55:52 -0500 Subject: [PATCH 65/65] Add libpfm-fix-const.patch --- libpfm-fix-const.patch | 59 ++++++++++++++++++++++++++++++++++++++++++ libpfm.spec | 7 ++++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 libpfm-fix-const.patch diff --git a/libpfm-fix-const.patch b/libpfm-fix-const.patch new file mode 100644 index 0000000..b9a2308 --- /dev/null +++ b/libpfm-fix-const.patch @@ -0,0 +1,59 @@ +From ded148888c501c2e9d21c23263d7c09aed4b97d6 Mon Sep 17 00:00:00 2001 +From: Aaron Merey +Date: Fri, 19 Dec 2025 12:33:33 -0500 +Subject: [PATCH] fix discarded const warning on newer gcc + +--- + lib/pfmlib_common.c | 15 +++++++++------ + tests/validate_x86.c | 2 +- + 2 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c +index 44b5de4..59a7cff 100644 +--- a/lib/pfmlib_common.c ++++ b/lib/pfmlib_common.c +@@ -1625,12 +1625,6 @@ pfmlib_parse_event(const char *event, pfmlib_event_desc_t *d) + const char *pname = NULL; + int i, j, ret; + +- /* +- * support only one event at a time. +- */ +- p = strpbrk(event, PFMLIB_EVENT_DELIM); +- if (p) +- return PFM_ERR_INVAL; + /* + * create copy because string is const + */ +@@ -1638,6 +1632,15 @@ pfmlib_parse_event(const char *event, pfmlib_event_desc_t *d) + if (!str) + return PFM_ERR_NOMEM; + ++ /* ++ * support only one event at a time. ++ */ ++ p = strpbrk(s, PFMLIB_EVENT_DELIM); ++ if (p) { ++ free(s); ++ return PFM_ERR_INVAL; ++ } ++ + + /* check for optional PMU name */ + p = strstr(s, PFMLIB_PMU_DELIM); +diff --git a/tests/validate_x86.c b/tests/validate_x86.c +index 500a697..68a776d 100644 +--- a/tests/validate_x86.c ++++ b/tests/validate_x86.c +@@ -8018,7 +8018,7 @@ static int + check_pmu_supported(const char *evt) + { + pfm_pmu_info_t info; +- char *p; ++ const char *p; + int ret; + pfm_pmu_t i; + +-- +2.52.0 + diff --git a/libpfm.spec b/libpfm.spec index f9fb838..d7384ca 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,13 +9,14 @@ Name: libpfm Version: 4.13.0 -Release: 16%{?dist} +Release: 17%{?dist} Summary: Library to encode performance events for use by perf tool License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz +Patch1: libpfm-fix-const.patch Patch2: libpfm-python3-setup.patch Patch3: libpfm-gcc14.patch @@ -71,6 +72,7 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q +%patch -P1 -p1 -b .fix-const %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 @@ -132,6 +134,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Dec 16 2025 Aaron Merey - 4.13.0-17 +- Add libpfm-fix-const.patch + * Fri Sep 19 2025 Python Maint - 4.13.0-16 - Rebuilt for Python 3.14.0rc3 bytecode