[packages/kernel-tools] Up to 7.2.0
arekm
arekm at pld-linux.org
Sat Aug 22 22:28:42 CEST 2026
commit e34c8d547526928c97a4e3bb076f255506144101
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Aug 22 22:28:33 2026 +0200
Up to 7.2.0
kernel-tools-perf-gtk2.patch | 6 +--
kernel-tools-perf-slang.patch | 22 ++++++++
kernel-tools-perf-update.patch | 18 ++-----
kernel-tools.spec | 120 +++++++++++++++++++++++++++++------------
x32.patch | 60 +++++++++------------
5 files changed, 139 insertions(+), 87 deletions(-)
---
diff --git a/kernel-tools.spec b/kernel-tools.spec
index 20348cf..633be62 100644
--- a/kernel-tools.spec
+++ b/kernel-tools.spec
@@ -3,7 +3,6 @@
# - add -n python-perf?
# - add bcond to disable building docs (perf docs)
# - install of perf links perf binary again
-# - build runqslower (needs vmlinux with BPF section)
#
# Conditional build:
%bcond_without verbose # verbose build (V=1)
@@ -12,24 +11,23 @@
%bcond_without gtk # GTK+ 2.x perf support
%bcond_without libunwind # libunwind perf support
%bcond_without multilib # multilib perf support
-%bcond_with runqslower # runqslower bpf tool
%bcond_without usbip # usbip utils
%ifnarch %{x8664}
%undefine with_multilib
%endif
-%define basever 7.1
+%define basever 7.2
%define postver .0
Summary: Assortment of tools for the Linux kernel
Summary(pl.UTF-8): Zestaw narzędzi dla jądra Linuksa
Name: kernel-tools
Version: %{basever}%{postver}
-Release: 3
+Release: 1
License: GPL v2
Group: Applications/System
Source0: https://www.kernel.org/pub/linux/kernel/v7.x/linux-%{basever}.tar.xz
-# Source0-md5: b6b169bbd9c9c19857ad16db2ddf8def
+# Source0-md5: 381ae4b20294dcf4b8f63f1fd1bb7017
Source1: cpupower.service
Source2: cpupower.config
Source3: cpupower at .service
@@ -41,8 +39,12 @@ Patch1: x32.patch
Patch2: regex.patch
Patch3: %{name}-perf-update.patch
Patch4: %{name}-perf-gtk2.patch
+Patch5: %{name}-perf-slang.patch
URL: https://www.kernel.org/
+BuildRequires: asciidoc
BuildRequires: bison
+BuildRequires: docbook-dtd45-xml
+BuildRequires: docbook-style-xsl
BuildRequires: docutils
BuildRequires: flex
BuildRequires: gettext-tools
@@ -58,22 +60,18 @@ BuildRequires: readline-devel
BuildRequires: rpm-build >= 4.6
BuildRequires: rpmbuild(macros) >= 2.020
BuildRequires: tar >= 1:1.22
+BuildRequires: xmlto
BuildRequires: xz
%if %{with perf}
-BuildRequires: asciidoc
BuildRequires: audit-libs-devel
BuildRequires: babeltrace-devel
BuildRequires: binutils-devel >= 4:2.29
BuildRequires: clang >= 12.0.1
-BuildRequires: docbook-dtd45-xml
-BuildRequires: docbook-style-xsl
BuildRequires: elfutils-devel >= 0.158
%if %{with multilib}
BuildRequires: gcc-multilib-32
BuildRequires: gcc-multilib-x32
%endif
-# for `btftool btf dump file ... format c` - requires vmlinux with BPF section
-%{?with_runqslower:BuildRequires: kernel-vmlinux >= 5.?}
BuildRequires: libbpf-devel
BuildRequires: libcap-devel
BuildRequires: libstdc++-devel >= 6:8
@@ -87,11 +85,10 @@ BuildRequires: python3-setuptools
BuildRequires: rpm-pythonprov
BuildRequires: rust
BuildRequires: slang-devel
-BuildRequires: xmlto
BuildRequires: xz-devel
BuildRequires: zlib-devel
BuildRequires: zstd-devel
-# openscd? (CORESIGHT=1 for %{arm}?)
+# openscd? (CORESIGHT=1 for %%{arm}?)
%if %{with gtk}
BuildRequires: gtk+2-devel >= 2.0
%endif
@@ -201,6 +198,22 @@ Hyper-V virtualization tools.
%description hv -l pl.UTF-8
Narzędzia do wirtualizacji Hyper-V.
+%package kvm_stat
+Summary: KVM live statistics tool
+Summary(pl.UTF-8): Narzędzie do bieżących statystyk KVM
+Group: Applications/System
+Requires(post,preun,postun): systemd-units >= 38
+Requires: systemd-units >= 38
+
+%description kvm_stat
+kvm_stat prints counts of KVM kernel module trace events. These events
+signify state transitions such as guest mode entry and exit.
+
+%description kvm_stat -l pl.UTF-8
+kvm_stat wypisuje liczniki zdarzeń śledzenia modułu jądra KVM. Zdarzenia
+te oznaczają zmiany stanu, takie jak wejście do trybu gościa i wyjście z
+niego.
+
%package perf
Summary: perf profiler tool
Summary(pl.UTF-8): Narzędzie profilujące perf
@@ -421,20 +434,10 @@ cd linux-%{basever}
%patch -P2 -p1
%patch -P3 -p1
%patch -P4 -p1
+%patch -P5 -p1
-%{__sed} -i -e '/^CFLAGS = /s/ -g / $(OPTFLAGS) /' tools/hv/Makefile
-%{__sed} -i -e '/^CFLAGS+=/s/ -O1 / $(OPTFLAGS) /' tools/thermal/tmon/Makefile
%{__sed} -i -e 's#libexec/perf-core#%{_lib}/perf-core#g' tools/perf/Makefile.config
-# don't rebuild on make install
-%{__sed} -i -e '/^\$(LIBBPF): FORCE/ s/FORCE$//' tools/bpf/bpftool/Makefile
-
-%if %{without runqslower}
-%{__sed} -i -e '/^all: / s/ runqslower//' \
- -e '/^install: / s/ runqslower_install//' \
- tools/bpf/Makefile
-%endif
-
%build
Wstringop=""
Waddressof=""
@@ -468,7 +471,7 @@ CFLAGS="%{rpmcflags}" \
%ifarch %{ix86}
ARCH=x86 \
%endif
- OPTFLAGS="%{rpmcflags}"
+ CFLAGS="%{rpmcflags} %{rpmcppflags}"
%endif
CFLAGS="%{rpmcflags}" \
@@ -487,8 +490,7 @@ CFLAGS="%{rpmcflags}" \
CFLAGS="%{rpmcflags}" \
%{__make} -C tools/bpf \
%{makeopts} \
- EXTRA_CFLAGS="%{rpmcflags}" \
- %{?with_runqslower:VMLINUX_BTF=$(rpm -ql kernel-vmlinux | head -n 1)}
+ EXTRA_CFLAGS="%{rpmcflags}"
# perf
%if %{with perf}
@@ -499,7 +501,7 @@ CXXFLAGS="%{rpmcxxflags}" \
%{!?with_multilib:NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1} \
%endif
%{?with_gtk:GTK2=1} \
- %{!?with_libunwind:NO_LIBUNWIND=1} \
+ %{?with_libunwind:LIBUNWIND=1} %{!?with_libunwind:NO_LIBUNWIND=1} \
%{makeopts} \
EXTRA_CFLAGS="%{rpmcflags}" \
JOBS=%{__jobs} \
@@ -542,9 +544,15 @@ CFLAGS="%{rpmcflags}" \
%{makeopts}
%endif
+%ifarch %{x8664}
+%{__make} -C tools/arch/x86/intel_sdsi \
+ %{makeopts} \
+ CFLAGS="%{rpmcflags} %{rpmcppflags}"
+%endif
+
%{__make} -C tools/thermal/tmon \
%{makeopts} \
- OPTFLAGS="%{rpmcflags}"
+ CFLAGS="%{rpmcflags} %{rpmcppflags}"
# usbip-utils
%if %{with usbip}
@@ -562,16 +570,24 @@ cd tools/usb/usbip
cd ../../..
%endif
-# page-types, slabinfo
-%{__make} -C tools/mm page-types slabinfo \
+# page-types, slabinfo, page_owner_sort
+CFLAGS="%{rpmcflags} %{rpmcppflags}" \
+%{__make} -C tools/mm page-types slabinfo page_owner_sort \
+ %{makeopts}
+
+# bootconfig ('all' would also run the test suite)
+CFLAGS="%{rpmcflags} %{rpmcppflags}" \
+%{__make} -C tools/bootconfig bootconfig \
%{makeopts}
- CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
# gen_init_cpio
%{__make} -C usr gen_init_cpio \
%{makeopts} \
CFLAGS="%{rpmcflags}"
+# kvm_stat man page
+%{__make} -C tools/kvm/kvm_stat man
+
# kernel-chktaint
%{__make} -C tools/debugging
@@ -613,7 +629,7 @@ CXXFLAGS="%{rpmcxxflags}" \
%{!?with_multilib:NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1} \
%endif
%{?with_gtk:GTK2=1} \
- %{!?with_libunwind:NO_LIBUNWIND=1} \
+ %{?with_libunwind:LIBUNWIND=1} %{!?with_libunwind:NO_LIBUNWIND=1} \
LIBPERL=1 \
%{makeopts} \
EXTRA_CFLAGS="%{rpmcflags}" \
@@ -638,11 +654,11 @@ CXXFLAGS="%{rpmcxxflags}" \
%{__rm} $RPM_BUILD_ROOT%{_libdir}/libusbip.la
%endif
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man8}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,%{_mandir}/man8,%{systemdunitdir}}
install -p tools/laptop/dslm/dslm $RPM_BUILD_ROOT%{_sbindir}
-install -p tools/gpio/lsgpio $RPM_BUILD_ROOT%{_bindir}
+install -p tools/gpio/{gpio-event-mon,gpio-hammer,gpio-watch,lsgpio} $RPM_BUILD_ROOT%{_bindir}
%ifarch %{ix86} %{x8664} x32
install -p tools/hv/hv_{fcopy_uio,kvp,vss}_daemon $RPM_BUILD_ROOT%{_sbindir}
@@ -667,9 +683,14 @@ install -p tools/laptop/freefall/freefall $RPM_BUILD_ROOT%{_sbindir}
install -p tools/thermal/tmon/tmon $RPM_BUILD_ROOT%{_bindir}
cp -p tools/thermal/tmon/tmon.8 $RPM_BUILD_ROOT%{_mandir}/man8
-install -p tools/mm/slabinfo $RPM_BUILD_ROOT%{_bindir}
+install -p tools/mm/{page_owner_sort,slabinfo} $RPM_BUILD_ROOT%{_bindir}
install -p tools/mm/page-types $RPM_BUILD_ROOT%{_sbindir}
+%{__sed} -e '1s,/usr/bin/env python3,%{__python3},' tools/kvm/kvm_stat/kvm_stat >$RPM_BUILD_ROOT%{_bindir}/kvm_stat
+chmod 755 $RPM_BUILD_ROOT%{_bindir}/kvm_stat
+cp -p tools/kvm/kvm_stat/kvm_stat.1 $RPM_BUILD_ROOT%{_mandir}/man1
+cp -p tools/kvm/kvm_stat/kvm_stat.service $RPM_BUILD_ROOT%{systemdunitdir}
+
%ifarch %{ix86} %{x8664} x32
install -d $RPM_BUILD_ROOT%{_mandir}/man8
%{__make} -C tools/power/x86/x86_energy_perf_policy install \
@@ -679,6 +700,12 @@ install -d $RPM_BUILD_ROOT%{_mandir}/man8
DESTDIR=$RPM_BUILD_ROOT
%endif
+%ifarch %{x8664}
+install -p tools/arch/x86/intel_sdsi/intel_sdsi $RPM_BUILD_ROOT%{_sbindir}
+%endif
+
+install -p tools/bootconfig/bootconfig $RPM_BUILD_ROOT%{_bindir}
+
# gen_init_cpio
install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
@@ -700,20 +727,34 @@ rm -rf $RPM_BUILD_ROOT
%postun cpupower
%systemd_reload
+%post kvm_stat
+%systemd_post kvm_stat.service
+
+%preun kvm_stat
+%systemd_preun kvm_stat.service
+
+%postun kvm_stat
+%systemd_reload
+
%post -n usbip-libs -p /sbin/ldconfig
%postun -n usbip-libs -p /sbin/ldconfig
%files
%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/bootconfig
%attr(755,root,root) %{_bindir}/bpf_asm
%attr(755,root,root) %{_bindir}/bpf_dbg
%attr(755,root,root) %{_bindir}/bpf_jit_disasm
%attr(755,root,root) %{_bindir}/gen_init_cpio
+%attr(755,root,root) %{_bindir}/gpio-event-mon
+%attr(755,root,root) %{_bindir}/gpio-hammer
+%attr(755,root,root) %{_bindir}/gpio-watch
%attr(755,root,root) %{_bindir}/iio_event_monitor
%attr(755,root,root) %{_bindir}/iio_generic_buffer
%attr(755,root,root) %{_bindir}/kernel-chktaint
%attr(755,root,root) %{_bindir}/lsgpio
%attr(755,root,root) %{_bindir}/lsiio
+%attr(755,root,root) %{_bindir}/page_owner_sort
%attr(755,root,root) %{_bindir}/slabinfo
%attr(755,root,root) %{_bindir}/tmon
%attr(755,root,root) %{_sbindir}/bpftool
@@ -726,6 +767,9 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_bindir}/centrino-decode
%attr(755,root,root) %{_bindir}/powernow-k8-decode
%endif
+%ifarch %{x8664}
+%attr(755,root,root) %{_sbindir}/intel_sdsi
+%endif
%ifarch %{ix86} %{x8664} x32
%attr(755,root,root) %{_bindir}/turbostat
%attr(755,root,root) %{_bindir}/x86_energy_perf_policy
@@ -757,6 +801,12 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%{bash_compdir}/cpupower
+%files kvm_stat
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/kvm_stat
+%{_mandir}/man1/kvm_stat.1*
+%{systemdunitdir}/kvm_stat.service
+
%ifarch %{ix86} %{x8664} x32
%files hv
%defattr(644,root,root,755)
diff --git a/kernel-tools-perf-gtk2.patch b/kernel-tools-perf-gtk2.patch
index a983bdb..271f729 100644
--- a/kernel-tools-perf-gtk2.patch
+++ b/kernel-tools-perf-gtk2.patch
@@ -1,7 +1,7 @@
gtk+2 uses glib APIs that are deprecated in 2.62.x
---- linux-5.3/tools/perf/Makefile.config.orig 2019-09-25 05:32:27.522918998 +0200
-+++ linux-5.3/tools/perf/Makefile.config 2019-09-25 16:00:49.492003246 +0200
-@@ -169,6 +169,8 @@
+--- linux-7.2/tools/perf/Makefile.config.orig
++++ linux-7.2/tools/perf/Makefile.config
+@@ -212,6 +212,8 @@
FEATURE_CHECK_CFLAGS-libzstd := $(LIBZSTD_CFLAGS)
FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
diff --git a/kernel-tools-perf-slang.patch b/kernel-tools-perf-slang.patch
new file mode 100644
index 0000000..d445869
--- /dev/null
+++ b/kernel-tools-perf-slang.patch
@@ -0,0 +1,22 @@
+perf assumes <slang.h> is directly on the include path; ask pkg-config instead
+--- linux-7.2/tools/perf/Makefile.config.orig
++++ linux-7.2/tools/perf/Makefile.config
+@@ -214,6 +214,10 @@
+
+ FEATURE_CHECK_CFLAGS-gtk2 := -Wno-deprecated-declarations
+ FEATURE_CHECK_CFLAGS-gtk2-infobar := -Wno-deprecated-declarations
++
++# slang.h is not always at the top of the include path (PLD: /usr/include/slang)
++SLANG_CFLAGS := $(shell $(PKG_CONFIG) --cflags slang 2>/dev/null)
++FEATURE_CHECK_CFLAGS-libslang := $(SLANG_CFLAGS)
+ # for linking with debug library, run like:
+ # make DEBUG=1 PKG_CONFIG_PATH=/opt/libtraceevent/(lib|lib64)/pkgconfig
+
+@@ -775,6 +779,7 @@
+ endif
+ ifndef NO_SLANG
+ CFLAGS += -DHAVE_SLANG_SUPPORT
++ CFLAGS += $(SLANG_CFLAGS)
+ EXTLIBS += -lslang
+ $(call detected,CONFIG_SLANG)
+ endif
diff --git a/kernel-tools-perf-update.patch b/kernel-tools-perf-update.patch
index 8120098..43cd8e7 100644
--- a/kernel-tools-perf-update.patch
+++ b/kernel-tools-perf-update.patch
@@ -1,16 +1,6 @@
---- linux-4.12/tools/perf/util/libunwind/x86_32.c.orig 2017-07-03 01:07:02.000000000 +0200
-+++ linux-4.12/tools/perf/util/libunwind/x86_32.c 2017-07-13 18:03:18.986458842 +0200
-@@ -25,6 +25,7 @@
- #include "libunwind-x86.h"
- #include <../../../../arch/x86/include/uapi/asm/perf_regs.h>
-
-+#define EINVAL 22
- /* HAVE_ARCH_X86_64_SUPPORT is used in'arch/x86/util/unwind-libunwind.c'
- * for x86_32, we undef it to compile code for x86_32 only.
- */
---- linux-5.16/tools/perf/arch/x86/tests/arch-tests.c.orig 2022-01-15 10:37:17.937990467 +0100
-+++ linux-5.16/tools/perf/arch/x86/tests/arch-tests.c 2022-01-15 11:34:56.522587040 +0100
-@@ -8,7 +8,7 @@ DEFINE_SUITE("x86 rdpmc", rdpmc);
+--- linux-7.2/tools/perf/arch/x86/tests/arch-tests.c.orig
++++ linux-7.2/tools/perf/arch/x86/tests/arch-tests.c
+@@ -18,7 +18,7 @@
.test_cases = intel_pt_tests,
};
@@ -19,7 +9,7 @@
DEFINE_SUITE("x86 bp modify", bp_modify);
#endif
DEFINE_SUITE("AMD IBS via core pmu", amd_ibs_via_core_pmu);
-@@ -22,7 +22,7 @@ struct test_suite *arch_tests[] = {
+@@ -41,7 +41,7 @@
&suite__insn_x86,
#endif
&suite__intel_pt,
diff --git a/x32.patch b/x32.patch
index 09bd1f9..3dfa16f 100644
--- a/x32.patch
+++ b/x32.patch
@@ -1,7 +1,7 @@
FIXME: verify x32 ABI support in regs_load.S
---- linux-5.11/tools/scripts/Makefile.arch.orig 2021-02-25 19:40:18.181160970 +0100
-+++ linux-5.11/tools/scripts/Makefile.arch 2021-02-25 19:46:07.599314457 +0100
-@@ -34,8 +34,15 @@
+--- linux-7.2/tools/scripts/Makefile.arch.orig
++++ linux-7.2/tools/scripts/Makefile.arch
+@@ -39,8 +39,15 @@
endif
LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
@@ -17,28 +17,29 @@ FIXME: verify x32 ABI support in regs_load.S
+else
+ IS_X32_BIT := 0
+endif
---- linux-6.14/tools/perf/Makefile.config.orig 2025-03-24 15:02:41.000000000 +0100
-+++ linux-6.14/tools/perf/Makefile.config 2025-04-09 22:43:13.019125496 +0200
-@@ -48,9 +48,17 @@ ifeq ($(SRCARCH),x86)
- endif
+--- linux-7.2/tools/perf/Makefile.config.orig
++++ linux-7.2/tools/perf/Makefile.config
+@@ -72,6 +72,9 @@
+ CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT
+ ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
$(call detected,CONFIG_X86_64)
- else
-+ ifeq (${IS_X32_BIT}, 1)
-+ CFLAGS += -DHAVE_ARCH_X32_SUPPORT
-+ ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
-+ ifndef NO_LIBUNWIND
-+ LIBUNWIND_LIBS = -lunwind-x86_64 -llzma -lunwind
-+ endif
-+ else
- ifndef NO_LIBUNWIND
- LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
- endif
-+ endif
++ else ifeq (${IS_X32_BIT}, 1)
++ CFLAGS += -DHAVE_ARCH_X32_SUPPORT
++ ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
endif
endif
---- linux-5.11/tools/perf/arch/x86/tests/regs_load.S.orig 2021-02-14 23:32:24.000000000 +0100
-+++ linux-5.11/tools/perf/arch/x86/tests/regs_load.S 2021-02-25 21:46:57.425008548 +0100
+@@ -108,6 +111,8 @@
+ ifeq ($(SRCARCH),x86)
+ ifeq (${IS_64_BIT}, 1)
+ LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma
++ else ifeq (${IS_X32_BIT}, 1)
++ LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma
+ else
+ LIBUNWIND_LIBS = -lunwind-x86 -lunwind -llzma
+ endif
+--- linux-7.2/tools/perf/arch/x86/tests/regs_load.S.orig
++++ linux-7.2/tools/perf/arch/x86/tests/regs_load.S
@@ -62,6 +62,41 @@
ret
SYM_FUNC_END(perf_regs_load)
@@ -89,9 +90,9 @@ FIXME: verify x32 ABI support in regs_load.S
/*
* We need to provide note.GNU-stack section, saying that we want
---- linux-3.19/tools/perf/builtin-kvm.c~ 2015-02-09 03:54:22.000000000 +0100
-+++ linux-3.19/tools/perf/builtin-kvm.c 2015-04-11 12:36:00.511251770 +0200
-@@ -565,7 +565,7 @@
+--- linux-7.2/tools/perf/builtin-kvm.c.orig
++++ linux-7.2/tools/perf/builtin-kvm.c
+@@ -1042,7 +1042,7 @@
gettimeofday(&tv, NULL);
if (localtime_r(&tv.tv_sec, <ime)) {
strftime(date, sizeof(date), "%H:%M:%S", <ime);
@@ -100,14 +101,3 @@ FIXME: verify x32 ABI support in regs_load.S
} else
pr_info("00:00:00.000000");
---- linux-5.11/tools/perf/arch/x86/util/unwind-libunwind.c.orig 2021-02-25 20:23:15.561804956 +0100
-+++ linux-5.11/tools/perf/arch/x86/util/unwind-libunwind.c 2021-02-25 20:39:56.170430285 +0100
-@@ -8,7 +8,7 @@
- #include "../../util/unwind.h"
- #endif
-
--#ifdef HAVE_ARCH_X86_64_SUPPORT
-+#if defined(HAVE_ARCH_X86_64_SUPPORT) || defined(HAVE_ARCH_X32_SUPPORT)
- int LIBUNWIND__ARCH_REG_ID(int regnum)
- {
- int id;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/kernel-tools.git/commitdiff/e34c8d547526928c97a4e3bb076f255506144101
More information about the pld-cvs-commit
mailing list