]> git.pld-linux.org Git - packages/kernel-tools.git/blobdiff - kernel-tools.spec
up to 5.19.0
[packages/kernel-tools.git] / kernel-tools.spec
index e143c02b9f6247648813f05f441f9df614c8d9fa..821631b82d705819b58786c9de7a95c8c88fc625 100644 (file)
@@ -3,7 +3,8 @@
 # - 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)
 %bcond_without cpupower        # cpupower tools
 %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         5.3
-%define                postver         .6
+%define                basever         5.19
+%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
@@ -27,12 +29,13 @@ Release:    1
 License:       GPL v2
 Group:         Applications/System
 Source0:       https://www.kernel.org/pub/linux/kernel/v5.x/linux-%{basever}.tar.xz
-# Source0-md5: c99feaade8047339528fb066ec5f8a49
+# Source0-md5: f91bfe133d2cb1692f705947282e123a
 Source1:       cpupower.service
 Source2:       cpupower.config
+Source3:       cpupower@.service
 %if "%{postver}" != ".0"
 Patch0:                https://www.kernel.org/pub/linux/kernel/v5.x/patch-%{version}.xz
-# Patch0-md5:  2c2db421d422d0d7306fe230c65c862c
+# Patch0-md5:  5a015eeaa9a3bf5bea84290f54ccf48d
 %endif
 Patch1:                x32.patch
 Patch2:                regex.patch
@@ -50,6 +53,7 @@ BuildRequires:        pciutils-devel
 BuildRequires: pkgconfig
 BuildRequires: python3
 BuildRequires: python3-modules
+BuildRequires: readline-devel
 BuildRequires: rpmbuild(macros) >= 1.673
 BuildRequires: tar >= 1:1.22
 BuildRequires: xz
@@ -65,6 +69,9 @@ BuildRequires:        elfutils-devel >= 0.158
 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: libcap-devel
 %{?with_libunwind:BuildRequires:       libunwind-devel >= 0.99}
 BuildRequires: numactl-devel
 BuildRequires: openssl-devel
@@ -89,12 +96,24 @@ BuildRequires:      libtool >= 2:2
 BuildRequires: libwrap-devel
 BuildRequires: udev-devel
 %endif
+# /usr/bin/turbostat
+Conflicts:     pmtools < 20110323-2
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 # otherwise /usr/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
 %define                _enable_debug_packages  0
 
-%define                makeopts        CC="%{__cc}" %{?with_verbose:V=1}
+%ifarch ppc ppc64
+%define                makearch        powerpc
+%else
+%ifarch aarch64
+%define                makearch        arm64
+%else
+%define                makearch        %{_target_base_arch}
+%endif
+%endif
+
+%define                makeopts        ARCH=%{makearch} CC="%{__cc}" %{?with_verbose:V=1}
 
 %description
 This package contains the software from tools/ subdirectory from Linux
@@ -155,9 +174,7 @@ Summary(pl.UTF-8):  Bashowe uzupełnianie parametrów dla poleceń cpupower
 Group:         Applications/Shells
 Requires:      %{name}-cpupower = %{version}-%{release}
 Requires:      bash-completion
-%if "%{_rpmversion}" >= "5"
 BuildArch:     noarch
-%endif
 
 %description -n bash-completion-cpupower
 Bash completion for cpupower tools.
@@ -181,8 +198,8 @@ Summary:    perf profiler tool
 Summary(pl.UTF-8):     Narzędzie profilujące perf
 Group:         Applications/System
 Suggests:      binutils
-Obsoletes:     perf-core
-Obsoletes:     perf-slang
+Obsoletes:     kernel-tools-perf-core < 3.16.2
+Obsoletes:     kernel-tools-perf-slang < 3.16.2
 
 %description perf
 Perf is a profiler tool for Linux 2.6+ based systems that abstracts
@@ -281,9 +298,7 @@ Summary(pl.UTF-8):  Bashowe uzupełnianie parametrów dla polecenia perf
 Group:         Applications/Shells
 Requires:      %{name}-perf = %{version}-%{release}
 Requires:      bash-completion
-%if "%{_rpmversion}" >= "5"
 BuildArch:     noarch
-%endif
 
 %description -n bash-completion-perf
 Bash completion for perf command.
@@ -297,9 +312,7 @@ Summary(pl.UTF-8):  Bashowe uzupełnianie parametrów dla poleceń kernel-tools
 Group:         Applications/Shells
 Requires:      %{name} = %{version}-%{release}
 Requires:      bash-completion >= 2.0
-%if "%{_rpmversion}" >= "5"
 BuildArch:     noarch
-%endif
 
 %description -n bash-completion-kernel-tools
 Bash completion for kernel-tools commands (currently bpftool).
@@ -403,11 +416,17 @@ cd linux-%{basever}
 
 %{__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#share/perf-core#g' tools/perf/Makefile.config
+%{__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=""
@@ -437,30 +456,28 @@ CFLAGS="%{rpmcflags}" \
 # HyperV is Windows based, x86 specific
 %ifarch %{ix86} %{x8664} x32
 %{__make} -C tools/hv \
-       CC="%{__cc}" \
+       %{makeopts} \
        OPTFLAGS="%{rpmcflags}"
 %endif
 
 CFLAGS="%{rpmcflags}" \
 %{__make} -C tools/iio -j1 \
-       CC="%{__cc}" \
-       %{?with_verbose:V=1}
+       %{makeopts}
 
 %{__make} -C tools/laptop/freefall \
-       CC="%{__cc}" \
+       %{makeopts} \
        CFLAGS="%{rpmcflags}"
 
 # make bpftool first, top-level bpf CFLAGS cause includes conflict
 CFLAGS="%{rpmcflags}" \
 %{__make} -C tools/bpf/bpftool \
-       CC="%{__cc}" \
-       %{?with_verbose:V=1}
+       %{makeopts}
 
 CFLAGS="%{rpmcflags}" \
 %{__make} -C tools/bpf \
-       CC="%{__cc}" \
+       %{makeopts} \
        EXTRA_CFLAGS="%{rpmcflags}" \
-       %{?with_verbose:V=1}
+       %{?with_runqslower:VMLINUX_BTF=$(rpm -ql kernel-vmlinux | head -n 1)}
 
 # perf
 %if %{with perf}
@@ -469,13 +486,14 @@ CFLAGS="%{rpmcflags}" \
        IS_X86_64=1 \
        %{!?with_multilib:NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1} \
 %endif
-       %{!?with_gtk:NO_GTK2=1} \
+       %{?with_gtk:GTK2=1} \
        %{!?with_libunwind:NO_LIBUNWIND=1} \
        %{makeopts} \
-       CFLAGS_OPTIMIZE="%{rpmcflags}" \
+       EXTRA_CFLAGS="%{rpmcflags}" \
+       VF=1 \
        WERROR=0 \
        prefix=%{_prefix} \
-       perfexecdir=%{_datadir}/perf-core \
+       perfexecdir=%{_libdir}/perf-core \
        lib=%{_lib} \
        template_dir=%{_datadir}/perf-core/templates
 %endif
@@ -490,13 +508,13 @@ CFLAGS="%{rpmcflags}" \
 
 %ifarch %{ix86} x32
 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
-       CC="%{__cc}" \
+       %{makeopts} \
        CFLAGS="%{rpmcflags}"
 %endif
 
 %ifarch %{x8664} x32
 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
-       CC="%{__cc}" \
+       %{makeopts} \
        CFLAGS="%{rpmcflags}"
 %endif
 %endif
@@ -504,15 +522,15 @@ CFLAGS="%{rpmcflags}" \
 %ifarch %{ix86} %{x8664} x32
 CFLAGS="%{rpmcflags}" \
 %{__make} -C tools/power/x86/x86_energy_perf_policy \
-       CC="%{__cc}"
+       %{makeopts}
 
 CFLAGS="%{rpmcflags}" \
 %{__make} -C tools/power/x86/turbostat \
-       CC="%{__cc}"
+       %{makeopts}
 %endif
 
 %{__make} -C tools/thermal/tmon \
-       CC="%{__cc}" \
+       %{makeopts} \
        OPTFLAGS="%{rpmcflags}"
 
 # usbip-utils
@@ -533,7 +551,7 @@ cd ../../..
 
 # page-types, slabinfo
 %{__make} -C tools/vm page-types slabinfo \
-       CC="%{__cc}" \
+       %{makeopts}
        CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
 
 # gen_init_cpio
@@ -559,6 +577,7 @@ cd linux-%{basever}
 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower@.service
 
 %ifarch %{ix86} x32
 install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
@@ -569,28 +588,27 @@ install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_
 %endif
 
 %if %{with perf}
-%{__make} -C tools/perf install install-man \
+%{__make} -C tools/perf install \
 %ifarch %{x8664}
        IS_X86_64=1 \
        %{!?with_multilib:NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1} \
 %endif
-       %{!?with_gtk:NO_GTK2=1} \
+       %{?with_gtk:GTK2=1} \
        %{!?with_libunwind:NO_LIBUNWIND=1} \
-       CC="%{__cc}" \
-       CFLAGS_OPTIMIZE="%{rpmcflags}" \
+       %{makeopts} \
+       EXTRA_CFLAGS="%{rpmcflags}" \
        WERROR=0 \
-       %{?with_verbose:V=1} \
        prefix=%{_prefix} \
-       perfexecdir=%{_datadir}/perf-core \
+       perfexecdir=%{_libdir}/perf-core \
        template_dir=%{_datadir}/perf-core/templates \
        bash_compdir=%{bash_compdir} \
        lib=%{_lib} \
        DESTDIR=$RPM_BUILD_ROOT
 
-%py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
-%py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
+%py_comp $RPM_BUILD_ROOT%{_libdir}/perf-core/scripts/python
+%py_ocomp $RPM_BUILD_ROOT%{_libdir}/perf-core/scripts/python
 
-%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
+%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/perf-core/tests
 %endif
 
 %if %{with usbip}
@@ -644,9 +662,6 @@ install -d $RPM_BUILD_ROOT%{_mandir}/man8
 # gen_init_cpio
 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
 
-# packaged in man-pages (5.02)
-%{__rm} $RPM_BUILD_ROOT%{_mandir}/man7/bpf-helpers.7*
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -699,6 +714,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/cpupower
 %{_mandir}/man1/cpupower*.1*
 %{systemdunitdir}/cpupower.service
+%{systemdunitdir}/cpupower@.service
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
 
 %files cpupower-libs
@@ -735,31 +751,35 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/perf*.1*
 %{_docdir}/perf-tip
 %dir %{_datadir}/perf-core
-%attr(755,root,root) %{_datadir}/perf-core/perf-archive
-%attr(755,root,root) %{_datadir}/perf-core/perf-with-kcore
 %{_datadir}/perf-core/strace
-
-%dir %{_datadir}/perf-core/scripts
-
-%dir %{_datadir}/perf-core/scripts/perl
-%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
-%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
-%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
-%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
-%{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
-%dir %{_datadir}/perf-core/scripts/perl/bin
-%attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
-%{_datadir}/perf-core/scripts/perl/*.pl
-
-%dir %{_datadir}/perf-core/scripts/python
-%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
-%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
-%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
-%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
-%{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
-%dir %{_datadir}/perf-core/scripts/python/bin
-%attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
-%{_datadir}/perf-core/scripts/python/*.py*
+%dir %{_libdir}/perf-core
+%attr(755,root,root) %{_libdir}/perf-core/perf-archive
+%attr(755,root,root) %{_libdir}/perf-core/perf-iostat
+%dir %{_libdir}/perf-core/dlfilters
+%attr(755,root,root) %{_libdir}/perf-core/dlfilters/dlfilter-show-cycles.so
+%attr(755,root,root) %{_libdir}/perf-core/dlfilters/dlfilter-test-api-v0.so
+
+%dir %{_libdir}/perf-core/scripts
+
+%dir %{_libdir}/perf-core/scripts/perl
+%dir %{_libdir}/perf-core/scripts/perl/Perf-Trace-Util
+%dir %{_libdir}/perf-core/scripts/perl/Perf-Trace-Util/lib
+%dir %{_libdir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
+%dir %{_libdir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
+%{_libdir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
+%dir %{_libdir}/perf-core/scripts/perl/bin
+%attr(755,root,root) %{_libdir}/perf-core/scripts/perl/bin/*
+%{_libdir}/perf-core/scripts/perl/*.pl
+
+%dir %{_libdir}/perf-core/scripts/python
+%dir %{_libdir}/perf-core/scripts/python/Perf-Trace-Util
+%dir %{_libdir}/perf-core/scripts/python/Perf-Trace-Util/lib
+%dir %{_libdir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
+%dir %{_libdir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
+%{_libdir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
+%dir %{_libdir}/perf-core/scripts/python/bin
+%attr(755,root,root) %{_libdir}/perf-core/scripts/python/bin/*
+%{_libdir}/perf-core/scripts/python/*.py*
 
 %dir %{_libdir}/traceevent
 %dir %{_libdir}/traceevent/plugins
@@ -769,6 +789,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_prefix}/lib/perf/examples
 %{_prefix}/lib/perf/include
 
+%{_includedir}/perf
+
 %if %{with multilib}
 %files perf-vdso32
 %defattr(644,root,root,755)
This page took 0.10013 seconds and 4 git commands to generate.